diff --git a/api/tvl_dex.js b/api/tvl_dex.js index 348d297d2..1bae1a8b1 100644 --- a/api/tvl_dex.js +++ b/api/tvl_dex.js @@ -2,11 +2,12 @@ import { createInterBtcApi } from "@interlay/interbtc-api"; const tvlDex = async (request, response) => { if (request.method === 'GET') { - const interbtcApi = await createInterBtcApi(process.env.REACT_APP_RELAY_CHAIN_URL, process.env.REACT_APP_BITCOIN_NETWORK); - - if (!interbtcApi.api.isConnected) { - await interbtcApi.api.connect(); - } + const interbtcApi = await createInterBtcApi( + process.env.REACT_APP_RELAY_CHAIN_URL, + process.env.REACT_APP_BITCOIN_NETWORK, + undefined, + 3 + ); const pools = await interbtcApi.amm.getLiquidityPools(); const currencies = pools.flatMap((pool) => pool.pooledCurrencies);