From 6f2d0af7c00686aa05f8fd54b17f5403cba8c843 Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Wed, 29 Nov 2023 10:55:52 +0200 Subject: [PATCH] fix: close interbtc api connections, fetch coingecko ids for lending currencies --- api/tvl_dex.js | 1 + api/tvl_loans.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/tvl_dex.js b/api/tvl_dex.js index 0c16070dc..f39c9fbb4 100644 --- a/api/tvl_dex.js +++ b/api/tvl_dex.js @@ -44,6 +44,7 @@ const tvlDex = async (request, response) => { } }); + interbtcApi.disconnect(); return response.status(200) .setHeader("content-type", "application/json") .setHeader("cache-control", "public, maxage=0, s-maxage=300") diff --git a/api/tvl_loans.js b/api/tvl_loans.js index 1b29f5089..84f98b0c1 100644 --- a/api/tvl_loans.js +++ b/api/tvl_loans.js @@ -15,7 +15,7 @@ const tvlLoans = async (request, response) => { // dedupe ids const coingeckoIds = new Set( - liquidityAmounts.map((monetaryAmount) => monetaryAmount.currency) + liquidityAmounts.map((monetaryAmount) => getCoingeckoId(monetaryAmount.currency)) ); // base: usd, get price for all coingeckoIds const queryUrl = getCoingeckoQueryUrl("usd", Array.from(coingeckoIds)); @@ -44,6 +44,7 @@ const tvlLoans = async (request, response) => { } }); + interbtcApi.disconnect(); return response.status(200) .setHeader("content-type", "application/json") .setHeader("cache-control", "public, maxage=0, s-maxage=300")