Skip to content

Commit

Permalink
fix: close interbtc api connections, fetch coingecko ids for lending …
Browse files Browse the repository at this point in the history
…currencies
  • Loading branch information
bvotteler committed Nov 29, 2023
1 parent cf7de3f commit 6f2d0af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/tvl_dex.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion api/tvl_loans.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 6f2d0af

Please sign in to comment.