diff --git a/src/adaptors/primex-finance/index.js b/src/adaptors/primex-finance/index.js index 5485ddf07e..2d18e41d06 100644 --- a/src/adaptors/primex-finance/index.js +++ b/src/adaptors/primex-finance/index.js @@ -15,7 +15,7 @@ const formatPool = async (bucket, config, EPMXPrice) => { sdk.api.abi.call({ abi: abi.activityRewardDistributorBuckets, target: activityRewardDistributor, - chain, + chain: chain.toLowerCase(), params: [bucketAddress, r] }) ) @@ -25,12 +25,12 @@ const formatPool = async (bucket, config, EPMXPrice) => { const symbol = asset.symbol const underlyingTokens = [asset.tokenAddress] - const priceKeys = underlyingTokens.map((t) => `${chain}:${t}`).join(',') + const priceKeys = underlyingTokens.map((t) => `${chain.toLowerCase()}:${t}`).join(',') const prices = ( await superagent.get(`https://coins.llama.fi/prices/current/${priceKeys}`) ).body.coins; - const assetPrice = prices[`${chain}:${asset.tokenAddress}`] + const assetPrice = prices[`${chain.toLowerCase()}:${asset.tokenAddress}`] const totalSupplyUsd = (supply / 10 ** assetPrice.decimals) * assetPrice.price const totalBorrowUsd = (demand / 10 ** assetPrice.decimals) * assetPrice.price const tvlUsd = totalSupplyUsd - totalBorrowUsd @@ -50,7 +50,7 @@ const formatPool = async (bucket, config, EPMXPrice) => { const apyRewardBorrow = isMiningPhase ? 0 : apyRewardBorrowCalculated return { - pool: bucketAddress, + pool: `${bucketAddress}-${chain}`.toLowerCase(), chain, project: 'primex-finance', symbol, @@ -74,14 +74,14 @@ const getPools = async (config) => { await sdk.api.abi.call({ abi: abi.getAllBucketsFactory, target: lensAddress, - chain, + chain: chain.toLowerCase(), params: [bucketsFactory, DEAD_ADDRESS, positionManager, false] })).output const EPMXPrice = (await sdk.api.abi.call({ abi: abi.getChainlinkLatestRoundData, target: lensAddress, - chain, + chain: chain.toLowerCase(), params: [[EPMXPriceFeed]] })).output[0].answer / 10 ** EPMXPriceFeedDecimals diff --git a/src/adaptors/primex-finance/utils.js b/src/adaptors/primex-finance/utils.js index a1be7f16f8..fe8b1efb09 100644 --- a/src/adaptors/primex-finance/utils.js +++ b/src/adaptors/primex-finance/utils.js @@ -7,7 +7,7 @@ const ROLES = { } const CHAIN_IDS = { - polygon: 137, + Polygon: 137, }; const APYREWARD_BY_SYMBOL = { @@ -22,7 +22,7 @@ const APY_BASE_MINING = 7; const config = [ { - chain: 'polygon', + chain: 'Polygon', lensAddress: '0xA37a23C5Eb527985caae2a710a0F0De7C49ACb9d', bucketsFactory: '0x7E6915D307F434E4171cCee90e180f5021c60089', positionManager: '0x02bcaA4633E466d151b34112608f60A82a4F6035',