diff --git a/src/adaptors/zerolend/index.js b/src/adaptors/zerolend/index.js index 45fb78cc57..77e6d6537f 100755 --- a/src/adaptors/zerolend/index.js +++ b/src/adaptors/zerolend/index.js @@ -22,6 +22,11 @@ const chainUrlParam = { base: ['proto_base_v3'], }; +const mainnnet_pools = { + '0x3bc3d34c32cc98bf098d832364df8a222bbab4c0': 'proto_mainnet_lrt_v3', + '0xcd2b31071119d7ea449a9d211ac8ebf7ee97f987': 'proto_mainnet_btc_v3', + '0xd3a4da66ec15a001466f324fa08037f3272bdbe8': 'proto_mainnet_rwa_v3', +}; const oraclePriceABI = { inputs: [ { @@ -111,7 +116,7 @@ const API_URLS = { ethereum: [ baseUrl + 'zerolend-mainnet-lrt/1.0.0/gn', baseUrl + 'zerolend-mainnet-btc/1.0.0/gn', - // baseUrl + 'zerolend-mainnet-rwa/1.0.0/gn', + baseUrl + 'zerolend-mainnet-rwa/1.0.1/gn', ], linea: [baseUrl + 'zerolend-linea/1.0.0/gn'], era: [baseUrl + 'zerolend-zksync/1.0.0/gn'], @@ -126,6 +131,9 @@ const query = gql` reserves(where: { name_not: "" }) { name borrowingEnabled + pool { + pool + } aToken { id rewards { @@ -159,9 +167,12 @@ const query = gql` const apy = async () => { let data = await Promise.all( - Object.entries(API_URLS).flatMap(([chain, urls]) => - urls.map(async (url) => [chain, (await request(url, query)).reserves]) - ) + Object.entries(API_URLS).flatMap(([chain, urls]) => { + return urls.map(async (url) => [ + chain, + (await request(url, query)).reserves, + ]); + }) ); data = data.map(([chain, reserves]) => [ @@ -291,10 +302,8 @@ const apy = async () => { url: `https://app.zerolend.xyz/reserve-overview/?underlyingAsset=${ pool.aToken.underlyingAssetAddress }&marketName=${ - chain === 'ethereum' && pool.symbol.toLowerCase().includes('btc') - ? chainUrlParam[chain][1] - : chain === 'ethereum' && pool.symbol.toLowerCase().includes('rwa') - ? chainUrlParam[chain][2] + chain === 'ethereum' + ? mainnnet_pools[pool.pool.pool] : chainUrlParam[chain][0] }&utm_source=defillama&utm_medium=listing&utm_campaign=external`, borrowable: pool.borrowingEnabled,