From 122d540f18ad6d4e3f237f8252e43d5af5f45043 Mon Sep 17 00:00:00 2001 From: schnarkus Date: Thu, 20 Jul 2023 22:05:50 +0200 Subject: [PATCH 01/51] add beets-a-layered-quartet --- .../address-book/fantom/tokens/tokens.ts | 13 +++++++ src/data/archive/oldLpPools.json | 36 +++++++++++++++++++ src/data/fantom/beethovenxDualPools.json | 34 ++++++++++++++++++ src/data/fantom/spookyV3LpPools.json | 23 ------------ 4 files changed, 83 insertions(+), 23 deletions(-) diff --git a/packages/address-book/address-book/fantom/tokens/tokens.ts b/packages/address-book/address-book/fantom/tokens/tokens.ts index 27d0e7788..7fdfc016d 100644 --- a/packages/address-book/address-book/fantom/tokens/tokens.ts +++ b/packages/address-book/address-book/fantom/tokens/tokens.ts @@ -1886,6 +1886,19 @@ const _tokens = { 'Wrapped Ethereum (wETH) is a tokenized version of Ether that is compatible with the ERC-20 standard, which allows it to be used in decentralized applications and traded on decentralized exchanges, providing greater liquidity and interoperability for the Ethereum ecosystem.', documentation: 'https://layerzero.gitbook.io/docs/', }, + lzWBTC: { + name: 'Wrapped BTC', + symbol: 'lzWBTC', + address: '0xf1648C50d2863f780c57849D812b4B7686031A3D', + chainId: 250, + decimals: 8, + logoURI: '', + website: 'https://wbtc.network/', + bridge: 'layer-zero', + description: + 'Wrapped Bitcoin (WBTC) is an ERC20 token backed 1:1 with Bitcoin, which brings greater liquidity to the Ethereum ecosystem including decentralized exchanges and financial applications. It allows Bitcoin holders to use their Bitcoin on the Ethereum network and participate in the DeFi ecosystem.', + documentation: 'https://layerzero.gitbook.io/docs/', + }, } as const; export const tokens: ConstRecord = _tokens; diff --git a/src/data/archive/oldLpPools.json b/src/data/archive/oldLpPools.json index bf7798511..8cda1000d 100644 --- a/src/data/archive/oldLpPools.json +++ b/src/data/archive/oldLpPools.json @@ -1,4 +1,40 @@ [ + { + "name": "fvm-lzweth-lzwbtc", + "address": "0x04636D31Be7a53BB91E48166B2458C6c35cC7BF2", + "decimals": "1e18", + "chainId": 250, + "lp0": { + "address": "0x695921034f0387eAc4e11620EE91b1b15A6A09fE", + "oracle": "tokens", + "oracleId": "lzWETH", + "decimals": "1e18" + }, + "lp1": { + "address": "0xf1648C50d2863f780c57849D812b4B7686031A3D", + "oracle": "tokens", + "oracleId": "lzWBTC", + "decimals": "1e8" + } + }, + { + "name": "boo-lzusdc-lzweth", + "address": "0xf2610511493473379d76Bfee07B673D0cB4Ed3E7", + "decimals": "1e18", + "chainId": 250, + "lp0": { + "address": "0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf", + "oracle": "tokens", + "oracleId": "lzUSDC", + "decimals": "1e6" + }, + "lp1": { + "address": "0x695921034f0387eAc4e11620EE91b1b15A6A09fE", + "oracle": "tokens", + "oracleId": "lzWETH", + "decimals": "1e18" + } + }, { "name": "arbidex-sfrxeth-eth", "address": "0x00cABe722790e27Ca6154E8FC34281384aa7052C", diff --git a/src/data/fantom/beethovenxDualPools.json b/src/data/fantom/beethovenxDualPools.json index 9d0745a74..8b5dece4b 100644 --- a/src/data/fantom/beethovenxDualPools.json +++ b/src/data/fantom/beethovenxDualPools.json @@ -1,4 +1,38 @@ [ + { + "name": "beets-a-layered-quartet", + "address": "0xCE752063c544F604Ddb99a4335EB79B38c439D72", + "vault": "0x20dd72Ed959b6147912C2e529F0a0C651c33c9ce", + "vaultPoolId": "0xce752063c544f604ddb99a4335eb79b38c439d7200010000000000000000075c", + "beefyFee": 0.095, + "poolId": 126, + "oracleB": "tokens", + "oracleIdB": "lzUSDC", + "decimalsB": "1e6", + "decimals": "1e18", + "tokens": [ + { + "oracle": "tokens", + "oracleId": "WFTM", + "decimals": "1e18" + }, + { + "oracle": "tokens", + "oracleId": "lzUSDC", + "decimals": "1e6" + }, + { + "oracle": "tokens", + "oracleId": "lzWETH", + "decimals": "1e18" + }, + { + "oracle": "tokens", + "oracleId": "lzWBTC", + "decimals": "1e8" + } + ] + }, { "name": "beets-ankr-fantom-liquid-mosaic", "address": "0x723d43bd1A1ff40DeaaB77a164B5c3eA4F654DB2", diff --git a/src/data/fantom/spookyV3LpPools.json b/src/data/fantom/spookyV3LpPools.json index e06beab17..c81e7c6ae 100644 --- a/src/data/fantom/spookyV3LpPools.json +++ b/src/data/fantom/spookyV3LpPools.json @@ -22,29 +22,6 @@ "decimals": "1e6" } }, - { - "name": "boo-lzusdc-lzweth", - "address": "0xf2610511493473379d76Bfee07B673D0cB4Ed3E7", - "decimals": "1e18", - "poolId": 13, - "chainId": 250, - "beefyFee": 0.095, - "oracleB": "tokens", - "oracleIdB": "lzUSDC", - "decimalsB": "1e6", - "lp0": { - "address": "0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf", - "oracle": "tokens", - "oracleId": "lzUSDC", - "decimals": "1e6" - }, - "lp1": { - "address": "0x695921034f0387eAc4e11620EE91b1b15A6A09fE", - "oracle": "tokens", - "oracleId": "lzWETH", - "decimals": "1e18" - } - }, { "name": "boo-wftm-lzusdc", "address": "0x90469ACbC4b6d877873CD4f1CCA54fDE8075A998", From fbf11af0ec3a9856c3c2df6b834f7e2a599d336a Mon Sep 17 00:00:00 2001 From: shatterproof <4100078+shatterproof@users.noreply.github.com> Date: Thu, 20 Jul 2023 21:30:31 -0700 Subject: [PATCH 02/51] Remove VelocimeterV1 LPs --- .../canto/platforms/velocimeter.ts | 2 - .../address-book/canto/tokens/tokens.ts | 12 -- src/api/stats/canto/getVelocimeterApys.js | 44 +------ .../stats/canto/getVelocimeterStablePrices.js | 5 +- src/api/stats/getAmmPrices.ts | 2 - src/data/canto/velocimeterLpPools.json | 122 ------------------ src/data/canto/velocimeterStableLpPools.json | 22 ---- 7 files changed, 7 insertions(+), 202 deletions(-) delete mode 100644 src/data/canto/velocimeterLpPools.json delete mode 100644 src/data/canto/velocimeterStableLpPools.json diff --git a/packages/address-book/address-book/canto/platforms/velocimeter.ts b/packages/address-book/address-book/canto/platforms/velocimeter.ts index 04070e482..a98956c1c 100644 --- a/packages/address-book/address-book/canto/platforms/velocimeter.ts +++ b/packages/address-book/address-book/canto/platforms/velocimeter.ts @@ -1,7 +1,5 @@ export const velocimeter = { - routerv1: '0x9B2920e72dF6E1A7053bEa7235c65079F5104398', router: '0x8e2e2f70B4bD86F82539187A634FB832398cc771', - voterv1: '0xC5B58aE761a77fF16d548dE9b42933c8FBfe4c33', voter: '0x8e3525Dbc8356c08d2d55F3ACb6416b5979D3389', bifiCantoLp: '0x2dBFeB48dEaccBFf9b0a54dEd1BC172e135a809C', } as const; diff --git a/packages/address-book/address-book/canto/tokens/tokens.ts b/packages/address-book/address-book/canto/tokens/tokens.ts index 2b9a50795..1d28e8b99 100644 --- a/packages/address-book/address-book/canto/tokens/tokens.ts +++ b/packages/address-book/address-book/canto/tokens/tokens.ts @@ -88,18 +88,6 @@ const _tokens = { 'Tether is a stablecoin pegged to the US Dollar. A stablecoin is a type of cryptocurrency whose value is pegged to another fiat currency like the US Dollar or to a commodity like Gold. Tether is the first stablecoin to be created and it is the most popular stablecoin used in the ecosystem.', logoURI: '', }, - FLOWV1: { - name: 'Velocimeter', - symbol: 'FLOWv1', - address: '0x2Baec546a92cA3469f71b7A091f7dF61e5569889', - chainId: 7700, - decimals: 18, - logoURI: '', - website: 'https://canto.velocimeter.xyz/home', - description: - 'Velocimeter addresses these issues and presents an attractive alternative by addressing the core issues in Solidly and adding its own improvements. To recall, the key innovation of Solidly was to align protocol emissions with fees generated, not simply liquidity. To do this, it would allow protocols and other large stakeholders to become veNFT "voters", using their locked voting power to direct future emissions and collecting fees (termed bribes in Solidly) from the pools they voted for.', - documentation: 'https://docs.velocimeter.xyz/', - }, GRAV: { name: 'Graviton', symbol: 'GRAV', diff --git a/src/api/stats/canto/getVelocimeterApys.js b/src/api/stats/canto/getVelocimeterApys.js index 53b1bbd81..856e1e4b9 100644 --- a/src/api/stats/canto/getVelocimeterApys.js +++ b/src/api/stats/canto/getVelocimeterApys.js @@ -1,60 +1,26 @@ const { CANTO_CHAIN_ID: chainId } = require('../../../constants'); -import { getEDecimals } from '../../../utils/getEDecimals'; const { getSolidlyGaugeApys } = require('../common/getSolidlyGaugeApys'); -const stablePools = require('../../../data/canto/velocimeterStableLpPools.json'); -const volatilePools = require('../../../data/canto/velocimeterLpPools.json'); + const stableV2Pools = require('../../../data/canto/velocimeterV2StableLpPools.json'); const volatileV2Pools = require('../../../data/canto/velocimeterV2LpPools.json'); - import { addressBook } from '../../../../packages/address-book/address-book'; const { canto: { - tokens: { FLOWV1, FLOW }, + tokens: { FLOW }, }, } = addressBook; -const pools = [...stablePools, ...volatilePools]; const poolsV2 = [...stableV2Pools, ...volatileV2Pools]; -const getVelocimeterApys = async () => { - const gaugeApys = getSolidlyGaugeApys({ - chainId: chainId, - pools: pools, - oracleId: 'FLOWV1', - oracle: 'tokens', - decimals: getEDecimals(FLOWV1.decimals), - reward: FLOWV1.address, - boosted: false, - // log: true, - }); - - const gaugeV2Apys = getSolidlyGaugeApys({ +const getVelocimeterApys = async () => + getSolidlyGaugeApys({ chainId: chainId, pools: poolsV2, oracleId: 'FLOW', oracle: 'tokens', - decimals: getEDecimals(FLOW.decimals), + decimals: '1e18', reward: FLOW.address, boosted: false, // log: true, }); - let apys = {}; - let apyBreakdowns = {}; - - const results = await Promise.allSettled([gaugeApys, gaugeV2Apys]); - for (const result of results) { - if (result.status !== 'fulfilled') { - console.warn('getVelocimeterApys error', result.reason); - } else { - apys = { ...apys, ...result.value.apys }; - apyBreakdowns = { ...apyBreakdowns, ...result.value.apyBreakdowns }; - } - } - - return { - apys, - apyBreakdowns, - }; -}; - module.exports = getVelocimeterApys; diff --git a/src/api/stats/canto/getVelocimeterStablePrices.js b/src/api/stats/canto/getVelocimeterStablePrices.js index df79f439b..f8e00aa11 100644 --- a/src/api/stats/canto/getVelocimeterStablePrices.js +++ b/src/api/stats/canto/getVelocimeterStablePrices.js @@ -1,10 +1,9 @@ const getSolidlyStablePrices = require('../common/getSolidlyStablePrices'); -const v1pools = require('../../../data/canto/velocimeterStableLpPools.json'); const v2pools = require('../../../data/canto/velocimeterV2StableLpPools.json'); const { CANTO_CHAIN_ID } = require('../../../constants'); -const pools = [...v1pools, ...v2pools]; + const getVelocimeterStablePrices = async tokenPrices => { - return await getSolidlyStablePrices(CANTO_CHAIN_ID, pools, tokenPrices); + return await getSolidlyStablePrices(CANTO_CHAIN_ID, v2pools, tokenPrices); }; module.exports = getVelocimeterStablePrices; diff --git a/src/api/stats/getAmmPrices.ts b/src/api/stats/getAmmPrices.ts index 334871bd0..ca07b0369 100644 --- a/src/api/stats/getAmmPrices.ts +++ b/src/api/stats/getAmmPrices.ts @@ -261,7 +261,6 @@ import synapseLpPools from '../../data/ethereum/synapseLpPools.json'; import solidlyLpPools from '../../data/ethereum/solidlyLpPools.json'; import cantoLpPools from '../../data/canto/cantoLpPools.json'; import solidLizardPools from '../../data/arbitrum/solidlizardLpPools.json'; -import velocimeterPools from '../../data/canto/velocimeterLpPools.json'; import velocimeterV2Pools from '../../data/canto/velocimeterV2LpPools.json'; import equilibrePools from '../../data/kava/equilibreLpPools.json'; import versePools from '../../data/ethereum/verseLpPools.json'; @@ -296,7 +295,6 @@ const pools = normalizePoolOracleIds([ ...versePools, ...equilibrePools, ...velocimeterV2Pools, - ...velocimeterPools, ...solidLizardPools, ...cantoLpPools, ...solidlyLpPools, diff --git a/src/data/canto/velocimeterLpPools.json b/src/data/canto/velocimeterLpPools.json deleted file mode 100644 index 3ef860f58..000000000 --- a/src/data/canto/velocimeterLpPools.json +++ /dev/null @@ -1,122 +0,0 @@ -[ - { - "name": "velocimeter-flow-wcanto", - "address": "0x862050752bE9F4ae310FC8A58C9208eE3fa22148", - "gauge": "0xFD2F8bD82b0ecAcbe42BD9097c36EA667B66A023", - "decimals": "1e18", - "chainId": 7700, - "beefyFee": 0.095, - "lp0": { - "address": "0x2Baec546a92cA3469f71b7A091f7dF61e5569889", - "oracle": "tokens", - "oracleId": "FLOWV1", - "decimals": "1e18" - }, - "lp1": { - "address": "0x826551890Dc65655a0Aceca109aB11AbDbD7a07B", - "oracle": "tokens", - "oracleId": "WCANTO", - "decimals": "1e18" - } - }, - { - "name": "velocimeter-note-grav", - "address": "0x9AFE631835cdBced9D6159c7Ba9083000F3042b3", - "gauge": "0xEE364d444350683589481D9cef5c4048f591FbB0", - "decimals": "1e18", - "chainId": 7700, - "beefyFee": 0.095, - "lp0": { - "address": "0x4e71A2E537B7f9D9413D3991D37958c0b5e1e503", - "oracle": "tokens", - "oracleId": "NOTE", - "decimals": "1e18" - }, - "lp1": { - "address": "0xc03345448969Dd8C00e9E4A85d2d9722d093aF8E", - "oracle": "tokens", - "oracleId": "GRAV", - "decimals": "1e6" - } - }, - { - "name": "velocimeter-flow-note", - "address": "0xa694B9527Bc94D99F8C382D942C1D992166c4434", - "gauge": "0x31FAA19b132Ef9c5978fdA13AC5c6bFd8C2Fc279", - "decimals": "1e18", - "chainId": 7700, - "beefyFee": 0.095, - "lp0": { - "address": "0x2Baec546a92cA3469f71b7A091f7dF61e5569889", - "oracle": "tokens", - "oracleId": "FLOWV1", - "decimals": "1e18" - }, - "lp1": { - "address": "0x4e71A2E537B7f9D9413D3991D37958c0b5e1e503", - "oracle": "tokens", - "oracleId": "NOTE", - "decimals": "1e18" - } - }, - { - "name": "velocimeter-wcanto-atom", - "address": "0xa87B17Fc81bECf329860097b20073AAD86BAca9d", - "gauge": "0xBa6118e533Eb9012c8125c604D19485639e14096", - "decimals": "1e18", - "chainId": 7700, - "beefyFee": 0.095, - "lp0": { - "address": "0x826551890Dc65655a0Aceca109aB11AbDbD7a07B", - "oracle": "tokens", - "oracleId": "WCANTO", - "decimals": "1e18" - }, - "lp1": { - "address": "0xecEEEfCEE421D8062EF8d6b4D814efe4dc898265", - "oracle": "tokens", - "oracleId": "ATOM", - "decimals": "1e6" - } - }, - { - "name": "velocimeter-usdc-wcanto", - "address": "0xA4Ed386124c023aCA6AA89b184F90e1375eE677c", - "gauge": "0x82FfFFDb581eb28448ba1aB0A3c8BA553981e3ad", - "decimals": "1e18", - "chainId": 7700, - "beefyFee": 0.095, - "lp0": { - "address": "0x80b5a32E4F032B2a058b4F29EC95EEfEEB87aDcd", - "oracle": "tokens", - "oracleId": "USDC", - "decimals": "1e6" - }, - "lp1": { - "address": "0x826551890Dc65655a0Aceca109aB11AbDbD7a07B", - "oracle": "tokens", - "oracleId": "WCANTO", - "decimals": "1e18" - } - }, - { - "name": "velocimeter-note-wcanto", - "address": "0xE5A5A9699D75536ceC2Fc0c682C16A56dF811eD9", - "gauge": "0x8C58052EB6263dB1623390202AdB3390f40E2258", - "decimals": "1e18", - "chainId": 7700, - "beefyFee": 0.095, - "lp0": { - "address": "0x4e71A2E537B7f9D9413D3991D37958c0b5e1e503", - "oracle": "tokens", - "oracleId": "NOTE", - "decimals": "1e18" - }, - "lp1": { - "address": "0x826551890Dc65655a0Aceca109aB11AbDbD7a07B", - "oracle": "tokens", - "oracleId": "WCANTO", - "decimals": "1e18" - } - } -] diff --git a/src/data/canto/velocimeterStableLpPools.json b/src/data/canto/velocimeterStableLpPools.json deleted file mode 100644 index 51233da4b..000000000 --- a/src/data/canto/velocimeterStableLpPools.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "name": "velocimeter-note-usdc", - "address": "0x94C1dFfefa4eaC0801e3af0EE7108d8a08CF5f9e", - "gauge": "0x7a475831e2F4911287dDF3BACe5146388974aba5", - "decimals": "1e18", - "chainId": 7700, - "beefyFee": 0.095, - "lp0": { - "address": "0x4e71A2E537B7f9D9413D3991D37958c0b5e1e503", - "oracle": "tokens", - "oracleId": "NOTE", - "decimals": "1e18" - }, - "lp1": { - "address": "0x80b5a32E4F032B2a058b4F29EC95EEfEEB87aDcd", - "oracle": "tokens", - "oracleId": "USDC", - "decimals": "1e6" - } - } -] From 0b3fdb1d857ec3981d42ce7748bf783bf6f26885 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Fri, 21 Jul 2023 08:10:35 +0000 Subject: [PATCH 03/51] ci: version bump to 0.43.37 --- packages/address-book/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/address-book/package.json b/packages/address-book/package.json index 0cbd059b1..35d331fb0 100644 --- a/packages/address-book/package.json +++ b/packages/address-book/package.json @@ -1,6 +1,6 @@ { "name": "blockchain-addressbook", - "version": "0.43.36", + "version": "0.43.37", "description": "A collection of useful addresses on various chains for defi development", "main": "build/address-book/index.js", "types": "build/address-book/index.d.ts", From a5b02d63a9f0b94f95fe2a7a919a29f585ff5f08 Mon Sep 17 00:00:00 2001 From: RM Date: Fri, 21 Jul 2023 15:41:23 +0700 Subject: [PATCH 04/51] .nvmrc --- .nvmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..b55acecd6 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v20.5.0 \ No newline at end of file From 65bf51a9159c1c9923584bdbb3d9cc27cd34aa64 Mon Sep 17 00:00:00 2001 From: RM Date: Fri, 21 Jul 2023 15:42:07 +0700 Subject: [PATCH 05/51] Fix fmcfUSDT price, fetchyVaultPrices --- src/data/fantom/equalizerV2StableLpPools.json | 2 +- src/utils/fetchyVaultPrices.ts | 2 +- src/utils/getTradingFeeApr.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/data/fantom/equalizerV2StableLpPools.json b/src/data/fantom/equalizerV2StableLpPools.json index ce0115def..5855d2a0f 100644 --- a/src/data/fantom/equalizerV2StableLpPools.json +++ b/src/data/fantom/equalizerV2StableLpPools.json @@ -135,7 +135,7 @@ "lp1": { "address": "0x049d68029688eAbF473097a2fC38ef61633A3C7A", "oracle": "tokens", - "oracleId": "fmcfUSDT", + "oracleId": "fUSDT", "decimals": "1e6" } }, diff --git a/src/utils/fetchyVaultPrices.ts b/src/utils/fetchyVaultPrices.ts index b42bfd5dc..280ef7f88 100644 --- a/src/utils/fetchyVaultPrices.ts +++ b/src/utils/fetchyVaultPrices.ts @@ -18,7 +18,7 @@ const tokens = { const getyVaultPrices = async (tokenPrices, tokens: Token[][], chainId) => { const pricePerShareCalls = tokens.map(token => { const contract = fetchContract(token[1].address, YearnTokenVaultAbi, chainId); - return contract.read.pricePerShare; + return contract.read.pricePerShare(); }); try { diff --git a/src/utils/getTradingFeeApr.ts b/src/utils/getTradingFeeApr.ts index 5ddecaf40..accb3b99c 100644 --- a/src/utils/getTradingFeeApr.ts +++ b/src/utils/getTradingFeeApr.ts @@ -53,7 +53,7 @@ export const getTradingFeeApr = async ( .dividedBy(pairDayData.reserveUSD); } } catch (e) { - console.error('> getTradingFeeApr error', pairAddresses[0]); + // console.error('> getTradingFeeApr error', pairAddresses[0]); } return pairAddressToAprMap; @@ -182,7 +182,7 @@ export const getTradingFeeAprBalancer = async ( .dividedBy(pool.totalLiquidity); } } catch (e) { - console.error('> getTradingFeeAprBalancer error', pairAddresses[0]); + // console.error('> getTradingFeeAprBalancer error', pairAddresses[0]); } return pairAddressesToAprMap; @@ -221,7 +221,7 @@ export const getTradingFeeAprBalancerFTM = async ( .dividedBy(pool.totalLiquidity); } } catch (e) { - console.error('> getTradingFeeAprBalancerFTM error', pairAddresses[0]); + // console.error('> getTradingFeeAprBalancerFTM error', pairAddresses[0]); } return pairAddressesToAprMap; From 3326ee322bfbc816bd3be66d170f8f7a085528ea Mon Sep 17 00:00:00 2001 From: RM Date: Fri, 21 Jul 2023 15:43:02 +0700 Subject: [PATCH 06/51] Configurable init delay in all services --- src/api/boosts/getBoosts.ts | 2 +- src/api/snapshot/getProposals.ts | 3 ++- src/api/stats/bifibuyback/getBifiBuyback.ts | 2 +- src/api/stats/getMooTokenPrices.ts | 2 +- src/api/stats/getMultichainVaults.js | 2 +- src/api/stats/getTvl.js | 2 +- src/api/vaults/getVaultFees.ts | 2 +- src/api/zaps/zaps.ts | 3 ++- 8 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/api/boosts/getBoosts.ts b/src/api/boosts/getBoosts.ts index eef124ff1..3a9e2cd32 100644 --- a/src/api/boosts/getBoosts.ts +++ b/src/api/boosts/getBoosts.ts @@ -8,7 +8,7 @@ import { ApiChain, toAppChain } from '../../utils/chain'; const REDIS_KEY = 'BOOSTS_BY_CHAIN'; -const INIT_DELAY = 4 * 1000; +const INIT_DELAY = Number(process.env.BOOSTS_INIT_DELAY || 4 * 1000); const REFRESH_INTERVAL = 5 * 60 * 1000; let boostsByChain: Record = {}; diff --git a/src/api/snapshot/getProposals.ts b/src/api/snapshot/getProposals.ts index 9e2d5b137..683522d69 100644 --- a/src/api/snapshot/getProposals.ts +++ b/src/api/snapshot/getProposals.ts @@ -14,6 +14,7 @@ const ALLOW_FROM_LIST: boolean = true; const ALLOW_FROM_ANYONE: boolean = true; const ALLOW_LIST: string[] = ['0x280A53cBf252F1B5F6Bde7471299c94Ec566a7C8']; +const INIT_DELAY = Number(process.env.PROPOSALS_INIT_DELAY || 0); let cachedSpace: CachedSpace | null = null; let cachedProposals: CachedProposals | null = null; @@ -119,7 +120,7 @@ async function updateIfNeeded() { export async function initProposalsService() { [cachedSpace, cachedProposals] = await Promise.all([getCachedSpace(), getCachedProposals()]); - await updateIfNeeded(); + setTimeout(updateIfNeeded, INIT_DELAY); setInterval(() => { updateIfNeeded().catch(err => console.error(err)); diff --git a/src/api/stats/bifibuyback/getBifiBuyback.ts b/src/api/stats/bifibuyback/getBifiBuyback.ts index 2ee609127..dcc9f9a50 100644 --- a/src/api/stats/bifibuyback/getBifiBuyback.ts +++ b/src/api/stats/bifibuyback/getBifiBuyback.ts @@ -11,7 +11,7 @@ import { explorerApiUrlMap } from './explorerApiUrlMap'; import { bifiLpMap } from './bifiLpMap'; import { getKey, setKey } from '../../../utils/cache'; -const INIT_DELAY = 40 * 1000; +const INIT_DELAY = Number(process.env.BUYBACK_INIT_DELAY || 40 * 1000); const REFRESH_INTERVAL = 15 * 60 * 1000; export interface DailyBifiBuybackStats { diff --git a/src/api/stats/getMooTokenPrices.ts b/src/api/stats/getMooTokenPrices.ts index dc290dce7..588303a71 100644 --- a/src/api/stats/getMooTokenPrices.ts +++ b/src/api/stats/getMooTokenPrices.ts @@ -5,7 +5,7 @@ const { getMultichainVaults } = require('../stats/getMultichainVaults'); let mooTokenPrices = {}; -const INIT_DELAY = 60 * 1000; +const INIT_DELAY = Number(process.env.MOOTOKEN_INIT_DELAY || 60 * 1000); const REFRESH_INTERVAL = 60 * 1000; export const getMooTokenPrices = () => { diff --git a/src/api/stats/getMultichainVaults.js b/src/api/stats/getMultichainVaults.js index 1de604888..f538a8c7f 100644 --- a/src/api/stats/getMultichainVaults.js +++ b/src/api/stats/getMultichainVaults.js @@ -10,7 +10,7 @@ const { fetchChainVaultsPpfs } = require('../../utils/fetchMooPrices'); const { MULTICHAIN_ENDPOINTS } = require('../../constants'); const { getKey, setKey } = require('../../utils/cache'); -const INIT_DELAY = 2 * 1000; +const INIT_DELAY = process.env.VAULTS_INIT_DELAY || 2 * 1000; const REFRESH_INTERVAL = 5 * 60 * 1000; const LOG_PER_CHAIN = false; diff --git a/src/api/stats/getTvl.js b/src/api/stats/getTvl.js index 8b9a29ed0..7c9bb566a 100644 --- a/src/api/stats/getTvl.js +++ b/src/api/stats/getTvl.js @@ -66,7 +66,7 @@ const { } = require('../../constants'); const { getKey, setKey } = require('../../utils/cache'); -const INIT_DELAY = 40 * 1000; +const INIT_DELAY = Number(process.env.TVL_INIT_DELAY || 40 * 1000); const REFRESH_INTERVAL = 15 * 60 * 1000; let tvl = {}; diff --git a/src/api/vaults/getVaultFees.ts b/src/api/vaults/getVaultFees.ts index 8c790ca2e..4082d0e4e 100644 --- a/src/api/vaults/getVaultFees.ts +++ b/src/api/vaults/getVaultFees.ts @@ -20,7 +20,7 @@ const feeBatchTreasurySplitMethodABI = [ }, ] as const; -const INIT_DELAY = 15000; +const INIT_DELAY = Number(process.env.FEES_INIT_DELAY || 15000); const REFRESH_INTERVAL = 5 * 60 * 1000; const CACHE_EXPIRY = 1000 * 60 * 60 * 12; const MULTICALL_BATCH_SIZES: Partial> = { diff --git a/src/api/zaps/zaps.ts b/src/api/zaps/zaps.ts index f35c1d6d0..4c84d92d2 100644 --- a/src/api/zaps/zaps.ts +++ b/src/api/zaps/zaps.ts @@ -29,6 +29,7 @@ const GH_REPO = 'beefy-v2'; const GH_BRANCH = 'prod'; const DEBUG = false; const REDIS_KEY = 'ZAP_SUPPORT'; +const INIT_DELAY = Number(process.env.ZAP_INIT_DELAY || 0); const ammConfigChains: ReadonlyArray = Object.keys( MULTICHAIN_ENDPOINTS @@ -90,7 +91,7 @@ export async function initZapService() { await Promise.all([initZapConfigs(), initAmmConfigs()]); // Update - await performUpdate(); + setTimeout(performUpdate, INIT_DELAY); } async function waitForConfigs() { From 8f983ad289c0e92a3ad7f32516df40afe4a53872 Mon Sep 17 00:00:00 2001 From: schnarkus Date: Fri, 21 Jul 2023 16:48:19 +0200 Subject: [PATCH 07/51] add native atom pool --- .../address-book/kava/tokens/tokens.ts | 12 +++++++++++ src/data/kava/equilibreLpPools.json | 20 +++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/packages/address-book/address-book/kava/tokens/tokens.ts b/packages/address-book/address-book/kava/tokens/tokens.ts index ae2087cb2..3d9a1bc51 100644 --- a/packages/address-book/address-book/kava/tokens/tokens.ts +++ b/packages/address-book/address-book/kava/tokens/tokens.ts @@ -263,6 +263,18 @@ const _tokens = { "Axelar Wrapped WBTC (axlWBTC) is an ERC-20 token that represents a 1:1 pegged version of Bitcoin, allowing users to access Bitcoin's value and liquidity within the Kava ecosystem.", documentation: 'https://docs.axelar.dev/resources/wrapped-tokens', }, + ATOM: { + name: 'ATOM', + symbol: 'ATOM', + address: '0x15932E26f5BD4923d46a2b205191C4b5d5f43FE3', + chainId: 2222, + decimals: 6, + logoURI: '', + website: 'https://cosmos.network/', + description: + 'The Internet of Blockchains. Cosmos is an ever-expanding ecosystem of interconnected apps and services, built for a decentralized future.', + documentation: 'https://docs.cosmos.network/main', + }, } as const; export const tokens: ConstRecord = _tokens; diff --git a/src/data/kava/equilibreLpPools.json b/src/data/kava/equilibreLpPools.json index 8e0c1fa6a..d2db96708 100644 --- a/src/data/kava/equilibreLpPools.json +++ b/src/data/kava/equilibreLpPools.json @@ -1,4 +1,24 @@ [ + { + "name": "equilibre-atom-usdt", + "address": "0xD39c219B018207F44799D93433c9bA23A01EFBA2", + "gauge": "0xd15B22628ad39b4D5a0A574AABA9E910a1A2cDc6", + "decimals": "1e18", + "chainId": 2222, + "beefyFee": 0.095, + "lp0": { + "address": "0x15932E26f5BD4923d46a2b205191C4b5d5f43FE3", + "oracle": "tokens", + "oracleId": "ATOM", + "decimals": "1e6" + }, + "lp1": { + "address": "0x919C1c267BC06a7039e03fcc2eF738525769109c", + "oracle": "tokens", + "oracleId": "USDT", + "decimals": "1e6" + } + }, { "name": "equilibre-usdt-wkava", "address": "0xBe87F2e81aa16238445651fAbf62Ae097498C200", From 641b289a13b93f0a70b1097c73e7726f965b30c0 Mon Sep 17 00:00:00 2001 From: schnarkus Date: Fri, 21 Jul 2023 16:58:02 +0200 Subject: [PATCH 08/51] add equilibre-usdt-axlusdc --- src/data/kava/equilibreStableLpPools.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/data/kava/equilibreStableLpPools.json b/src/data/kava/equilibreStableLpPools.json index e7a506e4a..45833747e 100644 --- a/src/data/kava/equilibreStableLpPools.json +++ b/src/data/kava/equilibreStableLpPools.json @@ -1,4 +1,24 @@ [ + { + "name": "equilibre-usdt-axlusdc", + "address": "0x4A18F16b6A4F695639B0d1390263Def2e91fc60f", + "gauge": "0x776d2Ae19FC4c5982D5b20d8c14BCDae09755796", + "decimals": "1e18", + "chainId": 2222, + "beefyFee": 0.095, + "lp0": { + "address": "0x919C1c267BC06a7039e03fcc2eF738525769109c", + "oracle": "tokens", + "oracleId": "USDT", + "decimals": "1e6" + }, + "lp1": { + "address": "0xEB466342C4d449BC9f53A865D5Cb90586f405215", + "oracle": "tokens", + "oracleId": "axlUSDC", + "decimals": "1e6" + } + }, { "name": "equilibre-usdt-mai", "address": "0x1A2c489d90212eE7AD351c826a3A4d53186b4b8b", From 1f900a77038fb92d71647012c67664754e97fd10 Mon Sep 17 00:00:00 2001 From: MirthFutures Date: Mon, 24 Jul 2023 09:29:15 -0400 Subject: [PATCH 09/51] Add USDC Rewards to zkEVM wstETH-ETH --- src/data/zkevm/balancerPools.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/data/zkevm/balancerPools.json b/src/data/zkevm/balancerPools.json index d6fe3f3fb..a233ece90 100644 --- a/src/data/zkevm/balancerPools.json +++ b/src/data/zkevm/balancerPools.json @@ -110,6 +110,12 @@ "rewardToken": "0xa2036f0538221a77A3937F1379699f44945018d0", "oracleId": "MATIC", "decimals": "1e18" + }, + { + "stream": "0x544BDCE27174EA8Ba829939bd3568efc6A6c9c53", + "rewardToken": "0xA8CE8aee21bC2A48a5EF670afCc9274C7bbbC035", + "oracleId": "USDC", + "decimals": "1e6" } ], "tokens": [ From 50c5cda68a2d6b88bec1c595f4e9b40e98eb3ba7 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Tue, 25 Jul 2023 06:20:31 +0000 Subject: [PATCH 10/51] ci: version bump to 0.43.38 --- packages/address-book/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/address-book/package.json b/packages/address-book/package.json index 35d331fb0..c66b6e970 100644 --- a/packages/address-book/package.json +++ b/packages/address-book/package.json @@ -1,6 +1,6 @@ { "name": "blockchain-addressbook", - "version": "0.43.37", + "version": "0.43.38", "description": "A collection of useful addresses on various chains for defi development", "main": "build/address-book/index.js", "types": "build/address-book/index.d.ts", From c67a0393d598c95dcc196605f83e8c373019894b Mon Sep 17 00:00:00 2001 From: MirthFutures Date: Tue, 25 Jul 2023 09:15:30 -0400 Subject: [PATCH 11/51] Add Aura Beets ECLP wstETH-ETH --- src/api/stats/optimism/getAuraOptimismApys.js | 29 +++++++++++++++++++ src/api/stats/optimism/getBeetsOPPrices.ts | 3 +- src/api/stats/optimism/index.js | 2 ++ src/data/optimism/auraLpPools.json | 25 ++++++++++++++++ yarn.lock | 12 ++++---- 5 files changed, 64 insertions(+), 7 deletions(-) create mode 100644 src/api/stats/optimism/getAuraOptimismApys.js create mode 100644 src/data/optimism/auraLpPools.json diff --git a/src/api/stats/optimism/getAuraOptimismApys.js b/src/api/stats/optimism/getAuraOptimismApys.js new file mode 100644 index 000000000..0dea40210 --- /dev/null +++ b/src/api/stats/optimism/getAuraOptimismApys.js @@ -0,0 +1,29 @@ +import { OPTIMISM_CHAIN_ID as chainId } from '../../../constants'; +import { balancerOpClient as client } from '../../../apollo/client'; +import { getAuraApys } from '../common/balancer/getAuraApys'; +import { addressBook } from '../../../../packages/address-book/address-book'; + +const { + optimism: { + platforms: { beethovenX }, + }, +} = addressBook; + +const pools = require('../../../data/optimism/auraLpPools.json'); + +const aaveDataProvider = '0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654'; +const auraMinter = '0xeC1c780A275438916E7CEb174D80878f29580606'; + +const getAuraOptimismApys = async () => { + return getAuraApys({ + chainId: chainId, + client: client, + pools: pools, + balancerVault: beethovenX.router, + aaveDataProvider: aaveDataProvider, + auraMinter: auraMinter, + // log: true, + }); +}; + +module.exports = getAuraOptimismApys; diff --git a/src/api/stats/optimism/getBeetsOPPrices.ts b/src/api/stats/optimism/getBeetsOPPrices.ts index 645cd4add..4292029f9 100644 --- a/src/api/stats/optimism/getBeetsOPPrices.ts +++ b/src/api/stats/optimism/getBeetsOPPrices.ts @@ -2,8 +2,9 @@ import getBalancerPrices from '../common/balancer/getBalancerPrices'; import { OPTIMISM_CHAIN_ID as chainId } from '../../../constants'; import beetsPools from '../../../data/optimism/beethovenxLpPools.json'; import balancerPools from '../../../data/optimism/balancerOpLpPools.json'; +import auraPools from '../../../data/optimism/auraLpPools.json'; -const pools = [...beetsPools, ...balancerPools]; +const pools = [...beetsPools, ...balancerPools, ...auraPools]; const getBeetsOPPrices = async tokenPrices => { return await getBalancerPrices(chainId, pools, tokenPrices); diff --git a/src/api/stats/optimism/index.js b/src/api/stats/optimism/index.js index 1647cb161..391ab81de 100644 --- a/src/api/stats/optimism/index.js +++ b/src/api/stats/optimism/index.js @@ -17,9 +17,11 @@ const getKyberOptimismApys = require('./getKyberOptimismApys'); const getMmyApys = require('./getMmyApys'); const getExactlyApys = require('./getExactlyApys'); const getBalancerOpApys = require('./getBalancerOpApys'); +const getAuraApys = require('./getAuraOptimismApys'); const getBeVeloV2Apr = require('./getBeVeloV2Apr'); const getApys = [ + getAuraApys, getBalancerOpApys, getExactlyApys, getMmyApys, diff --git a/src/data/optimism/auraLpPools.json b/src/data/optimism/auraLpPools.json new file mode 100644 index 000000000..99a24e6ec --- /dev/null +++ b/src/data/optimism/auraLpPools.json @@ -0,0 +1,25 @@ +[ + { + "name": "beets-eclp-wsteth-eth", + "address": "0x7Ca75bdEa9dEde97F8B13C6641B768650CB83782", + "vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8", + "gauge": "0x9f43f726dF654E033B04c39989af90ab44875fEB", + "lsUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "dataPath": "$.data.smaApr", + "lsIndex": 0, + "vaultPoolId": "0x7ca75bdea9dede97f8b13c6641b768650cb837820002000000000000000000d5", + "decimals": "1e18", + "tokens": [ + { + "oracle": "tokens", + "oracleId": "wstETH", + "decimals": "1e18" + }, + { + "oracle": "tokens", + "oracleId": "ETH", + "decimals": "1e18" + } + ] + } +] diff --git a/yarn.lock b/yarn.lock index 079eb4f45..53d615729 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4805,9 +4805,9 @@ node-addon-api@^2.0.0: integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== node-fetch@^2.6.1: - version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + version "2.6.12" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" + integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== dependencies: whatwg-url "^5.0.0" @@ -6203,7 +6203,7 @@ tough-cookie@~2.5.0: tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== trim-off-newlines@^1.0.1: version "1.0.3" @@ -6774,7 +6774,7 @@ web3@^1.3.0, web3@^1.5.0: webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== websocket@^1.0.32: version "1.0.34" @@ -6796,7 +6796,7 @@ well-known-symbols@^2.0.0: whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0" From 829a28e93c70f171ffc747d3806599977024e6d5 Mon Sep 17 00:00:00 2001 From: chebiN <17909998+seguido@users.noreply.github.com> Date: Tue, 25 Jul 2023 16:40:25 -0300 Subject: [PATCH 12/51] remove node-fetch dependency, moving to builtin fetch api for node20 (#1181) --- package.json | 3 +- packages/address-book/package.json | 2 - .../scripts/toChecksumTokenList.ts | 1 - packages/address-book/yarn.lock | 51 ------------------- src/api/boosts/fetchBoostData.ts | 1 - src/api/cmc/index.js | 1 - src/api/stats/arbitrum/getGnsApys.js | 3 +- src/api/stats/bifibuyback/getBifiBuyback.ts | 1 - src/api/stats/bsc/belt/getBeltApys.js | 1 - src/api/stats/bsc/getDotDotApy.js | 1 - src/api/stats/common/aave/getAaveV3Apys.js | 1 - src/api/stats/common/balancer/getAuraApys.ts | 1 - .../stats/common/balancer/getBalancerApys.ts | 1 - src/api/stats/common/curve/getCurveApyData.js | 1 - src/api/stats/common/getMiniChefApys.ts | 1 - src/api/stats/cronos/getFerroApys.js | 1 - .../deprecated/fortube/getFortubeApys.js | 1 - src/api/stats/ethereum/getAuraApys.js | 1 - src/api/stats/ethereum/getConicApys.js | 1 - src/api/stats/fantom/getBeethovenxDualApys.js | 1 - src/api/stats/getAmmPrices.ts | 5 ++ src/api/stats/matic/getGnsApys.js | 3 +- src/api/stats/optimism/getBeetsOpApys.js | 1 - src/api/stats/optimism/getExactlyApys.js | 1 - src/api/treasury/multicallUtils.ts | 3 +- src/api/treasury/types.ts | 13 ++++- src/api/zaps/CachedGitJson.ts | 1 - src/api/zaps/one-inch/OneInchSwapApi.ts | 1 - src/apollo/client.ts | 1 - src/utils/fetchCoinGeckoPrices.js | 2 - src/utils/fetchCurrencyPrices.js | 2 - src/utils/getHolders.js | 2 - src/utils/getVaults.js | 2 - tsconfig.json | 1 + yarn.lock | 33 ++---------- 35 files changed, 26 insertions(+), 120 deletions(-) diff --git a/package.json b/package.json index b6e5b309b..a47cb5047 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "@apollo/client": "^3.5.6", "@koa/cors": "^3.1.0", "@koa/router": "^9.4.0", - "@types/node": "^15.12.2", + "@types/node": "^20.4.5", "apollo-link-http": "^1.5.17", "apollo-link-timeout": "^4.0.0", "bignumber.js": "^9.0.1", @@ -90,7 +90,6 @@ "koa-etag": "^4.0.0", "koa-helmet": "^5.2.0", "koa-router": "^9.4.0", - "node-fetch": "^2.6.1", "p-queue": "^6.6.2", "redis": "^4.0.6", "ts-node": "^10.0.0", diff --git a/packages/address-book/package.json b/packages/address-book/package.json index c66b6e970..9e8462338 100644 --- a/packages/address-book/package.json +++ b/packages/address-book/package.json @@ -18,7 +18,6 @@ "submit": "yarn checksum && yarn compile && yarn publish" }, "devDependencies": { - "@types/node-fetch": "^2.5.10", "@typescript-eslint/eslint-plugin": "^4.24.0", "@typescript-eslint/parser": "^4.24.0", "assert": "^2.0.0", @@ -27,7 +26,6 @@ "eslint-plugin-prettier": "^3.4.0", "ethereumjs-util": "^7.0.10", "lint-staged": "^11.1.2", - "node-fetch": "^2.6.1", "prettier": "^2.3.0", "ts-node": "^9.1.1", "typescript": "^4.2.4" diff --git a/packages/address-book/scripts/toChecksumTokenList.ts b/packages/address-book/scripts/toChecksumTokenList.ts index 6439a5ddd..c6b4b20d4 100644 --- a/packages/address-book/scripts/toChecksumTokenList.ts +++ b/packages/address-book/scripts/toChecksumTokenList.ts @@ -1,6 +1,5 @@ import { toChecksumAddress } from 'ethereumjs-util'; import { TokenList } from '../util/tokenList'; -import fetch from 'node-fetch'; import type Token from '../types/token'; import transformTokenListToObject from '../util/transfomTokenListToObject'; diff --git a/packages/address-book/yarn.lock b/packages/address-book/yarn.lock index bd7a6cca8..705646d6e 100644 --- a/packages/address-book/yarn.lock +++ b/packages/address-book/yarn.lock @@ -78,14 +78,6 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== -"@types/node-fetch@^2.5.10": - version "2.5.10" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.10.tgz#9b4d4a0425562f9fcea70b12cb3fcdd946ca8132" - integrity sha512-IpkX0AasN44hgEad0gEF/V6EgR5n69VEqPEgnmoM8GsIGro3PowbWs4tR6IhxUTyPLpOn+fiGG6nrQhcmoCuIQ== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - "@types/node@*": version "15.6.0" resolved "https://registry.yarnpkg.com/@types/node/-/node-15.6.0.tgz#f0ddca5a61e52627c9dcb771a6039d44694597bc" @@ -292,11 +284,6 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - available-typed-arrays@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.3.tgz#fb7d02445bfedefad79fad1fe47931163a227198" @@ -471,13 +458,6 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - commander@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" @@ -555,11 +535,6 @@ define-properties@^1.1.3: dependencies: object-keys "^1.0.12" -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - diff@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" @@ -929,15 +904,6 @@ foreach@^2.0.5: resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -1422,18 +1388,6 @@ micromatch@^4.0.2, micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -mime-db@1.47.0: - version "1.47.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.47.0.tgz#8cb313e59965d3c05cfbf898915a267af46a335c" - integrity sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw== - -mime-types@^2.1.12: - version "2.1.30" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.30.tgz#6e7be8b4c479825f85ed6326695db73f9305d62d" - integrity sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg== - dependencies: - mime-db "1.47.0" - mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -1471,11 +1425,6 @@ node-addon-api@^2.0.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== -node-fetch@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - node-gyp-build@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739" diff --git a/src/api/boosts/fetchBoostData.ts b/src/api/boosts/fetchBoostData.ts index de78128b5..a7fd8965d 100644 --- a/src/api/boosts/fetchBoostData.ts +++ b/src/api/boosts/fetchBoostData.ts @@ -1,4 +1,3 @@ -import fetch from 'node-fetch'; import { ChainId } from '../../../packages/address-book/address-book'; import BigNumber from 'bignumber.js'; import { ApiChain } from '../../utils/chain'; diff --git a/src/api/cmc/index.js b/src/api/cmc/index.js index 3bd937d59..59f7927ea 100644 --- a/src/api/cmc/index.js +++ b/src/api/cmc/index.js @@ -1,5 +1,4 @@ const { BigNumber, utils, ethers } = require('ethers'); -const fetch = require('node-fetch'); const fetchPrice = require('../../utils/fetchPrice'); const { API_BASE_URL, BSC_RPC } = require('../../constants'); diff --git a/src/api/stats/arbitrum/getGnsApys.js b/src/api/stats/arbitrum/getGnsApys.js index e3d901c0c..33de9fb83 100644 --- a/src/api/stats/arbitrum/getGnsApys.js +++ b/src/api/stats/arbitrum/getGnsApys.js @@ -1,9 +1,8 @@ -const fetch = require('node-fetch'); const BigNumber = require('bignumber.js'); import getApyBreakdown from '../common/getApyBreakdown'; -const pools = [{name: 'gns-arb-gns', address: '0x18c11FD286C5EC11c3b683Caa813B77f5163A122'}]; +const pools = [{ name: 'gns-arb-gns', address: '0x18c11FD286C5EC11c3b683Caa813B77f5163A122' }]; const url = 'https://backend-arbitrum.gains.trade/apr'; const getGnsApys = async () => { diff --git a/src/api/stats/bifibuyback/getBifiBuyback.ts b/src/api/stats/bifibuyback/getBifiBuyback.ts index dcc9f9a50..c6c530da2 100644 --- a/src/api/stats/bifibuyback/getBifiBuyback.ts +++ b/src/api/stats/bifibuyback/getBifiBuyback.ts @@ -1,7 +1,6 @@ import { BlockApiResponse, ERC20TxApiResponse } from './explorerApiResponseTypes'; import BigNumber from 'bignumber.js'; -import fetch from 'node-fetch'; import { addressBook } from '../../../../packages/address-book/address-book'; import fetchPrice from '../../../utils/fetchPrice'; diff --git a/src/api/stats/bsc/belt/getBeltApys.js b/src/api/stats/bsc/belt/getBeltApys.js index b967aa0e9..b6dea4a35 100644 --- a/src/api/stats/bsc/belt/getBeltApys.js +++ b/src/api/stats/bsc/belt/getBeltApys.js @@ -1,5 +1,4 @@ const BigNumber = require('bignumber.js'); -const fetch = require('node-fetch'); const fetchPrice = require('../../../../utils/fetchPrice'); const pools = require('../../../../data/beltPools.json'); const { compound } = require('../../../../utils/compound'); diff --git a/src/api/stats/bsc/getDotDotApy.js b/src/api/stats/bsc/getDotDotApy.js index 93b6949d7..e29702bac 100644 --- a/src/api/stats/bsc/getDotDotApy.js +++ b/src/api/stats/bsc/getDotDotApy.js @@ -1,4 +1,3 @@ -import fetch from 'node-fetch'; import BigNumber from 'bignumber.js'; import { BSC_CHAIN_ID } from '../../../constants'; import getApyBreakdown from '../common/getApyBreakdown'; diff --git a/src/api/stats/common/aave/getAaveV3Apys.js b/src/api/stats/common/aave/getAaveV3Apys.js index 33ca72dbe..5597dc499 100644 --- a/src/api/stats/common/aave/getAaveV3Apys.js +++ b/src/api/stats/common/aave/getAaveV3Apys.js @@ -4,7 +4,6 @@ const fetchPrice = require('../../../../utils/fetchPrice'); const { compound } = require('../../../../utils/compound'); const { BASE_HPY } = require('../../../../constants'); const { getTotalPerformanceFeeForVault } = require('../../../vaults/getVaultFees'); -const fetch = require('node-fetch'); const { getApyBreakdown } = require('../getApyBreakdown'); const { default: IAaveV3Incentives } = require('../../../../abis/AaveV3Incentives'); const { default: IAaveV3PoolDataProvider } = require('../../../../abis/AaveV3PoolDataProvider'); diff --git a/src/api/stats/common/balancer/getAuraApys.ts b/src/api/stats/common/balancer/getAuraApys.ts index 6d9c25248..1830d7006 100644 --- a/src/api/stats/common/balancer/getAuraApys.ts +++ b/src/api/stats/common/balancer/getAuraApys.ts @@ -2,7 +2,6 @@ import { getApyBreakdown, ApyBreakdownResult } from '../getApyBreakdown'; import { NormalizedCacheObject, ApolloClient } from '@apollo/client/core'; import jp from 'jsonpath'; import BigNumber from 'bignumber.js'; -import fetch from 'node-fetch'; import { getTradingFeeAprBalancer } from '../../../../utils/getTradingFeeApr'; import fetchPrice from '../../../../utils/fetchPrice'; import IAaveProtocolDataProvider from '../../../../abis/matic/AaveProtocolDataProvider'; diff --git a/src/api/stats/common/balancer/getBalancerApys.ts b/src/api/stats/common/balancer/getBalancerApys.ts index 2f8b86e44..4191bd7b7 100644 --- a/src/api/stats/common/balancer/getBalancerApys.ts +++ b/src/api/stats/common/balancer/getBalancerApys.ts @@ -5,7 +5,6 @@ import jp from 'jsonpath'; import IAaveProtocolDataProvider from '../../../../abis/matic/AaveProtocolDataProvider'; import IBalancerVault from '../../../../abis/IBalancerVault'; import BigNumber from 'bignumber.js'; -import fetch from 'node-fetch'; import { getTradingFeeAprBalancer } from '../../../../utils/getTradingFeeApr'; import fetchPrice from '../../../../utils/fetchPrice'; import { fetchContract } from '../../../rpc/client'; diff --git a/src/api/stats/common/curve/getCurveApyData.js b/src/api/stats/common/curve/getCurveApyData.js index 529a11390..7e66b1be8 100644 --- a/src/api/stats/common/curve/getCurveApyData.js +++ b/src/api/stats/common/curve/getCurveApyData.js @@ -1,4 +1,3 @@ -const fetch = require('node-fetch'); const BigNumber = require('bignumber.js'); const fetchPrice = require('../../../../utils/fetchPrice'); diff --git a/src/api/stats/common/getMiniChefApys.ts b/src/api/stats/common/getMiniChefApys.ts index 6dc4728f4..b208c2dd9 100644 --- a/src/api/stats/common/getMiniChefApys.ts +++ b/src/api/stats/common/getMiniChefApys.ts @@ -4,7 +4,6 @@ import { ChainId } from '../../../../packages/address-book/types/chainid'; import fetchPrice from '../../../utils/fetchPrice'; import { getApyBreakdown } from './getApyBreakdown'; import { LpPool, SingleAssetPool } from '../../../types/LpPool'; -import fetch from 'node-fetch'; import { fetchContract } from '../../rpc/client'; // trading apr diff --git a/src/api/stats/cronos/getFerroApys.js b/src/api/stats/cronos/getFerroApys.js index 8a52974fb..62c32756d 100644 --- a/src/api/stats/cronos/getFerroApys.js +++ b/src/api/stats/cronos/getFerroApys.js @@ -4,7 +4,6 @@ import getBlockTime from '../../../utils/getBlockTime'; import fetchPrice from '../../../utils/fetchPrice'; import getApyBreakdown from '../common/getApyBreakdown'; import BigNumber from 'bignumber.js'; -import fetch from 'node-fetch'; import StrategyABI from '../../../abis/StrategyABI'; import FerroFarm from '../../../abis/cronos/FerroFarm'; import { fetchContract } from '../../rpc/client'; diff --git a/src/api/stats/deprecated/fortube/getFortubeApys.js b/src/api/stats/deprecated/fortube/getFortubeApys.js index b1a7af4b7..811b2c570 100644 --- a/src/api/stats/deprecated/fortube/getFortubeApys.js +++ b/src/api/stats/deprecated/fortube/getFortubeApys.js @@ -1,4 +1,3 @@ -const fetch = require('node-fetch'); const { compound } = require('../../../../utils/compound'); const { WEEKLY_HPY, diff --git a/src/api/stats/ethereum/getAuraApys.js b/src/api/stats/ethereum/getAuraApys.js index 94c72b559..b45d3fcdb 100644 --- a/src/api/stats/ethereum/getAuraApys.js +++ b/src/api/stats/ethereum/getAuraApys.js @@ -1,4 +1,3 @@ -const fetch = require('node-fetch'); import getApyBreakdown from '../common/getApyBreakdown'; const BigNumber = require('bignumber.js'); const { ETH_CHAIN_ID: chainId, ETH_CHAIN_ID } = require('../../../constants'); diff --git a/src/api/stats/ethereum/getConicApys.js b/src/api/stats/ethereum/getConicApys.js index 44976191d..01012cc65 100644 --- a/src/api/stats/ethereum/getConicApys.js +++ b/src/api/stats/ethereum/getConicApys.js @@ -1,4 +1,3 @@ -import fetch from 'node-fetch'; import BigNumber from 'bignumber.js'; import getApyBreakdown from '../common/getApyBreakdown'; import pools from '../../../data/ethereum/conicPools.json'; diff --git a/src/api/stats/fantom/getBeethovenxDualApys.js b/src/api/stats/fantom/getBeethovenxDualApys.js index 8e7646a76..f479d2822 100644 --- a/src/api/stats/fantom/getBeethovenxDualApys.js +++ b/src/api/stats/fantom/getBeethovenxDualApys.js @@ -1,5 +1,4 @@ const BigNumber = require('bignumber.js'); -const fetch = require('node-fetch'); const fetchPrice = require('../../../utils/fetchPrice'); const { FANTOM_CHAIN_ID } = require('../../../constants'); const { getTradingFeeAprBalancerFTM } = require('../../../utils/getTradingFeeApr'); diff --git a/src/api/stats/getAmmPrices.ts b/src/api/stats/getAmmPrices.ts index 334871bd0..f119379fe 100644 --- a/src/api/stats/getAmmPrices.ts +++ b/src/api/stats/getAmmPrices.ts @@ -830,6 +830,11 @@ export async function getLpBreakdown() { return cachedLpBreakdowns; } +export async function getLpBreakdownForOracle(oracleId: string) { + const breakdowns = await getLpBreakdown(); + return breakdowns[oracleId]; +} + export async function getAmmTokenPrice( tokenSymbol: string, withUnknownLogging: boolean = false diff --git a/src/api/stats/matic/getGnsApys.js b/src/api/stats/matic/getGnsApys.js index 2d30c456c..a41f4f5e3 100644 --- a/src/api/stats/matic/getGnsApys.js +++ b/src/api/stats/matic/getGnsApys.js @@ -1,9 +1,8 @@ -const fetch = require('node-fetch'); const BigNumber = require('bignumber.js'); import getApyBreakdown from '../common/getApyBreakdown'; -const pools = [{name: 'gns-poly-gns', address: '0xE5417Af564e4bFDA1c483642db72007871397896'}]; +const pools = [{ name: 'gns-poly-gns', address: '0xE5417Af564e4bFDA1c483642db72007871397896' }]; const url = 'https://backend-polygon.gains.trade/apr'; const getGnsApys = async () => { diff --git a/src/api/stats/optimism/getBeetsOpApys.js b/src/api/stats/optimism/getBeetsOpApys.js index 6be5715ce..f1ad2f7e0 100644 --- a/src/api/stats/optimism/getBeetsOpApys.js +++ b/src/api/stats/optimism/getBeetsOpApys.js @@ -2,7 +2,6 @@ import { getTotalStakedInUsd, getYearlyRewardsInUsd } from '../common/curve/getC import getApyBreakdown from '../common/getApyBreakdown'; import BigNumber from 'bignumber.js'; import { OPTIMISM_CHAIN_ID } from '../../../constants'; -const fetch = require('node-fetch'); import { beetOpClient } from '../../../apollo/client'; const { getTradingFeeAprBalancer } = require('../../../utils/getTradingFeeApr'); import { addressBook } from '../../../../packages/address-book/address-book'; diff --git a/src/api/stats/optimism/getExactlyApys.js b/src/api/stats/optimism/getExactlyApys.js index 2596a0273..aebbae1c2 100644 --- a/src/api/stats/optimism/getExactlyApys.js +++ b/src/api/stats/optimism/getExactlyApys.js @@ -3,7 +3,6 @@ import { OPTIMISM_CHAIN_ID } from '../../../constants'; import { fetchContract } from '../../rpc/client'; import ExactlyRewardsController from '../../../abis/ExactlyRewardsController'; import ExactlyInterestRateModel from '../../../abis/ExactlyInterestRateModel'; -const fetch = require('node-fetch'); const fetchPrice = require('../../../utils/fetchPrice'); const { getApyBreakdown } = require('../common/getApyBreakdown'); diff --git a/src/api/treasury/multicallUtils.ts b/src/api/treasury/multicallUtils.ts index fcb1e5f44..776e94381 100644 --- a/src/api/treasury/multicallUtils.ts +++ b/src/api/treasury/multicallUtils.ts @@ -1,4 +1,3 @@ -const fetch = require('node-fetch'); import BigNumber from 'bignumber.js'; import { ContractCallContext, ContractCallReturnContext } from 'ethereum-multicall'; import { ERC20_ABI } from '../../abis/common/ERC20'; @@ -13,7 +12,9 @@ import { AssetBalance, ValidatorAsset, TreasuryApiResult, + isConcLiquidityAsset, } from './types'; +import { getLpBreakdownForOracle } from '../stats/getAmmPrices'; export const mapAssetToCall = ( asset: TreasuryAsset, diff --git a/src/api/treasury/types.ts b/src/api/treasury/types.ts index acae7d956..0dd7e634b 100644 --- a/src/api/treasury/types.ts +++ b/src/api/treasury/types.ts @@ -21,7 +21,7 @@ export type Asset = { address: string; name: string; decimals: number; - assetType: 'token' | 'native' | 'vault' | 'validator'; + assetType: 'token' | 'native' | 'vault' | 'validator' | 'concLiquidity'; oracleType: 'lps' | 'tokens'; oracleId: string; }; @@ -45,7 +45,12 @@ export type ValidatorAsset = Asset & { methodPath: string; }; -export type TreasuryAsset = Asset | VaultAsset | NativeAsset | ValidatorAsset; +export type ConcLiquidityAsset = Asset & { + assetType: 'concLiquidity'; + id: number; +}; + +export type TreasuryAsset = Asset | VaultAsset | NativeAsset | ValidatorAsset | ConcLiquidityAsset; export type TreasuryAssetRegistry = { [chain in ApiChain]?: { @@ -69,6 +74,10 @@ export function isTokenAsset(asset: TreasuryAsset): asset is TokenAsset { return isObject(asset) && asset.assetType === 'token'; } +export function isConcLiquidityAsset(asset: TreasuryAsset): asset is ConcLiquidityAsset { + return isObject(asset) && asset.assetType === 'concLiquidity'; +} + export type AssetBalance = { address: string; balances: { diff --git a/src/api/zaps/CachedGitJson.ts b/src/api/zaps/CachedGitJson.ts index 027fa7f37..88d535b1f 100644 --- a/src/api/zaps/CachedGitJson.ts +++ b/src/api/zaps/CachedGitJson.ts @@ -1,5 +1,4 @@ import { getKey, setKey } from '../../utils/cache'; -import fetch from 'node-fetch'; import { deferred, DeferredPromise } from '../../utils/promise'; import { serviceEventBus } from '../../utils/ServiceEventBus'; diff --git a/src/api/zaps/one-inch/OneInchSwapApi.ts b/src/api/zaps/one-inch/OneInchSwapApi.ts index 87bceec95..6e9773023 100644 --- a/src/api/zaps/one-inch/OneInchSwapApi.ts +++ b/src/api/zaps/one-inch/OneInchSwapApi.ts @@ -1,4 +1,3 @@ -import fetch from 'node-fetch'; import { URLSearchParams } from 'url'; import { HealthCheckResponse, diff --git a/src/apollo/client.ts b/src/apollo/client.ts index ff8637fef..31edfcf52 100644 --- a/src/apollo/client.ts +++ b/src/apollo/client.ts @@ -1,4 +1,3 @@ -import fetch from 'node-fetch'; import { createHttpLink } from 'apollo-link-http'; import { ApolloClient, diff --git a/src/utils/fetchCoinGeckoPrices.js b/src/utils/fetchCoinGeckoPrices.js index aef3b7f9c..0ab852278 100644 --- a/src/utils/fetchCoinGeckoPrices.js +++ b/src/utils/fetchCoinGeckoPrices.js @@ -1,5 +1,3 @@ -const fetch = require('node-fetch'); - const fetchCoinGeckoPrices = async coins => { if (!coins) return {}; const ids = coins.join(','); diff --git a/src/utils/fetchCurrencyPrices.js b/src/utils/fetchCurrencyPrices.js index 1a5a11ef0..f43d7d4d6 100644 --- a/src/utils/fetchCurrencyPrices.js +++ b/src/utils/fetchCurrencyPrices.js @@ -1,5 +1,3 @@ -const fetch = require('node-fetch'); - const fetchCurrencyPrices = async currencies => { if (!currencies) return {}; const ids = currencies.join(','); diff --git a/src/utils/getHolders.js b/src/utils/getHolders.js index 49645c92a..58e23e492 100644 --- a/src/utils/getHolders.js +++ b/src/utils/getHolders.js @@ -1,5 +1,3 @@ -const fetch = require('node-fetch'); - const getHolders = async () => { let holderCount = 0; diff --git a/src/utils/getVaults.js b/src/utils/getVaults.js index 6745a60f5..cf9e414bb 100644 --- a/src/utils/getVaults.js +++ b/src/utils/getVaults.js @@ -1,5 +1,3 @@ -const fetch = require('node-fetch'); - const getVaults = async vaultsEndpoint => { try { let vaults = await fetch(vaultsEndpoint).then(res => res.json()); diff --git a/tsconfig.json b/tsconfig.json index c4cd127fa..522f6884f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,6 +21,7 @@ "compilerOptions": { // typescript options here "outDir": "./dist", + "lib": ["DOM"], "allowJs": true, "checkJs": false, diff --git a/yarn.lock b/yarn.lock index 53d615729..2ca78cae9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1254,10 +1254,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.48.tgz#55f70bd432b6515828c0298689776861b90ca4fa" integrity sha512-4kxzqkrpwYtn6okJUcb2lfUu9ilnb3yhUOH6qX3nug8D2DupZ2drIkff2yJzYcNJVl3begnlcaBJ7tqiTTzjnQ== -"@types/node@^15.12.2": - version "15.14.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.14.9.tgz#bc43c990c3c9be7281868bbc7b8fdd6e2b57adfa" - integrity sha512-qjd88DrCxupx/kJD5yQgZdcYKZKSIGBVDIBE1/LTGcNm3d2Np/jxojkdePDdfnBHJc5W7vSMpbJ1aB7p/Py69A== +"@types/node@^20.4.5": + version "20.4.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.5.tgz#9dc0a5cb1ccce4f7a731660935ab70b9c00a5d69" + integrity sha512-rt40Nk13II9JwQBdeYqmbn2Q6IVTA5uPhvSO+JVqdXw/6/4glI6oR9ezty/A9Hg5u7JH4OmYmuQ+XvjKm0Datg== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -4804,13 +4804,6 @@ node-addon-api@^2.0.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== -node-fetch@^2.6.1: - version "2.6.12" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" - integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== - dependencies: - whatwg-url "^5.0.0" - node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: version "4.4.0" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.4.0.tgz#42e99687ce87ddeaf3a10b99dc06abc11021f3f4" @@ -6200,11 +6193,6 @@ tough-cookie@~2.5.0: psl "^1.1.28" punycode "^2.1.1" -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - trim-off-newlines@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.3.tgz#8df24847fcb821b0ab27d58ab6efec9f2fe961a1" @@ -6771,11 +6759,6 @@ web3@^1.3.0, web3@^1.5.0: web3-shh "1.7.3" web3-utils "1.7.3" -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - websocket@^1.0.32: version "1.0.34" resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.34.tgz#2bdc2602c08bf2c82253b730655c0ef7dcab3111" @@ -6793,14 +6776,6 @@ well-known-symbols@^2.0.0: resolved "https://registry.yarnpkg.com/well-known-symbols/-/well-known-symbols-2.0.0.tgz#e9c7c07dbd132b7b84212c8174391ec1f9871ba5" integrity sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q== -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" From edb9fe1afe33edb16f9e9c0d20515c1c23167364 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Tue, 25 Jul 2023 19:40:57 +0000 Subject: [PATCH 13/51] ci: version bump to 0.43.39 --- packages/address-book/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/address-book/package.json b/packages/address-book/package.json index 9e8462338..10a45a040 100644 --- a/packages/address-book/package.json +++ b/packages/address-book/package.json @@ -1,6 +1,6 @@ { "name": "blockchain-addressbook", - "version": "0.43.38", + "version": "0.43.39", "description": "A collection of useful addresses on various chains for defi development", "main": "build/address-book/index.js", "types": "build/address-book/index.d.ts", From c584bf827a69d515d4f0a0695052cb7446579105 Mon Sep 17 00:00:00 2001 From: shatterproof <4100078+shatterproof@users.noreply.github.com> Date: Wed, 26 Jul 2023 04:30:43 -0700 Subject: [PATCH 14/51] Add Velocimeter FVM (#1177) * Add Velocimeter FVM * Adjust token imports --- package.json | 3 +- .../address-book/address-book/fantom/index.ts | 2 + .../address-book/fantom/platforms/fvm.ts | 4 + .../address-book/fantom/tokens/tokens.ts | 53 ++++++++ scripts/add-solidly.ts | 8 +- src/api/stats/fantom/getFvmApys.js | 26 ++++ src/api/stats/fantom/getFvmStablePrices.js | 9 ++ src/api/stats/fantom/index.js | 2 + src/api/stats/getAmmPrices.ts | 2 + src/api/stats/getNonAmmPrices.ts | 2 + src/api/stats/zksync/getveSyncApys.js | 2 - src/data/archive/oldLpPools.json | 18 --- src/data/fantom/fvmLpPools.json | 122 ++++++++++++++++++ src/data/fantom/fvmStableLpPools.json | 102 +++++++++++++++ 14 files changed, 333 insertions(+), 22 deletions(-) create mode 100644 packages/address-book/address-book/fantom/platforms/fvm.ts create mode 100644 src/api/stats/fantom/getFvmApys.js create mode 100644 src/api/stats/fantom/getFvmStablePrices.js create mode 100644 src/data/fantom/fvmLpPools.json create mode 100644 src/data/fantom/fvmStableLpPools.json diff --git a/package.json b/package.json index a47cb5047..57903b931 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,8 @@ "fantom:spirits:add": "ts-node scripts/add-solidly.ts --network fantom --project spiritStable --newFee true", "fantom:equalizer:add": "ts-node scripts/add-solidly.ts --network fantom --project equalizer --newFee true --lp", "fantom:sushi:add": "ts-node scripts/add-sushi.ts --network fantom --project sushiFtm", + "fantom:solidly:add": "ts-node scripts/add-solidly.ts --network fantom --project solidly --newFee true", + "fantom:fvm:add": "ts-node scripts/add-solidly.ts --network fantom --project fvm --newFee true --lp", "polygon:quick:add": "ts-node scripts/add-quick.ts --network polygon --project quick", "polygon:quick:gamma:add": "ts-node scripts/add-sushi.ts --network polygon --project quick --newFee true --pool", "polygon:sushi:add": "ts-node scripts/add-sushi.ts --network polygon --project sushiPoly", @@ -57,7 +59,6 @@ "fuse:sushi:add": "ts-node scripts/add-sushi.ts --network fuse --project sushiFuse", "metis:netswap:add": "ts-node scripts/add-farm.ts --network metis --project netswap", "metis:tethys:add": "ts-node scripts/add-farm.ts --network metis --project tethys", - "fantom:solidly:add": "ts-node scripts/add-solidly.ts --network fantom --project solidly --newFee true", "polygon:dystopia:add": "ts-node scripts/add-solidly.ts --network polygon --project dystopia --newFee true", "polygon:uniswap:add": "ts-node scripts/add-univ3.ts --network polygon --project uniswap_polygon --strategy", "op:velodrome:add": "ts-node scripts/add-solidly.ts --network optimism --project velodrome --newFee true --lp", diff --git a/packages/address-book/address-book/fantom/index.ts b/packages/address-book/address-book/fantom/index.ts index 3d383c7db..8ce54d10b 100644 --- a/packages/address-book/address-book/fantom/index.ts +++ b/packages/address-book/address-book/fantom/index.ts @@ -7,6 +7,7 @@ import { solidly } from './platforms/solidly'; import { tombswap } from './platforms/tombswap'; import { solace } from './platforms/solace'; import { equalizer } from './platforms/equalizer'; +import { fvm } from './platforms/fvm'; import { tokens } from './tokens/tokens'; import { convertSymbolTokenMapToAddressTokenMap } from '../../util/convertSymbolTokenMapToAddressTokenMap'; import Chain from '../../types/chain'; @@ -23,6 +24,7 @@ const _fantom = { tombswap, solace, equalizer, + fvm, }, tokens, tokenAddressMap: convertSymbolTokenMapToAddressTokenMap(tokens), diff --git a/packages/address-book/address-book/fantom/platforms/fvm.ts b/packages/address-book/address-book/fantom/platforms/fvm.ts new file mode 100644 index 000000000..5f18c3e20 --- /dev/null +++ b/packages/address-book/address-book/fantom/platforms/fvm.ts @@ -0,0 +1,4 @@ +export const fvm = { + router: '0x2E14B53E2cB669f3A974CeaF6C735e134F3Aa9BC', + voter: '0xc9Ea7A2337f27935Cd3ccFB2f725B0428e731FBF', +} as const; diff --git a/packages/address-book/address-book/fantom/tokens/tokens.ts b/packages/address-book/address-book/fantom/tokens/tokens.ts index 7fdfc016d..31ae16af9 100644 --- a/packages/address-book/address-book/fantom/tokens/tokens.ts +++ b/packages/address-book/address-book/fantom/tokens/tokens.ts @@ -1867,6 +1867,7 @@ const _tokens = { address: '0xcc1b99dDAc1a33c201a742A1851662E87BC7f22C', chainId: 250, decimals: 6, + logoURI: '', website: 'https://tether.to/en/transparency/#usdt', bridge: 'layer-zero', description: @@ -1899,6 +1900,58 @@ const _tokens = { 'Wrapped Bitcoin (WBTC) is an ERC20 token backed 1:1 with Bitcoin, which brings greater liquidity to the Ethereum ecosystem including decentralized exchanges and financial applications. It allows Bitcoin holders to use their Bitcoin on the Ethereum network and participate in the DeFi ecosystem.', documentation: 'https://layerzero.gitbook.io/docs/', }, + frxETH: { + name: 'Frax Ether', + symbol: 'frxETH', + address: '0x9E73F99EE061C8807F69f9c6CCc44ea3d8c373ee', + chainId: 250, + decimals: 18, + logoURI: '', + website: 'https://app.frax.finance/frxeth/mint', + bridge: 'frax', + description: + 'frxETH acts as a stablecoin loosely pegged to ETH, so that 1 frxETH always represents 1 ETH and the amount of frxETH in circulation matches the amount of ETH in the Frax ETH system. When ETH is sent to the frxETHMinter, an equivalent amount of frxETH is minted. Holding frxETH on its own is not eligible for staking yield and should be thought of as analogous as holding ETH.', + documentation: 'https://docs.frax.finance/frax-ether/frxeth-and-sfrxeth', + }, + axlETH: { + name: 'Axelar Wrapped ETH', + symbol: 'axlETH', + address: '0xfe7eDa5F2c56160d406869A8aA4B2F365d544C7B', + chainId: 250, + decimals: 18, + logoURI: '', + website: 'https://axelar.network/', + bridge: 'axelar', + description: + 'Axelar Wrapped ETH (axlETH) is an ERC-20 token that represents a wrapped version of native Ethereum (ETH) cryptocurrency, allowing for cross-chain transfers and compatibility with the Ethereum ecosystem.', + documentation: 'https://docs.axelar.dev/', + }, + FVM: { + name: 'Fantom Velocimeter', + symbol: 'FVM', + address: '0x07BB65fAaC502d4996532F834A1B7ba5dC32Ff96', + chainId: 250, + decimals: 18, + logoURI: '', + website: 'https://www.fvm.exchange', + bridge: 'native', + description: + 'FVM is the native token for Velocimeter on Fantom (FVM), a project providing liquidity on the chain where it is needed most. The FVM token can be staked as or locked to earn rewards on the FVM platform.', + documentation: 'https://docs.velocimeter.xyz/FVMtokenomics', + }, + oFVM: { + name: 'Option to buy FVM', + symbol: 'oFVM', + address: '0xF9EDdca6B1e548B0EC8cDDEc131464F462b8310D', + chainId: 250, + decimals: 18, + logoURI: '', + website: 'https://www.fvm.exchange', + bridge: 'native', + description: + 'oFVM is a new options token that helps to reduce sell pressure on the native FVM token. It is earned by liquidity providers (LPs) who provide liquidity to the FVM-FTM pool. oFVM can be redeemed for FVM at a discount, or it can be locked up for a period of time as veFVM. veFVM is a governance token that allows holders to vote on the distribution of emissions, as well as receive weekly bribes and fees.', + documentation: 'https://docs.velocimeter.xyz/oFVMmech', + }, } as const; export const tokens: ConstRecord = _tokens; diff --git a/scripts/add-solidly.ts b/scripts/add-solidly.ts index eef5fe1d7..10906ec73 100644 --- a/scripts/add-solidly.ts +++ b/scripts/add-solidly.ts @@ -13,7 +13,7 @@ import { addressBook } from '../packages/address-book/address-book'; import ISolidlyPair from '../src/abis/ISolidlyPair'; const { fantom: { - platforms: { spiritswap, equalizer }, + platforms: { spiritswap, equalizer, fvm }, }, optimism: { platforms: { velodrome }, @@ -94,6 +94,12 @@ const projects = { volatileFile: '../src/data/fantom/equalizerV2LpPools.json', voter: equalizer.voter, }, + fvm: { + prefix: 'fvm', + stableFile: '../src/data/fantom/fvmStableLpPools.json', + volatileFile: '../src/data/fantom/fvmLpPools.json', + voter: fvm.voter, + }, solidly: { prefix: 'monolith', stableFile: '../src/data/ethereum/solidlyStableLpPools.json', diff --git a/src/api/stats/fantom/getFvmApys.js b/src/api/stats/fantom/getFvmApys.js new file mode 100644 index 000000000..bc31d7795 --- /dev/null +++ b/src/api/stats/fantom/getFvmApys.js @@ -0,0 +1,26 @@ +const { FANTOM_CHAIN_ID: chainId } = require('../../../constants'); +const { getSolidlyGaugeApys } = require('../common/getSolidlyGaugeApys'); + +const stablePools = require('../../../data/fantom/fvmStableLpPools.json'); +const volatilePools = require('../../../data/fantom/fvmLpPools.json'); +import { addressBook } from '../../../../packages/address-book/address-book'; +const { + fantom: { + tokens: { FVM }, + }, +} = addressBook; + +const pools = [...stablePools, ...volatilePools]; +const getFvmApys = async () => + getSolidlyGaugeApys({ + chainId: chainId, + pools: pools, + oracleId: 'oFVM', + oracle: 'tokens', + decimals: '1e18', + reward: FVM.address, + boosted: false, + // log: true, + }); + +module.exports = getFvmApys; diff --git a/src/api/stats/fantom/getFvmStablePrices.js b/src/api/stats/fantom/getFvmStablePrices.js new file mode 100644 index 000000000..a5aaf88c4 --- /dev/null +++ b/src/api/stats/fantom/getFvmStablePrices.js @@ -0,0 +1,9 @@ +const getSolidlyStablePrices = require('../common/getSolidlyStablePrices'); +const pools = require('../../../data/fantom/fvmStableLpPools.json'); +const { FANTOM_CHAIN_ID } = require('../../../constants'); + +const getFvmStablePrices = async tokenPrices => { + return await getSolidlyStablePrices(FANTOM_CHAIN_ID, pools, tokenPrices); +}; + +module.exports = getFvmStablePrices; diff --git a/src/api/stats/fantom/index.js b/src/api/stats/fantom/index.js index 71bc0689f..f8d44edd0 100644 --- a/src/api/stats/fantom/index.js +++ b/src/api/stats/fantom/index.js @@ -32,8 +32,10 @@ const getSpiritV2Apys = require('./getSpiritV2Apys'); const getMaiCurveApys = require('./getMaiCurveApys'); const getEqualizerApys = require('./getEqualizerApys'); const getMmyApys = require('./getMmyApys'); +const getFvmApys = require('./getFvmApys'); const getApys = [ + getFvmApys, getMmyApys, getEqualizerApys, getSpiritV2Apys, diff --git a/src/api/stats/getAmmPrices.ts b/src/api/stats/getAmmPrices.ts index f119379fe..beb2a6742 100644 --- a/src/api/stats/getAmmPrices.ts +++ b/src/api/stats/getAmmPrices.ts @@ -272,6 +272,7 @@ import pearlPools from '../../data/matic/pearlLpPools.json'; import velocorePools from '../../data/zksync/velocoreLpPools.json'; import soliSnekPools from '../../data/avax/soliSnekLpPools.json'; import veSyncPools from '../../data/zksync/veSyncLpPools.json'; +import fvmPools from '../../data/fantom/fvmLpPools.json'; import { fetchVaultPrices } from '../../utils/fetchVaultPrices'; import { addressBookByChainId } from '../../../packages/address-book/address-book'; import { sleep } from '../../utils/time'; @@ -286,6 +287,7 @@ const REFRESH_INTERVAL = 5 * 60 * 1000; // FIXME: if this list grows too big we might hit the ratelimit on initialization everytime // Implement in case of emergency -> https://github.com/beefyfinance/beefy-api/issues/103 const pools = normalizePoolOracleIds([ + ...fvmPools, ...veSyncPools, ...soliSnekPools, ...velocorePools, diff --git a/src/api/stats/getNonAmmPrices.ts b/src/api/stats/getNonAmmPrices.ts index 45949c270..ae0a2bae9 100644 --- a/src/api/stats/getNonAmmPrices.ts +++ b/src/api/stats/getNonAmmPrices.ts @@ -72,6 +72,7 @@ import getUniswapArbitrumPrices from './arbitrum/getUniswapPositionPrices'; import getQuickGammaPrices from './matic/getQuickGammaPrices'; import getChronosStablePrices from './arbitrum/getChronosStablePrices'; import getQuickGammaZkPrices from './zkevm/getQuickGammaPrices'; +import getFvmStablePrices from './fantom/getFvmStablePrices'; export type NonAmmPrices = { prices: Record; @@ -165,6 +166,7 @@ export async function getNonAmmPrices(tokenPrices: Record): Prom getQuickGammaPrices(tokenPrices), getQuickGammaZkPrices(tokenPrices), getChronosStablePrices(tokenPrices), + getFvmStablePrices(tokenPrices), ]; // Setup error logs diff --git a/src/api/stats/zksync/getveSyncApys.js b/src/api/stats/zksync/getveSyncApys.js index a1572ca49..d86ae38f2 100644 --- a/src/api/stats/zksync/getveSyncApys.js +++ b/src/api/stats/zksync/getveSyncApys.js @@ -1,4 +1,3 @@ -const { zksyncWeb3: web3 } = require('../../../utils/web3'); const { ZKSYNC_CHAIN_ID: chainId } = require('../../../constants'); const { getSolidlyGaugeApys } = require('../common/getSolidlyGaugeApys'); @@ -13,7 +12,6 @@ const { const pools = [...volatilePools]; const getveSyncApys = async () => getSolidlyGaugeApys({ - web3: web3, chainId: chainId, pools: pools, oracleId: 'VSzk', diff --git a/src/data/archive/oldLpPools.json b/src/data/archive/oldLpPools.json index 8cda1000d..a030b8a89 100644 --- a/src/data/archive/oldLpPools.json +++ b/src/data/archive/oldLpPools.json @@ -1,22 +1,4 @@ [ - { - "name": "fvm-lzweth-lzwbtc", - "address": "0x04636D31Be7a53BB91E48166B2458C6c35cC7BF2", - "decimals": "1e18", - "chainId": 250, - "lp0": { - "address": "0x695921034f0387eAc4e11620EE91b1b15A6A09fE", - "oracle": "tokens", - "oracleId": "lzWETH", - "decimals": "1e18" - }, - "lp1": { - "address": "0xf1648C50d2863f780c57849D812b4B7686031A3D", - "oracle": "tokens", - "oracleId": "lzWBTC", - "decimals": "1e8" - } - }, { "name": "boo-lzusdc-lzweth", "address": "0xf2610511493473379d76Bfee07B673D0cB4Ed3E7", diff --git a/src/data/fantom/fvmLpPools.json b/src/data/fantom/fvmLpPools.json new file mode 100644 index 000000000..85b9445d6 --- /dev/null +++ b/src/data/fantom/fvmLpPools.json @@ -0,0 +1,122 @@ +[ + { + "name": "fvm-wftm-sftmx", + "address": "0xAC8909fB68C33fFBf977E55b07b5Fe85552Ef97d", + "gauge": "0x7f244DAA7aE845a20D621d876896530b58D0a681", + "decimals": "1e18", + "chainId": 250, + "beefyFee": 0.095, + "lp0": { + "address": "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83", + "oracle": "tokens", + "oracleId": "WFTM", + "decimals": "1e18" + }, + "lp1": { + "address": "0xd7028092c830b5C8FcE061Af2E593413EbbC1fc1", + "oracle": "tokens", + "oracleId": "sFTMX", + "decimals": "1e18" + } + }, + { + "name": "fvm-wftm-ofvm", + "address": "0x9b014996cfA03BE2584c6E3f0e48E7c998032AD6", + "gauge": "0x3921c989D757B970e88f7a7a08eAa93b7bF6c84f", + "decimals": "1e18", + "chainId": 250, + "beefyFee": 0.095, + "lp0": { + "address": "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83", + "oracle": "tokens", + "oracleId": "WFTM", + "decimals": "1e18" + }, + "lp1": { + "address": "0xF9EDdca6B1e548B0EC8cDDEc131464F462b8310D", + "oracle": "tokens", + "oracleId": "oFVM", + "decimals": "1e18" + } + }, + { + "name": "fvm-lzweth-lzwbtc", + "address": "0x04636D31Be7a53BB91E48166B2458C6c35cC7BF2", + "gauge": "0x3900EE825056dcd49B5aE4BDF2d16F38B764bfe7", + "decimals": "1e18", + "chainId": 250, + "beefyFee": 0.095, + "lp0": { + "address": "0x695921034f0387eAc4e11620EE91b1b15A6A09fE", + "oracle": "tokens", + "oracleId": "lzWETH", + "decimals": "1e18" + }, + "lp1": { + "address": "0xf1648C50d2863f780c57849D812b4B7686031A3D", + "oracle": "tokens", + "oracleId": "lzWBTC", + "decimals": "1e8" + } + }, + { + "name": "fvm-fvm-wftm", + "address": "0x0E8f117a563Be78Eb5A391A066d0d43Dd187a9E0", + "gauge": "0xa3643a5d5B672a267199227CD3E95eD0B41DBD52", + "decimals": "1e18", + "chainId": 250, + "beefyFee": 0.095, + "lp0": { + "address": "0x07BB65fAaC502d4996532F834A1B7ba5dC32Ff96", + "oracle": "tokens", + "oracleId": "FVM", + "decimals": "1e18" + }, + "lp1": { + "address": "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83", + "oracle": "tokens", + "oracleId": "WFTM", + "decimals": "1e18" + } + }, + { + "name": "fvm-wftm-lzusdc", + "address": "0x1a35C7357BC8D0eB9342d73D4f13c4a6f64AC1d6", + "gauge": "0x78751a5577fb9875acCeDe0965691D46960C1216", + "decimals": "1e18", + "chainId": 250, + "beefyFee": 0.095, + "lp0": { + "address": "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83", + "oracle": "tokens", + "oracleId": "WFTM", + "decimals": "1e18" + }, + "lp1": { + "address": "0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf", + "oracle": "tokens", + "oracleId": "lzUSDC", + "decimals": "1e6" + } + }, + { + "name": "fvm-wftm-lzweth", + "address": "0x3A3F84b45f857DF60360b2B007eeF495576642DE", + "gauge": "0x30d0672C6E51F3169D8d19e2EAB12D0E7Aa16e17", + "decimals": "1e18", + "chainId": 250, + "beefyFee": 0.095, + "lp0": { + "address": "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83", + "oracle": "tokens", + "oracleId": "WFTM", + "decimals": "1e18" + }, + "lp1": { + "address": "0x695921034f0387eAc4e11620EE91b1b15A6A09fE", + "oracle": "tokens", + "oracleId": "lzWETH", + "decimals": "1e18" + } + } +] diff --git a/src/data/fantom/fvmStableLpPools.json b/src/data/fantom/fvmStableLpPools.json new file mode 100644 index 000000000..891917e2e --- /dev/null +++ b/src/data/fantom/fvmStableLpPools.json @@ -0,0 +1,102 @@ +[ + { + "name": "fvm-lzweth-axleth", + "address": "0xEFAA8271c826D89534C3C0E06eb771F08eFC18D2", + "gauge": "0x0581F26Ae1ba6b4058F1134eBaF8b802816d0272", + "decimals": "1e18", + "chainId": 250, + "beefyFee": 0.095, + "lp0": { + "address": "0x695921034f0387eAc4e11620EE91b1b15A6A09fE", + "oracle": "tokens", + "oracleId": "lzWETH", + "decimals": "1e18" + }, + "lp1": { + "address": "0xfe7eDa5F2c56160d406869A8aA4B2F365d544C7B", + "oracle": "tokens", + "oracleId": "axlETH", + "decimals": "1e18" + } + }, + { + "name": "fvm-axlusdc-lzusdc", + "address": "0xDb0f33978B5366191C42Bb9A7B7d886Cb714dF65", + "gauge": "0xC4651123dfA925715636Fe76b90c034cc4D38539", + "decimals": "1e18", + "chainId": 250, + "beefyFee": 0.095, + "lp0": { + "address": "0x1B6382DBDEa11d97f24495C9A90b7c88469134a4", + "oracle": "tokens", + "oracleId": "axlUSDC", + "decimals": "1e6" + }, + "lp1": { + "address": "0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf", + "oracle": "tokens", + "oracleId": "lzUSDC", + "decimals": "1e6" + } + }, + { + "name": "fvm-lzweth-frxeth", + "address": "0x9e6F4eA5C799253ecA001Ac159646C36AE607f41", + "gauge": "0x673797B1930950a9C5Ee0e38074F17d8966684BD", + "decimals": "1e18", + "chainId": 250, + "beefyFee": 0.095, + "lp0": { + "address": "0x695921034f0387eAc4e11620EE91b1b15A6A09fE", + "oracle": "tokens", + "oracleId": "lzWETH", + "decimals": "1e18" + }, + "lp1": { + "address": "0x9E73F99EE061C8807F69f9c6CCc44ea3d8c373ee", + "oracle": "tokens", + "oracleId": "frxETH", + "decimals": "1e18" + } + }, + { + "name": "fvm-lzusdc-frax", + "address": "0x9746C3614307E937A1c82dE1c9Ff2bE30fCe6712", + "gauge": "0xf5f52DD351A4193c8Aa56563Bf20F18693A5C091", + "decimals": "1e18", + "chainId": 250, + "beefyFee": 0.095, + "lp0": { + "address": "0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf", + "oracle": "tokens", + "oracleId": "lzUSDC", + "decimals": "1e6" + }, + "lp1": { + "address": "0xdc301622e621166BD8E82f2cA0A26c13Ad0BE355", + "oracle": "tokens", + "oracleId": "FRAX", + "decimals": "1e18" + } + }, + { + "name": "fvm-lzusdc-lzusdt", + "address": "0xf456528A6aE4209cEdf6Fe976C036EB11Ad7bDD5", + "gauge": "0x53929aFc4ef21EDf9534a527eb2C108975eF66aE", + "decimals": "1e18", + "chainId": 250, + "beefyFee": 0.095, + "lp0": { + "address": "0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf", + "oracle": "tokens", + "oracleId": "lzUSDC", + "decimals": "1e6" + }, + "lp1": { + "address": "0xcc1b99dDAc1a33c201a742A1851662E87BC7f22C", + "oracle": "tokens", + "oracleId": "lzUSDT", + "decimals": "1e6" + } + } +] From c2631c6c2cb9a98d6d70f133c36b8fcad3eb62ad Mon Sep 17 00:00:00 2001 From: kexley <87971154+kexleyBeefy@users.noreply.github.com> Date: Wed, 26 Jul 2023 12:30:50 +0100 Subject: [PATCH 15/51] Add Exactly EXA reward (#1180) --- src/api/stats/optimism/getExactlyApys.js | 52 ++++++----- src/data/optimism/exactlyPools.json | 108 ++++++++++++++++++++++- src/data/optimism/velodromeLpPools.json | 20 +++++ 3 files changed, 157 insertions(+), 23 deletions(-) diff --git a/src/api/stats/optimism/getExactlyApys.js b/src/api/stats/optimism/getExactlyApys.js index aebbae1c2..098c3e756 100644 --- a/src/api/stats/optimism/getExactlyApys.js +++ b/src/api/stats/optimism/getExactlyApys.js @@ -14,8 +14,6 @@ const { compound } = require('../../../utils/compound'); const pools = require('../../../data/optimism/exactlyPools.json'); const RewardsController = '0xBd1ba78A3976cAB420A9203E6ef14D18C2B2E031'; -const reward = '0x4200000000000000000000000000000000000042'; -const rewardOracleId = 'OP'; const getExactlyApys = async () => { const apys = []; @@ -44,43 +42,53 @@ const getPoolApy = async pool => { const compoundedReward = compound(totalReward, BASE_HPY, 1, shareAfterBeefyPerformanceFee); const apy = leveragedSupplyBase.minus(leveragedBorrowBase).plus(compoundedReward); - // console.log(pool.name, apy, supplyBase.valueOf(), borrowBase.valueOf(), supplyReward.valueOf(), borrowReward.valueOf()); + // console.log(pool.name, apy.toString(), supplyBase.toString(), borrowBase.toString(), supplyReward.toString(), borrowReward.toString()); return [apy, lsApr]; }; const getExactlyPoolData = async pool => { const { supplyBase, utilization } = await getExactlyData(exactlyClient, pool.market); - const rewardsController = fetchContract( - RewardsController, - ExactlyRewardsController, - OPTIMISM_CHAIN_ID - ); const interestRateModel = fetchContract( pool.interestRateModel, ExactlyInterestRateModel, OPTIMISM_CHAIN_ID ); - const indexStartCall = rewardsController.read.previewAllocation([pool.market, reward, 0]); - const indexEndCall = rewardsController.read.previewAllocation([pool.market, reward, 86400]); const borrowBaseCall = interestRateModel.read.floatingRate([utilization.toString()]); + const borrowBase = new BigNumber(await Promise.all([borrowBaseCall])).dividedBy('1e18'); - const res = await Promise.all([indexStartCall, indexEndCall, borrowBaseCall]); + const rewardsController = fetchContract( + RewardsController, + ExactlyRewardsController, + OPTIMISM_CHAIN_ID + ); + + let supplyReward = new BigNumber(0); + let borrowReward = new BigNumber(0); + const tokenPrice = await fetchPrice({ oracle: pool.oracle, id: pool.oracleId }); - const borrowIndexStart = new BigNumber(res[0][0].toString()); - const supplyIndexStart = new BigNumber(res[0][1].toString()); - const borrowIndexEnd = new BigNumber(res[1][0].toString()); - const supplyIndexEnd = new BigNumber(res[1][1].toString()); - const borrowBase = new BigNumber(res[2].toString()).dividedBy('1e18'); + for (const reward of pool.rewards) { + const indexStartCall = rewardsController.read.previewAllocation([pool.market, reward.address, 0]); + const indexEndCall = rewardsController.read.previewAllocation([pool.market, reward.address, 86400]); - const borrowIndex = borrowIndexEnd.minus(borrowIndexStart); - const supplyIndex = supplyIndexEnd.minus(supplyIndexStart); + const res = await Promise.all([indexStartCall, indexEndCall]); - const tokenPrice = await fetchPrice({ oracle: pool.oracle, id: pool.oracleId }); - const rewardPrice = await fetchPrice({ oracle: 'tokens', id: rewardOracleId }); - const supplyReward = supplyIndex.times(rewardPrice).times(365).dividedBy(tokenPrice).div('1e18'); - const borrowReward = borrowIndex.times(rewardPrice).times(365).dividedBy(tokenPrice).div('1e18'); + const borrowIndexStart = new BigNumber(res[0][0].toString()); + const supplyIndexStart = new BigNumber(res[0][1].toString()); + const borrowIndexEnd = new BigNumber(res[1][0].toString()); + const supplyIndexEnd = new BigNumber(res[1][1].toString()); + + const borrowIndex = borrowIndexEnd.minus(borrowIndexStart); + const supplyIndex = supplyIndexEnd.minus(supplyIndexStart); + + const rewardPrice = await fetchPrice({ oracle: 'tokens', id: reward.id }); + const intermiateSupplyReward = supplyIndex.times(rewardPrice).times(365).dividedBy(tokenPrice).dividedBy('1e18'); + const intermiateBorrowReward = borrowIndex.times(rewardPrice).times(365).dividedBy(tokenPrice).dividedBy('1e18'); + + supplyReward = supplyReward.plus(intermiateSupplyReward); + borrowReward = borrowReward.plus(intermiateBorrowReward); + } let lsApr = 0; if (pool.lsUrl) { diff --git a/src/data/optimism/exactlyPools.json b/src/data/optimism/exactlyPools.json index df4fe086f..774709890 100644 --- a/src/data/optimism/exactlyPools.json +++ b/src/data/optimism/exactlyPools.json @@ -1,12 +1,39 @@ [ + { + "name": "exactly-supply-op", + "token": "0x4200000000000000000000000000000000000042", + "market": "0xa430A427bd00210506589906a71B54d6C256CEdb", + "interestRateModel": "0x3179265d20d13cE507157b8087dE48759eb21006", + "oracle": "tokens", + "oracleId": "OP", + "decimals": "1e18", + "rewards": [ + { + "address": "0x1e925De1c68ef83bD98eE3E130eF14a50309C01B", + "id": "EXA" + } + ], + "beefyFee": 0.095, + "ltv": 0 + }, { "name": "exactly-supply-eth", "token": "0x4200000000000000000000000000000000000006", "market": "0xc4d4500326981eacD020e20A81b1c479c161c7EF", - "interestRateModel": "0x3179265d20d13cE507157b8087dE48759eb21006", + "interestRateModel": "0xA0D96f92abFB65330Aa21550cD334455b5236F16", "oracle": "tokens", "oracleId": "WETH", "decimals": "1e18", + "rewards": [ + { + "address": "0x4200000000000000000000000000000000000042", + "id": "OP" + }, + { + "address": "0x1e925De1c68ef83bD98eE3E130eF14a50309C01B", + "id": "EXA" + } + ], "beefyFee": 0.095, "ltv": 0 }, @@ -18,6 +45,16 @@ "oracle": "tokens", "oracleId": "USDC", "decimals": "1e6", + "rewards": [ + { + "address": "0x4200000000000000000000000000000000000042", + "id": "OP" + }, + { + "address": "0x1e925De1c68ef83bD98eE3E130eF14a50309C01B", + "id": "EXA" + } + ], "beefyFee": 0.095, "ltv": 0 }, @@ -30,9 +67,36 @@ "oracle": "tokens", "oracleId": "wstETH", "decimals": "1e18", + "rewards": [ + { + "address": "0x4200000000000000000000000000000000000042", + "id": "OP" + }, + { + "address": "0x1e925De1c68ef83bD98eE3E130eF14a50309C01B", + "id": "EXA" + } + ], "beefyFee": 0.095, "ltv": 0 }, + { + "name": "exactly-leverage-op", + "token": "0x4200000000000000000000000000000000000042", + "market": "0xa430A427bd00210506589906a71B54d6C256CEdb", + "interestRateModel": "0x3179265d20d13cE507157b8087dE48759eb21006", + "oracle": "tokens", + "oracleId": "OP", + "decimals": "1e18", + "rewards": [ + { + "address": "0x1e925De1c68ef83bD98eE3E130eF14a50309C01B", + "id": "EXA" + } + ], + "beefyFee": 0.095, + "ltv": 0.3 + }, { "name": "exactly-leverage-eth", "token": "0x4200000000000000000000000000000000000006", @@ -41,6 +105,16 @@ "oracle": "tokens", "oracleId": "WETH", "decimals": "1e18", + "rewards": [ + { + "address": "0x4200000000000000000000000000000000000042", + "id": "OP" + }, + { + "address": "0x1e925De1c68ef83bD98eE3E130eF14a50309C01B", + "id": "EXA" + } + ], "beefyFee": 0.095, "ltv": 0.65 }, @@ -52,7 +126,39 @@ "oracle": "tokens", "oracleId": "USDC", "decimals": "1e6", + "rewards": [ + { + "address": "0x4200000000000000000000000000000000000042", + "id": "OP" + }, + { + "address": "0x1e925De1c68ef83bD98eE3E130eF14a50309C01B", + "id": "EXA" + } + ], "beefyFee": 0.095, "ltv": 0.76 + }, + { + "name": "exactly-leverage-wsteth", + "token": "0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb", + "market": "0x22ab31Cd55130435b5efBf9224b6a9d5EC36533F", + "interestRateModel": "0xAdEfc7F878E533b479e36Af349Bd3D8cbFa08311", + "lsUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "oracle": "tokens", + "oracleId": "wstETH", + "decimals": "1e18", + "rewards": [ + { + "address": "0x4200000000000000000000000000000000000042", + "id": "OP" + }, + { + "address": "0x1e925De1c68ef83bD98eE3E130eF14a50309C01B", + "id": "EXA" + } + ], + "beefyFee": 0.095, + "ltv": 0.6 } ] diff --git a/src/data/optimism/velodromeLpPools.json b/src/data/optimism/velodromeLpPools.json index 5803c9203..2b29448db 100644 --- a/src/data/optimism/velodromeLpPools.json +++ b/src/data/optimism/velodromeLpPools.json @@ -1,4 +1,24 @@ [ + { + "name": "velodrome-v2-exa-weth", + "address": "0xf3C45b45223Df6071a478851B9C17e0630fDf535", + "gauge": "0x76ec1eF8c0F72ccdFbB661664C6cB0Ac187D2fB5", + "decimals": "1e18", + "chainId": 10, + "beefyFee": 0.095, + "lp0": { + "address": "0x1e925De1c68ef83bD98eE3E130eF14a50309C01B", + "oracle": "tokens", + "oracleId": "EXA", + "decimals": "1e18" + }, + "lp1": { + "address": "0x4200000000000000000000000000000000000006", + "oracle": "tokens", + "oracleId": "WETH", + "decimals": "1e18" + } + }, { "name": "velodrome-v2-op-frxeth", "address": "0x2fE304b407c7fAb2a3c10962F14dB751468a4f5b", From 961baf24953951189c2bb5da771b2b45d2649036 Mon Sep 17 00:00:00 2001 From: MirthFutures Date: Wed, 26 Jul 2023 07:35:43 -0400 Subject: [PATCH 16/51] Add zkSync msig --- .../address-book/zksync/platforms/beefyfinance.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/address-book/address-book/zksync/platforms/beefyfinance.ts b/packages/address-book/address-book/zksync/platforms/beefyfinance.ts index 0bcfad60c..07f62baf1 100644 --- a/packages/address-book/address-book/zksync/platforms/beefyfinance.ts +++ b/packages/address-book/address-book/zksync/platforms/beefyfinance.ts @@ -1,5 +1,5 @@ -const devMultisig = '0xdAec0E93A98b6184816dFDA318B1A01EAF026164'; -const treasuryMultisig = '0xdAec0E93A98b6184816dFDA318B1A01EAF026164'; +const devMultisig = '0x9D138aDAFC29A36497e0791084920b7B18e0AE48'; +const treasuryMultisig = '0x9F9FE15FDa14eAA2d878Ed667C805A7CC13c2560'; const hw = '0xdAec0E93A98b6184816dFDA318B1A01EAF026164'; export const beefyfinance = { From ccb123fbe361595f32e1c5d6d4d51f67f602a6c7 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Wed, 26 Jul 2023 11:36:30 +0000 Subject: [PATCH 17/51] ci: version bump to 0.43.40 --- packages/address-book/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/address-book/package.json b/packages/address-book/package.json index 10a45a040..66bf4b033 100644 --- a/packages/address-book/package.json +++ b/packages/address-book/package.json @@ -1,6 +1,6 @@ { "name": "blockchain-addressbook", - "version": "0.43.39", + "version": "0.43.40", "description": "A collection of useful addresses on various chains for defi development", "main": "build/address-book/index.js", "types": "build/address-book/index.d.ts", From 9b156ea804e3c41da9344d7bb67d5af0cf456550 Mon Sep 17 00:00:00 2001 From: chebiN <17909998+seguido@users.noreply.github.com> Date: Wed, 26 Jul 2023 14:26:34 -0300 Subject: [PATCH 18/51] fix arb+movr gov pool apr oracle --- src/api/stats/arbitrum/getArbiBifiGovApy.js | 2 +- src/api/stats/moonriver/getMovrBifiGovApy.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/stats/arbitrum/getArbiBifiGovApy.js b/src/api/stats/arbitrum/getArbiBifiGovApy.js index 76e5e646b..94eb53ccd 100644 --- a/src/api/stats/arbitrum/getArbiBifiGovApy.js +++ b/src/api/stats/arbitrum/getArbiBifiGovApy.js @@ -9,7 +9,7 @@ const BLOCKS_PER_DAY = 28800; const getArbiBifiGovApy = async () => { return getBifiGovApr( ARBITRUM_CHAIN_ID, - 'arbitrum', + 'arbi', 'WETH', DECIMALS, REWARDS, diff --git a/src/api/stats/moonriver/getMovrBifiGovApy.js b/src/api/stats/moonriver/getMovrBifiGovApy.js index 7999b16a2..afc2320e8 100644 --- a/src/api/stats/moonriver/getMovrBifiGovApy.js +++ b/src/api/stats/moonriver/getMovrBifiGovApy.js @@ -9,7 +9,7 @@ const BLOCKS_PER_DAY = 28800; const getMovrBifiGovApy = async () => { return await getBifiGovApr( MOONRIVER_CHAIN_ID, - 'moonriver', + 'movr', 'WMOVR', DECIMALS, REWARDS, From 7ace8beb914f44c7538b40c404ede8c7430d5cf1 Mon Sep 17 00:00:00 2001 From: chebiN <17909998+seguido@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:55:56 -0300 Subject: [PATCH 19/51] fix kava bifi buyback url --- src/api/stats/bifibuyback/getBifiBuyback.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/stats/bifibuyback/getBifiBuyback.ts b/src/api/stats/bifibuyback/getBifiBuyback.ts index c6c530da2..c462c13d1 100644 --- a/src/api/stats/bifibuyback/getBifiBuyback.ts +++ b/src/api/stats/bifibuyback/getBifiBuyback.ts @@ -50,7 +50,7 @@ const getBuyback = async ( const startBlock = await getStartBlockFromExplorer(scanUrl, apiToken); const url = `${scanUrl}/api?module=account&action=tokentx&address=${bifiMaxiAddress}&sort=asc&start` + - (apiToken === undefined && chainName !== 'kava' ? '_' : '') + + (apiToken === undefined ? '_' : '') + `block=${startBlock}` + (apiToken ? `&apikey=${apiToken}` : ''); const resp = await fetch(url); From 6fb775108172a75e371ed4a3ccf9bf9e0af6b8da Mon Sep 17 00:00:00 2001 From: EPETE-EPETE <89405534+EPETE-EPETE@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:16:01 -0400 Subject: [PATCH 20/51] add bridges to KAVA Tokens --- .../address-book/kava/tokens/tokens.ts | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/packages/address-book/address-book/kava/tokens/tokens.ts b/packages/address-book/address-book/kava/tokens/tokens.ts index 3d9a1bc51..1f021370d 100644 --- a/packages/address-book/address-book/kava/tokens/tokens.ts +++ b/packages/address-book/address-book/kava/tokens/tokens.ts @@ -12,6 +12,7 @@ const KAVA = { 'The Kava Network is the first Layer-1 blockchain to combine the speed and scalability of the Cosmos SDK with the developer support of Ethereum. The Kava Network will empower developers to build for Web3 and next-gen blockchain technologies through its unique co-chain architecture. KAVA is the native governance and staking token of the Kava Network, enabling its decentralization and security. ', logoURI: '', documentation: 'https://docs.kava.io/docs/intro/', + bridge: 'native', } as const; const _tokens = { @@ -30,6 +31,7 @@ const _tokens = { description: 'USDC (Multichain) is a fully collateralized US dollar stablecoin. USDC is issued by regulated financial institutions, backed by fully reserved assets, redeemable on a 1:1 basis for US dollars.', documentation: 'https://developers.circle.com/docs', + bridge: 'native', }, multichainUSDT: { name: 'USDT', @@ -42,6 +44,7 @@ const _tokens = { description: 'Multichain Bridged Token. Tether is a stablecoin pegged to the US Dollar. A stablecoin is a type of cryptocurrency whose value is pegged to another fiat currency like the US Dollar or to a commodity like Gold. Tether is the first stablecoin to be created and it is the most popular stablecoin used in the ecosystem.', logoURI: 'https://hecoinfo.com/token/images/USDTHECO_32.png', + bridge: 'multichain', }, USDT: { name: 'USDT', @@ -54,6 +57,8 @@ const _tokens = { description: 'Tether is a stablecoin pegged to the US Dollar. A stablecoin is a type of cryptocurrency whose value is pegged to another fiat currency like the US Dollar or to a commodity like Gold. Tether is the first stablecoin to be created and it is the most popular stablecoin used in the ecosystem.', logoURI: 'https://hecoinfo.com/token/images/USDTHECO_32.png', + bridge: 'native', + }, DAI: { name: 'Dai Stablecoin', @@ -67,6 +72,7 @@ const _tokens = { 'Multi-Collateral Dai, brings a lot of new and exciting features, such as support for new CDP collateral types and Dai Savings Rate.', logoURI: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png', + bridge: 'multichain', }, SUSHI: { name: 'Sushi', @@ -78,6 +84,7 @@ const _tokens = { description: 'Sushi is the home of DeFi. Their community is building a comprehensive, decentralized trading platform for the future of finance. Swap, earn, stack yields, lend, borrow, leverage all on one decentralized, community driven platform.', logoURI: 'https://app.sushi.com/static/media/logo.11fafaa5.png', + bridge: 'multichain', }, WBTC: { name: 'Wrapped BTC', @@ -90,6 +97,7 @@ const _tokens = { chainId: 2222, logoURI: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png', + bridge: 'multichain', }, ETH: { name: 'Ether', @@ -102,6 +110,7 @@ const _tokens = { 'The native currency that flows within the Ethereum economy is called Ether (ETH). Ether is typically used to pay for transaction fees called Gas, and it is the base currency of the network.', logoURI: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png', + bridge: 'multichain', }, axlUSDC: { name: 'Axelar USD Coin ', @@ -115,6 +124,7 @@ const _tokens = { description: 'USDC (Axelar) is a fully collateralized US dollar stablecoin. USDC is issued by regulated financial institutions, backed by fully reserved assets, redeemable on a 1:1 basis for US dollars.', documentation: 'https://docs.axelar.dev/', + bridge: 'axelar', }, axlUSDT: { name: 'USDT', @@ -128,6 +138,7 @@ const _tokens = { description: 'Tether (Axelar) is a stablecoin pegged to the US Dollar. A stablecoin is a type of cryptocurrency whose value is pegged to another fiat currency like the US Dollar or to a commodity like Gold. Tether is the first stablecoin to be created and it is the most popular stablecoin used in the ecosystem.', logoURI: 'https://hecoinfo.com/token/images/USDTHECO_32.png', + bridge: 'axelar', }, axlDAI: { name: 'Axelar Dai Stablecoin', @@ -141,6 +152,7 @@ const _tokens = { 'Multi-Collateral Dai (Axelar), brings a lot of new and exciting features, such as support for new CDP collateral types and Dai Savings Rate.', logoURI: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png', + bridge: 'axelar', }, VARA: { name: 'VARA', @@ -154,6 +166,7 @@ const _tokens = { 'Équilibre is an ve(3.3) AMM (Automatic Market Maker) based on Velodrome, and designed to provide large liquidity & low swapping fees.', logoURI: 'https://raw.githubusercontent.com/equilibre-finance/token-images/blob/main/assets/VARA.png', + bridge: 'native', }, BIFI: { name: 'Beefy.Finance', @@ -167,6 +180,7 @@ const _tokens = { logoURI: 'https://raw.githubusercontent.com/beefyfinance/beefy-app/prod/src/images/single-assets/BIFI.png', documentation: 'https://docs.beefy.finance/', + bridge: 'multichain', }, MAI: { name: 'Mai Stablecoin', @@ -190,18 +204,7 @@ const _tokens = { description: 'Binance Coin (BNB) is an exchange-based token created and issued by the cryptocurrency exchange Binance. Initially created on the Ethereum blockchain as an ERC-20 token in July 2017, BNB was migrated over to Binance Chain in February 2019 and became the native coin of the Binance Chain.', logoURI: '', - }, - USX: { - name: 'dForce USD', - symbol: 'USX', - address: '0xDb0E1e86B01c4ad25241b1843E407Efc4D615248', - chainId: 2222, - decimals: 18, - logoURI: '', - website: 'https://dforce.network/', - description: - 'USX is the most important DeFi primitive within dForce’s protocol matrix, starting off with an over-collateralization design, where supported assets can be used as collaterals to mint USX within the respective approved LTV ratio (similar to DAI).', - documentation: 'https://docs.dforce.network/protocols/usx', + bridge: 'multichain', }, axlATOM: { name: 'Axelar Wrapped ATOM', @@ -214,6 +217,7 @@ const _tokens = { description: 'The Internet of Blockchains. Cosmos is an ever-expanding ecosystem of interconnected apps and services, built for a decentralized future.', documentation: 'https://docs.axelar.dev/resources/wrapped-tokens', + bridge: 'axelar', }, MARE: { name: 'Mare Finance', @@ -226,6 +230,7 @@ const _tokens = { description: 'Mare Finance is an EVM compatible lending/borrowing protocol that launched on Kava EVM. Mare Finance provides peer-to-peer lending solutions that are fully decentralized, transparent and non-custodial.', documentation: 'https://docs.mare.finance/', + bridge: 'native', }, MIM: { name: 'Magic Internet Money', @@ -238,6 +243,7 @@ const _tokens = { 'You, the Spellcaster, can provide collateral in the form of various interest bearing crypto assets such as yvYFI, yvUSDT, yvUSDC, xSUSHI and more. With this, you can borrow magic internet money (MIM) which is a stable coin that you can swap for any other traditional stable coin.', logoURI: '', documentation: 'https://docs.abracadabra.money/', + bridge: 'layer-zero' }, axlETH: { name: 'Axelar Wrapped ETH', @@ -250,6 +256,7 @@ const _tokens = { description: 'Axelar Wrapped ETH (axlETH) is an ERC-20 token that represents a wrapped version of native Ethereum (ETH) cryptocurrency, allowing for cross-chain transfers and compatibility with the Ethereum ecosystem.', documentation: 'https://docs.axelar.dev/resources/wrapped-tokens', + bridge: 'axelar', }, axlWBTC: { name: 'Axelar Wrapped WBTC', @@ -262,6 +269,7 @@ const _tokens = { description: "Axelar Wrapped WBTC (axlWBTC) is an ERC-20 token that represents a 1:1 pegged version of Bitcoin, allowing users to access Bitcoin's value and liquidity within the Kava ecosystem.", documentation: 'https://docs.axelar.dev/resources/wrapped-tokens', + bridge: 'axelar', }, ATOM: { name: 'ATOM', From a20f7931fc67ef0ee73bd6acc50ae4419834b332 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Thu, 27 Jul 2023 08:19:38 +0000 Subject: [PATCH 21/51] ci: version bump to 0.43.41 --- packages/address-book/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/address-book/package.json b/packages/address-book/package.json index 66bf4b033..ec80ad660 100644 --- a/packages/address-book/package.json +++ b/packages/address-book/package.json @@ -1,6 +1,6 @@ { "name": "blockchain-addressbook", - "version": "0.43.40", + "version": "0.43.41", "description": "A collection of useful addresses on various chains for defi development", "main": "build/address-book/index.js", "types": "build/address-book/index.d.ts", From a0094fa79c9a811c4de3cdc4170c61b20f1fe9c6 Mon Sep 17 00:00:00 2001 From: schnarkus Date: Thu, 27 Jul 2023 12:48:24 +0200 Subject: [PATCH 22/51] add new velo pools --- .../address-book/optimism/tokens/tokens.ts | 40 ++++++++- src/data/optimism/velodromeLpPools.json | 84 ++++++++++++++++++- src/data/optimism/velodromeStableLpPools.json | 20 +++++ 3 files changed, 140 insertions(+), 4 deletions(-) diff --git a/packages/address-book/address-book/optimism/tokens/tokens.ts b/packages/address-book/address-book/optimism/tokens/tokens.ts index aeb5d958d..08183c291 100644 --- a/packages/address-book/address-book/optimism/tokens/tokens.ts +++ b/packages/address-book/address-book/optimism/tokens/tokens.ts @@ -833,9 +833,9 @@ const _tokens = { 'Kwenta is a decentralized derivatives trading platform, live on Optimism, offering real-world and on-chain synthetic assets using the power of the Synthetix protocol.', documentation: 'https://docs.kwenta.io/', }, - UNIDX: { + multiUNIDX: { name: 'UniDex', - symbol: 'UNIDX', + symbol: 'multiUNIDX', address: '0x5d47bAbA0d66083C52009271faF3F50DCc01023C', chainId: 10, decimals: 18, @@ -1003,6 +1003,42 @@ const _tokens = { "Velodrome Finance, at its core, is a solution for protocols on Optimism to properly incentivize liquidity for their own use cases. Building on top of the groundwork laid out by Solidly, our team has addressed that first iteration's core issues to realize its full potential.", documentation: 'https://velodrome.finance/docs', }, + tBTC: { + name: 'tBTC v2', + symbol: 'tBTC', + address: '0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40', + chainId: 10, + decimals: 18, + logoURI: '', + website: 'https://threshold.network/', + documentation: 'https://docs.threshold.network/', + description: + 'Threshold is the first ever on-chain merge between two existing networks and communities, Keep and NuCypher. Threshold provides a suite of threshold cryptography services that power user sovereignty on the blockchain.', + }, + UNIDX: { + name: 'Unidex', + symbol: 'UNIDX', + address: '0x28b42698Caf46B4B012CF38b6C75867E0762186D', + chainId: 10, + decimals: 18, + logoURI: '', + website: 'https://app.unidex.exchange/trading', + description: + 'UniDex is building on top of the existing landscape by introducing a perpetual leverage trading platform that will allow any synthetic asset to be traded in a permissionless, transparent, and trader-focused platform for any person to tap into.', + documentation: 'https://unidexexchange.gitbook.io/unidex/', + }, + WLD: { + name: 'Worldcoin', + symbol: 'WLD', + address: '0xdC6fF44d5d932Cbd77B52E5612Ba0529DC6226F1', + chainId: 10, + decimals: 18, + logoURI: '', + website: 'https://worldcoin.org/', + description: + 'WLD is a token that is part of the Worldcoin network. It is issued to all network participants to align their incentives around the growth of the network. The currency is designed to be distributed fairly, with every human being eligible for a share of WLD simply for being human. While laws may not allow for the use of WLD as a currency in some jurisdictions, it is intended to be used as a means of exchange and store of value where possible.', + documentation: 'https://whitepaper.worldcoin.org/', + }, } as const; export const tokens: ConstRecord = _tokens; diff --git a/src/data/optimism/velodromeLpPools.json b/src/data/optimism/velodromeLpPools.json index 2b29448db..b281648ee 100644 --- a/src/data/optimism/velodromeLpPools.json +++ b/src/data/optimism/velodromeLpPools.json @@ -1,4 +1,84 @@ [ + { + "name": "velodrome-v2-weth-wld", + "address": "0xe188C32a2aa8e65f9AB141f5E96F8FA96b1b7757", + "gauge": "0xb91F873D3fed53B21ac348Ee86DEaf924D1f3818", + "decimals": "1e18", + "chainId": 10, + "beefyFee": 0.095, + "lp0": { + "address": "0x4200000000000000000000000000000000000006", + "oracle": "tokens", + "oracleId": "WETH", + "decimals": "1e18" + }, + "lp1": { + "address": "0xdC6fF44d5d932Cbd77B52E5612Ba0529DC6226F1", + "oracle": "tokens", + "oracleId": "WLD", + "decimals": "1e18" + } + }, + { + "name": "velodrome-v2-weth-tbtc", + "address": "0xadBB23Bcc3C1B9810491897cb0690Cf645B858b1", + "gauge": "0x89Af7F95f8532F32eA82b43ABaDf41A50B57d907", + "decimals": "1e18", + "chainId": 10, + "beefyFee": 0.095, + "lp0": { + "address": "0x4200000000000000000000000000000000000006", + "oracle": "tokens", + "oracleId": "WETH", + "decimals": "1e18" + }, + "lp1": { + "address": "0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40", + "oracle": "tokens", + "oracleId": "tBTC", + "decimals": "1e18" + } + }, + { + "name": "velodrome-v2-unidx-weth-v2", + "address": "0x9269F5199B01B7B7Dd38321B85c3F34EE3f28F7F", + "gauge": "0x31D553E63a92D5dc89FcE8c2e753ba422fAA2b93", + "decimals": "1e18", + "chainId": 10, + "beefyFee": 0.095, + "lp0": { + "address": "0x28b42698Caf46B4B012CF38b6C75867E0762186D", + "oracle": "tokens", + "oracleId": "UNIDX", + "decimals": "1e18" + }, + "lp1": { + "address": "0x4200000000000000000000000000000000000006", + "oracle": "tokens", + "oracleId": "WETH", + "decimals": "1e18" + } + }, + { + "name": "velodrome-v2-unidx-dai-v2", + "address": "0xFc233aD094C8c9C245BDEA891DfEe2d7F9e632c4", + "gauge": "0xCC141AABB6C05b025118eDec0dbcD34F2193425b", + "decimals": "1e18", + "chainId": 10, + "beefyFee": 0.095, + "lp0": { + "address": "0x28b42698Caf46B4B012CF38b6C75867E0762186D", + "oracle": "tokens", + "oracleId": "UNIDX", + "decimals": "1e18" + }, + "lp1": { + "address": "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1", + "oracle": "tokens", + "oracleId": "DAI", + "decimals": "1e18" + } + }, { "name": "velodrome-v2-exa-weth", "address": "0xf3C45b45223Df6071a478851B9C17e0630fDf535", @@ -129,7 +209,7 @@ "lp0": { "address": "0x5d47bAbA0d66083C52009271faF3F50DCc01023C", "oracle": "tokens", - "oracleId": "UNIDX", + "oracleId": "multiUNIDX", "decimals": "1e18" }, "lp1": { @@ -275,7 +355,7 @@ "lp1": { "address": "0x5d47bAbA0d66083C52009271faF3F50DCc01023C", "oracle": "tokens", - "oracleId": "UNIDX", + "oracleId": "multiUNIDX", "decimals": "1e18" } }, diff --git a/src/data/optimism/velodromeStableLpPools.json b/src/data/optimism/velodromeStableLpPools.json index 828d15712..9e7f159c8 100644 --- a/src/data/optimism/velodromeStableLpPools.json +++ b/src/data/optimism/velodromeStableLpPools.json @@ -1,4 +1,24 @@ [ + { + "name": "velodrome-v2-wbtc-tbtc", + "address": "0x6e57B9E54ea043a829584B22182ad22bF446926C", + "gauge": "0x236593E0139A542afEd346F5D8De7F52034Ef9Ab", + "decimals": "1e18", + "chainId": 10, + "beefyFee": 0.095, + "lp0": { + "address": "0x68f180fcCe6836688e9084f035309E29Bf0A2095", + "oracle": "tokens", + "oracleId": "WBTC", + "decimals": "1e8" + }, + "lp1": { + "address": "0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40", + "oracle": "tokens", + "oracleId": "tBTC", + "decimals": "1e18" + } + }, { "name": "velodrome-v2-lusd-mai", "address": "0x537cB4D4fE1a9dF1E295872f2B82c1da9df7500f", From a3b8d21eb2e98098cfeb6d5e2bfe26517050d7a4 Mon Sep 17 00:00:00 2001 From: schnarkus Date: Thu, 27 Jul 2023 12:53:29 +0200 Subject: [PATCH 23/51] change old unidx oracleId --- src/data/optimism/oldVelodromeLpPools.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/optimism/oldVelodromeLpPools.json b/src/data/optimism/oldVelodromeLpPools.json index a86b47b4d..1d5eb1bd5 100644 --- a/src/data/optimism/oldVelodromeLpPools.json +++ b/src/data/optimism/oldVelodromeLpPools.json @@ -135,7 +135,7 @@ "lp1": { "address": "0x5d47bAbA0d66083C52009271faF3F50DCc01023C", "oracle": "tokens", - "oracleId": "UNIDX", + "oracleId": "multiUNIDX", "decimals": "1e18" } }, @@ -369,7 +369,7 @@ "lp0": { "address": "0x5d47bAbA0d66083C52009271faF3F50DCc01023C", "oracle": "tokens", - "oracleId": "UNIDX", + "oracleId": "multiUNIDX", "decimals": "1e18" }, "lp1": { From 93719c9f14750ddaf2e81129628a058089ebba90 Mon Sep 17 00:00:00 2001 From: tilty Date: Thu, 27 Jul 2023 21:13:31 +0200 Subject: [PATCH 24/51] Added route /vaults/last-harvest, endpoint logic --- src/api/vaults/index.js | 17 +++++++++++++++++ src/router.js | 1 + 2 files changed, 18 insertions(+) diff --git a/src/api/vaults/index.js b/src/api/vaults/index.js index 4c0afa394..c804c6880 100644 --- a/src/api/vaults/index.js +++ b/src/api/vaults/index.js @@ -12,6 +12,21 @@ async function multichainVaults(ctx) { } } +async function vaultsLastHarvest(ctx) { + try { + const lastHarvests = getMultichainVaults().reduce((res, vault) => { + const { id, lastHarvest } = vault; + res[id] = lastHarvest; + return res; + }, {}); + ctx.status = 200; + ctx.body = lastHarvests; + } catch (err) { + console.error(err); + ctx.status = 500; + } +} + async function singleChainVaults(ctx) { try { const chainVaults = getSingleChainVaults(ctx.params.chainId); @@ -36,6 +51,8 @@ async function vaultFees(ctx) { module.exports = { multichainVaults, + vaultsLastHarvest, singleChainVaults, vaultFees, + vaultsLastHarvest, }; diff --git a/src/router.js b/src/router.js index 61db34b86..479323c3c 100644 --- a/src/router.js +++ b/src/router.js @@ -48,6 +48,7 @@ router.get('/mootokenprices', price.mooTokenPrices); router.get('/vaults', multichainVaults.multichainVaults); router.get('/vaults/zap-support', vaultZapSupport); router.get('/vaults/zap-support/debug', vaultZapSupportDebug); +router.get('/vaults/last-harvest', multichainVaults.vaultsLastHarvest); router.get('/vaults/:chainId', multichainVaults.singleChainVaults); router.get('/oneinch/:chainId/swap', proxyOneInchSwap); From dc24d1689644bd280024b6eb34b956f174617dc2 Mon Sep 17 00:00:00 2001 From: tilty Date: Thu, 27 Jul 2023 21:15:42 +0200 Subject: [PATCH 25/51] Who knows man --- src/api/vaults/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/api/vaults/index.js b/src/api/vaults/index.js index c804c6880..51fb09b93 100644 --- a/src/api/vaults/index.js +++ b/src/api/vaults/index.js @@ -51,7 +51,6 @@ async function vaultFees(ctx) { module.exports = { multichainVaults, - vaultsLastHarvest, singleChainVaults, vaultFees, vaultsLastHarvest, From 7d773377a4ecd033d3e155a978f9d62e35a17c00 Mon Sep 17 00:00:00 2001 From: kexley <87971154+kexleyBeefy@users.noreply.github.com> Date: Fri, 28 Jul 2023 19:29:38 +0100 Subject: [PATCH 26/51] Add EXA to ab --- .../address-book/optimism/tokens/tokens.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/address-book/address-book/optimism/tokens/tokens.ts b/packages/address-book/address-book/optimism/tokens/tokens.ts index aeb5d958d..4267df9bb 100644 --- a/packages/address-book/address-book/optimism/tokens/tokens.ts +++ b/packages/address-book/address-book/optimism/tokens/tokens.ts @@ -1003,6 +1003,18 @@ const _tokens = { "Velodrome Finance, at its core, is a solution for protocols on Optimism to properly incentivize liquidity for their own use cases. Building on top of the groundwork laid out by Solidly, our team has addressed that first iteration's core issues to realize its full potential.", documentation: 'https://velodrome.finance/docs', }, + EXA: { + name: 'Exactly', + symbol: 'EXA', + address: '0x1e925De1c68ef83bD98eE3E130eF14a50309C01B', + chainId: 10, + decimals: 18, + logoURI: '', + website: 'https://exact.ly/', + description: + "Exactly is a decentralized, non-custodial and open-source protocol that provides an autonomous fixed and variable interest rate market enabling users to frictionlessly exchange the time value of their assets and completing the DeFi credit market.", + documentation: 'https://docs.exact.ly/', + }, } as const; export const tokens: ConstRecord = _tokens; From 05344f09905ae1901897d0d10e0332e2d35e2367 Mon Sep 17 00:00:00 2001 From: chebiN <17909998+seguido@users.noreply.github.com> Date: Fri, 28 Jul 2023 16:30:32 -0300 Subject: [PATCH 27/51] treasury migration to viem + conc liquidity support --- src/abis/common/Multicall/MulticallAbi.json | 440 ------------------- src/abis/common/Multicall/MulticallAbi.ts | 442 ++++++++++++++++++++ src/api/stats/getAmmPrices.ts | 2 +- src/api/treasury/getTreasury.ts | 112 ++--- src/api/treasury/multicallUtils.ts | 209 +++++---- src/api/treasury/nftAssets.ts | 30 ++ 6 files changed, 602 insertions(+), 633 deletions(-) delete mode 100644 src/abis/common/Multicall/MulticallAbi.json create mode 100644 src/abis/common/Multicall/MulticallAbi.ts create mode 100644 src/api/treasury/nftAssets.ts diff --git a/src/abis/common/Multicall/MulticallAbi.json b/src/abis/common/Multicall/MulticallAbi.json deleted file mode 100644 index bc6b33070..000000000 --- a/src/abis/common/Multicall/MulticallAbi.json +++ /dev/null @@ -1,440 +0,0 @@ -[ - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Call[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "aggregate", - "outputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - }, - { - "internalType": "bytes[]", - "name": "returnData", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bool", - "name": "allowFailure", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Call3[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "aggregate3", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Result[]", - "name": "returnData", - "type": "tuple[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bool", - "name": "allowFailure", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Call3Value[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "aggregate3Value", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Result[]", - "name": "returnData", - "type": "tuple[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Call[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "blockAndAggregate", - "outputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "blockHash", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Result[]", - "name": "returnData", - "type": "tuple[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "getBasefee", - "outputs": [ - { - "internalType": "uint256", - "name": "basefee", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - } - ], - "name": "getBlockHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "blockHash", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getBlockNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getChainId", - "outputs": [ - { - "internalType": "uint256", - "name": "chainid", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCurrentBlockCoinbase", - "outputs": [ - { - "internalType": "address", - "name": "coinbase", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCurrentBlockDifficulty", - "outputs": [ - { - "internalType": "uint256", - "name": "difficulty", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCurrentBlockGasLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "gaslimit", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCurrentBlockTimestamp", - "outputs": [ - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "getEthBalance", - "outputs": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getLastBlockHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "blockHash", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "requireSuccess", - "type": "bool" - }, - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Call[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "tryAggregate", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Result[]", - "name": "returnData", - "type": "tuple[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "requireSuccess", - "type": "bool" - }, - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Call[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "tryBlockAndAggregate", - "outputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "blockHash", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "internalType": "struct Multicall3.Result[]", - "name": "returnData", - "type": "tuple[]" - } - ], - "stateMutability": "payable", - "type": "function" - } -] diff --git a/src/abis/common/Multicall/MulticallAbi.ts b/src/abis/common/Multicall/MulticallAbi.ts new file mode 100644 index 000000000..111071844 --- /dev/null +++ b/src/abis/common/Multicall/MulticallAbi.ts @@ -0,0 +1,442 @@ +const MulticallAbi = [ + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'target', + type: 'address', + }, + { + internalType: 'bytes', + name: 'callData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Call[]', + name: 'calls', + type: 'tuple[]', + }, + ], + name: 'aggregate', + outputs: [ + { + internalType: 'uint256', + name: 'blockNumber', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'returnData', + type: 'bytes[]', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'target', + type: 'address', + }, + { + internalType: 'bool', + name: 'allowFailure', + type: 'bool', + }, + { + internalType: 'bytes', + name: 'callData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Call3[]', + name: 'calls', + type: 'tuple[]', + }, + ], + name: 'aggregate3', + outputs: [ + { + components: [ + { + internalType: 'bool', + name: 'success', + type: 'bool', + }, + { + internalType: 'bytes', + name: 'returnData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Result[]', + name: 'returnData', + type: 'tuple[]', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'target', + type: 'address', + }, + { + internalType: 'bool', + name: 'allowFailure', + type: 'bool', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'callData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Call3Value[]', + name: 'calls', + type: 'tuple[]', + }, + ], + name: 'aggregate3Value', + outputs: [ + { + components: [ + { + internalType: 'bool', + name: 'success', + type: 'bool', + }, + { + internalType: 'bytes', + name: 'returnData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Result[]', + name: 'returnData', + type: 'tuple[]', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'target', + type: 'address', + }, + { + internalType: 'bytes', + name: 'callData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Call[]', + name: 'calls', + type: 'tuple[]', + }, + ], + name: 'blockAndAggregate', + outputs: [ + { + internalType: 'uint256', + name: 'blockNumber', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'blockHash', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bool', + name: 'success', + type: 'bool', + }, + { + internalType: 'bytes', + name: 'returnData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Result[]', + name: 'returnData', + type: 'tuple[]', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'getBasefee', + outputs: [ + { + internalType: 'uint256', + name: 'basefee', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'blockNumber', + type: 'uint256', + }, + ], + name: 'getBlockHash', + outputs: [ + { + internalType: 'bytes32', + name: 'blockHash', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getBlockNumber', + outputs: [ + { + internalType: 'uint256', + name: 'blockNumber', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getChainId', + outputs: [ + { + internalType: 'uint256', + name: 'chainid', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getCurrentBlockCoinbase', + outputs: [ + { + internalType: 'address', + name: 'coinbase', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getCurrentBlockDifficulty', + outputs: [ + { + internalType: 'uint256', + name: 'difficulty', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getCurrentBlockGasLimit', + outputs: [ + { + internalType: 'uint256', + name: 'gaslimit', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getCurrentBlockTimestamp', + outputs: [ + { + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'addr', + type: 'address', + }, + ], + name: 'getEthBalance', + outputs: [ + { + internalType: 'uint256', + name: 'balance', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getLastBlockHash', + outputs: [ + { + internalType: 'bytes32', + name: 'blockHash', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: 'requireSuccess', + type: 'bool', + }, + { + components: [ + { + internalType: 'address', + name: 'target', + type: 'address', + }, + { + internalType: 'bytes', + name: 'callData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Call[]', + name: 'calls', + type: 'tuple[]', + }, + ], + name: 'tryAggregate', + outputs: [ + { + components: [ + { + internalType: 'bool', + name: 'success', + type: 'bool', + }, + { + internalType: 'bytes', + name: 'returnData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Result[]', + name: 'returnData', + type: 'tuple[]', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: 'requireSuccess', + type: 'bool', + }, + { + components: [ + { + internalType: 'address', + name: 'target', + type: 'address', + }, + { + internalType: 'bytes', + name: 'callData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Call[]', + name: 'calls', + type: 'tuple[]', + }, + ], + name: 'tryBlockAndAggregate', + outputs: [ + { + internalType: 'uint256', + name: 'blockNumber', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'blockHash', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bool', + name: 'success', + type: 'bool', + }, + { + internalType: 'bytes', + name: 'returnData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Result[]', + name: 'returnData', + type: 'tuple[]', + }, + ], + stateMutability: 'payable', + type: 'function', + }, +] as const; + +export default MulticallAbi; diff --git a/src/api/stats/getAmmPrices.ts b/src/api/stats/getAmmPrices.ts index beb2a6742..fa40deb5b 100644 --- a/src/api/stats/getAmmPrices.ts +++ b/src/api/stats/getAmmPrices.ts @@ -618,7 +618,7 @@ const seedPeggedPrices = { aWETH: 'ETH', // Aave }; -type LpBreakdown = { +export type LpBreakdown = { price: number; tokens: string[]; balances: string[]; diff --git a/src/api/treasury/getTreasury.ts b/src/api/treasury/getTreasury.ts index af288bfcd..adb99ea8b 100644 --- a/src/api/treasury/getTreasury.ts +++ b/src/api/treasury/getTreasury.ts @@ -1,45 +1,30 @@ import BigNumber from 'bignumber.js'; -import { ContractCallContext, ContractCallResults, Multicall } from 'ethereum-multicall'; -import { chunk, keyBy, partition } from 'lodash'; +import { keyBy } from 'lodash'; import { addressBook } from '../../../packages/address-book/address-book'; import chainIdMap from '../../../packages/address-book/util/chainIdMap'; import { getKey, setKey } from '../../utils/cache'; -import { web3Factory } from '../../utils/web3'; import { getSingleChainVaults } from '../stats/getMultichainVaults'; +import { extractBalancesFromTreasuryCallResults, mapAssetToCall } from './multicallUtils'; import { - extractBalancesFromTreasuryApiCallResults, - extractBalancesFromTreasuryMulticallResults, - fetchAPIBalance, - mapAssetToCall, -} from './multicallUtils'; -import { - isValidatorAsset, isVaultAsset, - TreasuryApiResult, TreasuryAsset, TreasuryAssetRegistry, TreasuryBalances, TreasuryReport, TreasuryWalletRegistry, - ValidatorAsset, } from './types'; import { getChainValidator, hasChainValidator } from './validatorHelpers'; import { serviceEventBus } from '../../utils/ServiceEventBus'; -import { ApiChain, ApiChains, toChainId } from '../../utils/chain'; +import { ApiChain, ApiChains } from '../../utils/chain'; import { getTokensForChain, isTokenNative } from '../tokens/tokens'; -import { MULTICALL_V3 } from '../../utils/web3Helpers'; import { getAmmPrice } from '../stats/getAmmPrices'; import { keysToObject } from '../../utils/array'; +import { + getChainConcentratedLiquidityAssets, + hasChainConcentratedLiquidityAssets, +} from './nftAssets'; const REFRESH_INTERVAL = 60000 * 10; -const MULTICALL_BATCH_SIZES: Partial> = { - fantom: 512, - polygon: 256, -}; - -const batchSizeForChain = (chain: ApiChain) => { - return MULTICALL_BATCH_SIZES[chain] ?? 1024; -}; const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; // treasury addresses that should be queried for balances @@ -121,6 +106,12 @@ function getTokenAddressesByChain(): TreasuryAssetRegistry { tokens['validator'] = getChainValidator(chain); } + if (hasChainConcentratedLiquidityAssets(chain)) { + getChainConcentratedLiquidityAssets(chain).forEach(asset => { + tokens[asset.address.toLowerCase()] = asset; + }); + } + return tokens; }); } @@ -146,80 +137,41 @@ function getVaultAddressesByChain(): TreasuryAssetRegistry { async function updateSingleChainTreasuryBalance(chain: ApiChain) { const assetsToCheck = Object.values(assetsByChain[chain]); - const web3 = web3Factory(chainIdMap[chain]); const treasuryAddressesForChain = Object.values(treasuryAddressesByChain[chain]); - const multicallAddress = MULTICALL_V3[toChainId(chain)]; - if (!multicallAddress) { - throw new Error(`Multicallv3 address not found for chain ${chain}`); - } - const multicall = new Multicall({ - web3Instance: web3, - tryAggregate: true, - multicallCustomContractAddress: multicallAddress, - }); - // ETH validator requires an api call, should be treated differently - const [validatorAsset, contractAssets] = partition( - assetsToCheck, - asset => isValidatorAsset(asset) && asset.method === 'api' + const assetCalls = assetsToCheck.map(asset => + Promise.all(mapAssetToCall(asset, treasuryAddressesForChain, chainIdMap[chain])) ); - const contractCallContext: ContractCallContext[] = contractAssets.flatMap( - (asset: TreasuryAsset) => mapAssetToCall(asset, treasuryAddressesForChain, multicallAddress) - ); - - const contractPromises: Promise[] = chunk( - contractCallContext, - batchSizeForChain(chain) - ).map(batch => multicall.call(batch)); - - const apiPromises = validatorAsset.map(asset => fetchAPIBalance(asset as ValidatorAsset)); - try { - const results = await Promise.allSettled([...contractPromises, ...apiPromises]); - const hasOneFailedCall = results.some(res => res.status === 'rejected'); - - const contractResults = await Promise.allSettled(contractPromises); - const apiResults = await Promise.allSettled(apiPromises); - + const callResults = await Promise.allSettled(assetCalls); + const hasOneFailedCall = callResults.some(res => res.status === 'rejected'); + const failedCalls = callResults.filter(res => res.status === 'rejected').length; + if (hasOneFailedCall) { + console.log( + `> treasury update had at least one failed call on ${chain} ${( + (failedCalls / callResults.length) * + 100 + ).toFixed(2)}% error rate` + ); + } const balancesForChain = {}; treasuryAddressesForChain.forEach((treasuryData: any) => { balancesForChain[treasuryData.address.toLowerCase()] = {}; }); - const fulfilledContractResults = Object.fromEntries( - contractResults - .filter(res => res.status === 'fulfilled') - .flatMap((res: PromiseFulfilledResult) => - Object.entries(res.value.results) - ) - ); - - if (Object.keys(fulfilledContractResults).length !== contractCallContext.length) { - console.log('> Multicall batch failed fetching balances for treasury on ' + chain); - console.log( - contractResults - .filter(res => res.status === 'rejected') - .map((p: PromiseRejectedResult) => p.reason) - ); - } - - const fulfilledApiResults = apiResults - .filter(res => res.status === 'fulfilled') - .flatMap((res: PromiseFulfilledResult) => res.value); - - if (Object.keys(fulfilledApiResults).length !== apiPromises.length) { - console.log('> Api call failed fetching balances for treasury on ' + chain); - } - //If we have at least one failed call, we keep the previous cache, if not we purge outdated values tokenBalancesByChain[chain] = { ...(tokenBalancesByChain[chain] && hasOneFailedCall ? tokenBalancesByChain[chain] : {}), - ...extractBalancesFromTreasuryMulticallResults(fulfilledContractResults), - ...extractBalancesFromTreasuryApiCallResults(fulfilledApiResults), + ...extractBalancesFromTreasuryCallResults( + assetsToCheck, + treasuryAddressesForChain.map(t => t.address), + callResults + ), }; } catch (err) { console.log('error updating treasury balances on chain ' + chain); + console.log(err.message); } } diff --git a/src/api/treasury/multicallUtils.ts b/src/api/treasury/multicallUtils.ts index 776e94381..e449d6438 100644 --- a/src/api/treasury/multicallUtils.ts +++ b/src/api/treasury/multicallUtils.ts @@ -1,7 +1,4 @@ import BigNumber from 'bignumber.js'; -import { ContractCallContext, ContractCallReturnContext } from 'ethereum-multicall'; -import { ERC20_ABI } from '../../abis/common/ERC20'; -import multicallAbi from '../../abis/common/Multicall/MulticallAbi.json'; import { isNativeAsset, isTokenAsset, @@ -13,125 +10,58 @@ import { ValidatorAsset, TreasuryApiResult, isConcLiquidityAsset, + isValidatorAsset, } from './types'; -import { getLpBreakdownForOracle } from '../stats/getAmmPrices'; +import { LpBreakdown, getLpBreakdownForOracle } from '../stats/getAmmPrices'; +import { fetchContract } from '../rpc/client'; +import ERC20Abi from '../../abis/ERC20Abi'; +import { MULTICALL_V3 } from '../../utils/web3Helpers'; +import MulticallAbi from '../../abis/common/Multicall/MulticallAbi'; + +const validatorContractAbi = [ + { + constant: true, + inputs: [], + name: 'balance', + outputs: [ + { + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] as const; export const mapAssetToCall = ( asset: TreasuryAsset, treasuryAddressesForChain: TreasuryWallet[], - multicallContractAddress: string -): ContractCallContext[] => { + chainId: number +) => { if (isTokenAsset(asset) || isVaultAsset(asset)) { - return [ - { - reference: asset.address.toLowerCase(), - contractAddress: asset.address, - abi: ERC20_ABI, - calls: treasuryAddressesForChain.map(treasuryData => ({ - reference: treasuryData.address.toLowerCase(), - methodName: 'balanceOf', - methodParameters: [treasuryData.address], - })), - context: { - type: 'standard', - }, - }, - ]; + const contract = fetchContract(asset.address, ERC20Abi, chainId); + return treasuryAddressesForChain.map(treasuryData => + contract.read.balanceOf([treasuryData.address as `0x${string}`]) + ); } else if (isNativeAsset(asset)) { - return [ - { - reference: asset.address.toLowerCase(), - contractAddress: multicallContractAddress, - abi: multicallAbi, - calls: treasuryAddressesForChain.map(treasuryData => ({ - reference: treasuryData.address.toLowerCase(), - methodName: 'getEthBalance', - methodParameters: [treasuryData.address], - })), - context: { - type: 'standard', - }, - }, - ]; - } else { - const validatorAsset = asset as ValidatorAsset; - return [ - { - reference: 'validator', - contractAddress: validatorAsset.methodPath, - abi: [ - { - constant: true, - inputs: [], - name: 'balance', - outputs: [ - { - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - ], - calls: [ - { - reference: 'validator', - methodName: 'balance', - methodParameters: [], - }, - ], - context: { - type: 'validator', - }, - }, - ]; + const multicallContract = fetchContract(MULTICALL_V3[chainId], MulticallAbi, chainId); + return treasuryAddressesForChain.map(treasuryData => + multicallContract.read.getEthBalance([treasuryData.address as `0x${string}`]) + ); + } else if (isConcLiquidityAsset(asset)) { + return [getLpBreakdownForOracle(asset.oracleId)]; + } else if (isValidatorAsset(asset)) { + if (asset.method === 'contract') { + const contract = fetchContract(asset.methodPath, validatorContractAbi, chainId); + return [contract.read.balance()]; + } else { + return [fetchAPIBalance(asset as ValidatorAsset)]; + } } }; -type FullfilledResult = { - [id: string]: ContractCallReturnContext; -}; - -export const extractBalancesFromTreasuryMulticallResults = ( - multicallResults: FullfilledResult -): ChainTreasuryBalance => { - const balances: AssetBalance[] = extractFromStandardResult(Object.entries(multicallResults)); - return balances.reduce((all, cur) => ((all[cur.address] = cur), all), {}); -}; - -const extractFromStandardResult = ( - standardResults: [string, ContractCallReturnContext][] -): AssetBalance[] => { - return standardResults.map(([address, returnContext]) => { - const treasuryBalance: AssetBalance = { - address, - balances: {}, - }; - returnContext.callsReturnContext.forEach(callReturn => { - if (callReturn.decoded) { - treasuryBalance.balances[callReturn.reference] = new BigNumber( - callReturn.returnValues[0].hex - ); - } - }); - return treasuryBalance; - }); -}; - -export const extractBalancesFromTreasuryApiCallResults = ( - apiCallResults: TreasuryApiResult[] -): ChainTreasuryBalance => { - const balances: AssetBalance[] = apiCallResults.map(result => ({ - address: result.apiAsset.address, - balances: { - [result.apiAsset.address]: result.balance, - }, - })); - return balances.reduce((all, cur) => ((all[cur.address] = cur), all), {}); -}; - export const fetchAPIBalance = async (apiAsset: ValidatorAsset): Promise => { let balance: number = await fetch(apiAsset.methodPath) .then(res => res.json()) @@ -141,3 +71,58 @@ export const fetchAPIBalance = async (apiAsset: ValidatorAsset): Promise[] +): ChainTreasuryBalance => { + const allBalances: AssetBalance[] = []; + apiAssets.forEach((asset, i) => { + if (callResults[i].status === 'fulfilled') { + const callResult = callResults[i] as PromiseFulfilledResult< + bigint[] | LpBreakdown[] | TreasuryApiResult[] + >; + if (isTokenAsset(asset) || isVaultAsset(asset) || isNativeAsset(asset)) { + const value = callResult.value as bigint[]; + const bal = { + address: asset.address.toLowerCase(), + balances: {}, + }; + treasuryAddresses.forEach((treasuryAddress, j) => { + bal.balances[treasuryAddress.toLowerCase()] = new BigNumber(value[j].toString()); + }); + allBalances.push(bal); + } else if (isValidatorAsset(asset)) { + if (asset.method === 'contract') { + const value = callResult.value as bigint[]; + allBalances.push({ + address: asset.address.toLowerCase(), + balances: { + [asset.address.toLowerCase()]: new BigNumber(value[0].toString()), + }, + }); + } else { + const value = callResult.value as TreasuryApiResult[]; + allBalances.push({ + address: asset.address.toLowerCase(), + balances: { + [asset.address.toLowerCase()]: value[0].balance, + }, + }); + } + } else if (isConcLiquidityAsset(asset)) { + const value = callResult.value as LpBreakdown[]; + allBalances.push({ + address: asset.address.toLowerCase(), + balances: { + [treasuryAddresses[0].toLowerCase()]: new BigNumber(value[0].totalSupply).shiftedBy(18), + }, + }); + } else { + console.warn('Unknown treasury asset type:', asset); + } + } + }); + return allBalances.reduce((all, cur) => ((all[cur.address] = cur), all), {}); +}; diff --git a/src/api/treasury/nftAssets.ts b/src/api/treasury/nftAssets.ts new file mode 100644 index 000000000..c121f25a2 --- /dev/null +++ b/src/api/treasury/nftAssets.ts @@ -0,0 +1,30 @@ +import { ApiChain } from '../../utils/chain'; +import { ConcLiquidityAsset } from './types'; + +export const treasuryConcLiquidityAssets: Partial> = { + arbitrum: [ + { + name: 'USDC-USDC.e V3', + address: '0x8e295789c9465487074a65b1ae9Ce0351172393f', + decimals: 18, + assetType: 'concLiquidity', + oracleType: 'lps', + oracleId: 'uniswap-arbitrum-usdc-usdce-0.01', + id: 663650, + }, + { + name: 'CVX-ETH V3', + address: '0xb36c6868Ba826eD6f9487F6b0DA3abA37c2f51b9', + decimals: 18, + assetType: 'concLiquidity', + oracleType: 'lps', + oracleId: 'uniswap-arbitrum-cvx-eth-0.3', + id: 42161, + }, + ], +}; + +export const hasChainConcentratedLiquidityAssets = (chain: ApiChain) => + !!treasuryConcLiquidityAssets[chain]; +export const getChainConcentratedLiquidityAssets = (chain: ApiChain) => + treasuryConcLiquidityAssets[chain]; From ef15d92574a735c30be64a41af5e3c8ea17d9912 Mon Sep 17 00:00:00 2001 From: kexley <87971154+kexleyBeefy@users.noreply.github.com> Date: Sun, 30 Jul 2023 23:30:03 +0100 Subject: [PATCH 28/51] Remove Curve alETH from API (#1188) --- src/data/ethereum/convexPools.json | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/data/ethereum/convexPools.json b/src/data/ethereum/convexPools.json index b539fd4a8..b95c1474d 100644 --- a/src/data/ethereum/convexPools.json +++ b/src/data/ethereum/convexPools.json @@ -900,24 +900,6 @@ } ] }, - { - "name": "convex-aleth", - "pool": "0xC4C319E2D4d66CcA4464C0c2B32c9Bd23ebe784e", - "token": "0xC4C319E2D4d66CcA4464C0c2B32c9Bd23ebe784e", - "rewardPool": "0x48Bc302d8295FeA1f8c3e7F57D4dDC9981FEE410", - "tokens": [ - { - "oracle": "tokens", - "oracleId": "WETH", - "decimals": "1e18" - }, - { - "oracle": "tokens", - "oracleId": "alETH", - "decimals": "1e18" - } - ] - }, { "name": "convex-apeusdfraxbp", "pool": "0x04b727C7e246CA70d496ecF52E6b6280f3c8077D", From 3dc98ca625259c9fcf1d6d6413c835a8b02d9813 Mon Sep 17 00:00:00 2001 From: MirthFutures Date: Sun, 30 Jul 2023 19:16:22 -0400 Subject: [PATCH 29/51] Return 0 for convex alETH --- .../stats/common/curve/getCurvePricesCommon.js | 3 ++- src/data/ethereum/convexPools.json | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/api/stats/common/curve/getCurvePricesCommon.js b/src/api/stats/common/curve/getCurvePricesCommon.js index abf10a5aa..4342a9ffa 100644 --- a/src/api/stats/common/curve/getCurvePricesCommon.js +++ b/src/api/stats/common/curve/getCurvePricesCommon.js @@ -67,8 +67,9 @@ const getCurvePricesCommon = async (chainId, pools, tokenPrices) => { const usdBalance = t.balance.times(price).div(t.token.decimals); totalBalInUsd = totalBalInUsd.plus(usdBalance); } - const price = totalBalInUsd.div(totalSupply).toNumber(); + let price = totalBalInUsd.div(totalSupply).toNumber(); + if (pool.name == 'convex-aleth') price = 0; prices[pool.name] = { price, tokens: tokens.map(t => t.address), diff --git a/src/data/ethereum/convexPools.json b/src/data/ethereum/convexPools.json index b95c1474d..a682e87d7 100644 --- a/src/data/ethereum/convexPools.json +++ b/src/data/ethereum/convexPools.json @@ -1,4 +1,22 @@ [ + { + "name": "convex-aleth", + "pool": "0xC4C319E2D4d66CcA4464C0c2B32c9Bd23ebe784e", + "token": "0xC4C319E2D4d66CcA4464C0c2B32c9Bd23ebe784e", + "rewardPool": "0x48Bc302d8295FeA1f8c3e7F57D4dDC9981FEE410", + "tokens": [ + { + "oracle": "tokens", + "oracleId": "WETH", + "decimals": "1e18" + }, + { + "oracle": "tokens", + "oracleId": "alETH", + "decimals": "1e18" + } + ] + }, { "name": "curve-lvusd", "pool": "0xe9123CBC5d1EA65301D417193c40A72Ac8D53501", From 8eec79db8b40b3e2c051c14e87b14adbf34e46cb Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Mon, 31 Jul 2023 06:26:00 +0000 Subject: [PATCH 30/51] ci: version bump to 0.43.42 --- packages/address-book/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/address-book/package.json b/packages/address-book/package.json index ec80ad660..d6e385fb8 100644 --- a/packages/address-book/package.json +++ b/packages/address-book/package.json @@ -1,6 +1,6 @@ { "name": "blockchain-addressbook", - "version": "0.43.41", + "version": "0.43.42", "description": "A collection of useful addresses on various chains for defi development", "main": "build/address-book/index.js", "types": "build/address-book/index.d.ts", From f341dc7eeadf24a753c1eb6c54e4705e22205984 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Mon, 31 Jul 2023 06:32:06 +0000 Subject: [PATCH 31/51] ci: version bump to 0.43.43 --- packages/address-book/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/address-book/package.json b/packages/address-book/package.json index d6e385fb8..4b19f075f 100644 --- a/packages/address-book/package.json +++ b/packages/address-book/package.json @@ -1,6 +1,6 @@ { "name": "blockchain-addressbook", - "version": "0.43.42", + "version": "0.43.43", "description": "A collection of useful addresses on various chains for defi development", "main": "build/address-book/index.js", "types": "build/address-book/index.d.ts", From 7d4819c1a34b7ea4cbccda6c8dc2029d8ef76658 Mon Sep 17 00:00:00 2001 From: RM Date: Mon, 31 Jul 2023 14:23:33 +0700 Subject: [PATCH 32/51] Add curve kava mim-usdt new --- src/data/kava/curvePools.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/data/kava/curvePools.json b/src/data/kava/curvePools.json index f5ec16bcb..b31fcc2a8 100644 --- a/src/data/kava/curvePools.json +++ b/src/data/kava/curvePools.json @@ -1,4 +1,28 @@ [ + { + "name": "curve-kava-mimusdt-new", + "pool": "0x591199E16E006Dec3eDcf79AE0fCea1Dd0F5b69D", + "token": "0x591199E16E006Dec3eDcf79AE0fCea1Dd0F5b69D", + "gauge": "0xdC398735150d538B2F18Ccd13A55F6a54488a677", + "rewards": [ + { + "token": "0xc86c7C0eFbd6A49B35E8714C5f59D99De09A225b", + "oracleId": "KAVA" + } + ], + "tokens": [ + { + "oracle": "tokens", + "oracleId": "MIM", + "decimals": "1e18" + }, + { + "oracle": "tokens", + "oracleId": "USDT", + "decimals": "1e6" + } + ] + }, { "name": "curve-kava-mimusdt", "pool": "0xCf5f5ddE4D1D866b11b4cA2ba3Ff146Ec0fe3743", From 565df3c5ec461170de07e3dcbef8902682a7291a Mon Sep 17 00:00:00 2001 From: RM Date: Mon, 31 Jul 2023 14:35:22 +0700 Subject: [PATCH 33/51] Add Convex ETHx --- .../address-book/ethereum/tokens/tokens.ts | 12 ++++ src/data/ethereum/convexPools.json | 55 +++++++++++++------ 2 files changed, 49 insertions(+), 18 deletions(-) diff --git a/packages/address-book/address-book/ethereum/tokens/tokens.ts b/packages/address-book/address-book/ethereum/tokens/tokens.ts index 5f92c144e..35eea6b62 100644 --- a/packages/address-book/address-book/ethereum/tokens/tokens.ts +++ b/packages/address-book/address-book/ethereum/tokens/tokens.ts @@ -1108,6 +1108,18 @@ const _tokens = { description: 'High yield USD (hyUSD), is a decentralized flatcoin initially pegged to $1 USD that provides convenient access to DeFi yields, enabling holders to grow and preserve their wealth. hyUSD is 1:1 asset backed by a basket of other yield bearing tokens including eUSD as well as tokenized lending with exposure to US Treasuries. Given the unique design and current market conditions it is estimated to yield 8% or better to anyone holding hyUSD in any wallet, outpacing the rate of inflation in over 100 countries around the world and providing safe refuge for purchasing power everywhere.', }, + ETHx: { + name: 'ETHx', + symbol: 'ETHx', + address: '0xA35b1B31Ce002FBF2058D22F30f95D405200A15b', + chainId: 1, + decimals: 18, + logoURI: '', + website: 'https://www.staderlabs.com/eth/', + description: + "ETHx is an innovative liquid staking token developed by Stader, designed to revolutionize Ethereum staking. Stader's vision for ETHx is to transform the staking experience, providing users with the unprecedented freedom to move and utilize their staked ETH while continuing to earn rewards and engage with the growing DeFi ecosystem.", + documentation: 'https://staderlabs.gitbook.io/ethereum', + }, 'ETH+': { name: 'ETHPlus', symbol: 'ETH+', diff --git a/src/data/ethereum/convexPools.json b/src/data/ethereum/convexPools.json index a682e87d7..1e5eca716 100644 --- a/src/data/ethereum/convexPools.json +++ b/src/data/ethereum/convexPools.json @@ -1,22 +1,4 @@ [ - { - "name": "convex-aleth", - "pool": "0xC4C319E2D4d66CcA4464C0c2B32c9Bd23ebe784e", - "token": "0xC4C319E2D4d66CcA4464C0c2B32c9Bd23ebe784e", - "rewardPool": "0x48Bc302d8295FeA1f8c3e7F57D4dDC9981FEE410", - "tokens": [ - { - "oracle": "tokens", - "oracleId": "WETH", - "decimals": "1e18" - }, - { - "oracle": "tokens", - "oracleId": "alETH", - "decimals": "1e18" - } - ] - }, { "name": "curve-lvusd", "pool": "0xe9123CBC5d1EA65301D417193c40A72Ac8D53501", @@ -43,6 +25,25 @@ } ] }, + { + "name": "convex-ethx", + "pool": "0xd82C2eB10F4895CABED6EDa6eeee234bd1A9838B", + "token": "0xd82C2eB10F4895CABED6EDa6eeee234bd1A9838B", + "rewardPool": "0x9f6277061ec97A8fE5a1672bde4fc6b12dBb5DD6", + "getDy": ["v1", 0, 1], + "tokens": [ + { + "oracle": "tokens", + "oracleId": "ETHx", + "decimals": "1e18" + }, + { + "oracle": "tokens", + "oracleId": "ETH", + "decimals": "1e18" + } + ] + }, { "name": "convex-eth+", "pool": "0x7fb53345f1B21aB5d9510ADB38F7d3590BE6364b", @@ -918,6 +919,24 @@ } ] }, + { + "name": "convex-aleth", + "pool": "0xC4C319E2D4d66CcA4464C0c2B32c9Bd23ebe784e", + "token": "0xC4C319E2D4d66CcA4464C0c2B32c9Bd23ebe784e", + "rewardPool": "0x48Bc302d8295FeA1f8c3e7F57D4dDC9981FEE410", + "tokens": [ + { + "oracle": "tokens", + "oracleId": "WETH", + "decimals": "1e18" + }, + { + "oracle": "tokens", + "oracleId": "alETH", + "decimals": "1e18" + } + ] + }, { "name": "convex-apeusdfraxbp", "pool": "0x04b727C7e246CA70d496ecF52E6b6280f3c8077D", From cee29159631a525f2acbd38db451b8a1cb27bc9e Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Mon, 31 Jul 2023 07:36:13 +0000 Subject: [PATCH 34/51] ci: version bump to 0.43.44 --- packages/address-book/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/address-book/package.json b/packages/address-book/package.json index 4b19f075f..ccb7f56cd 100644 --- a/packages/address-book/package.json +++ b/packages/address-book/package.json @@ -1,6 +1,6 @@ { "name": "blockchain-addressbook", - "version": "0.43.43", + "version": "0.43.44", "description": "A collection of useful addresses on various chains for defi development", "main": "build/address-book/index.js", "types": "build/address-book/index.d.ts", From 47cabde775524c4200201b01947d3ffa12fb57db Mon Sep 17 00:00:00 2001 From: MirthFutures Date: Mon, 31 Jul 2023 08:50:43 -0400 Subject: [PATCH 35/51] add aura 3 eth pool v3 --- src/api/stats/ethereum/getAuraApys.js | 2 +- src/data/ethereum/auraBalancerLpPools.json | 30 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/api/stats/ethereum/getAuraApys.js b/src/api/stats/ethereum/getAuraApys.js index b45d3fcdb..2949784cd 100644 --- a/src/api/stats/ethereum/getAuraApys.js +++ b/src/api/stats/ethereum/getAuraApys.js @@ -92,7 +92,7 @@ const getPoolApy = async (pool, auraData, balance, rewardRate, finish, extras) = let [yearlyRewardsInUsd, totalStakedInUsd, aprFixed, bbaUSDApy] = await Promise.all([ getYearlyRewardsInUsd(auraData, pool, rewardRate, finish, extras), getTotalStakedInUsd(pool, balance), - pool.name == 'aura-wsteth-reth-sfrxeth-v2' + pool.name == 'aura-wsteth-reth-sfrxeth-v3' ? getThreeEthPoolYield(pool) : pool.lidoUrl || pool.rocketUrl ? getLiquidStakingPoolYield(pool) diff --git a/src/data/ethereum/auraBalancerLpPools.json b/src/data/ethereum/auraBalancerLpPools.json index 93d14cd96..f882179a8 100644 --- a/src/data/ethereum/auraBalancerLpPools.json +++ b/src/data/ethereum/auraBalancerLpPools.json @@ -1,4 +1,34 @@ [ + { + "name": "aura-wsteth-reth-sfrxeth-v3", + "address": "0x42ED016F826165C2e5976fe5bC3df540C5aD0Af7", + "vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8", + "gauge": "0x032B676d5D55e8ECbAe88ebEE0AA10fB5f72F6CB", + "composable": true, + "bptIndex": 0, + "vaultPoolId": "0x42ed016f826165c2e5976fe5bc3df540c5ad0af700000000000000000000058b", + "decimals": "1e18", + "tokens": [ + { + "oracleId": "bptToken" + }, + { + "oracle": "tokens", + "oracleId": "wstETH", + "decimals": "1e18" + }, + { + "oracle": "tokens", + "oracleId": "sfrxETH", + "decimals": "1e18" + }, + { + "oracle": "tokens", + "oracleId": "rETH", + "decimals": "1e18" + } + ] + }, { "name": "aura-r-wsteth", "address": "0x380aAbE019ed2a9C2d632b51eDDD30fd804d0fAD", From ca076d6716419ced81a74b2f3c1c04b284edda8e Mon Sep 17 00:00:00 2001 From: MirthFutures Date: Mon, 31 Jul 2023 12:15:25 -0400 Subject: [PATCH 36/51] Add 3Pool, GHO and ETHx Aura --- .../address-book/ethereum/tokens/tokens.ts | 73 +++++++++++-- src/api/stats/ethereum/getAuraApys.js | 39 +++++-- src/api/stats/getAmmPrices.ts | 1 + src/data/ethereum/auraBalancerLpPools.json | 101 ++++++++++++++++-- src/data/ethereum/balancerLinearPools.json | 51 ++++++--- src/data/ethereum/bbaUSD.json | 14 +-- .../fetchConcentratedLiquidityTokenPrices.ts | 8 ++ src/utils/fetchWrappedAaveTokenPrices.js | 3 +- 8 files changed, 240 insertions(+), 50 deletions(-) diff --git a/packages/address-book/address-book/ethereum/tokens/tokens.ts b/packages/address-book/address-book/ethereum/tokens/tokens.ts index 35eea6b62..bc643b3ce 100644 --- a/packages/address-book/address-book/ethereum/tokens/tokens.ts +++ b/packages/address-book/address-book/ethereum/tokens/tokens.ts @@ -456,7 +456,7 @@ const _tokens = { aUSDT: { name: 'Aave Tether USD', symbol: 'aUSDT', - address: '0x3Ed3B47Dd13EC9a98b44e6204A523E766B225811', + address: '0x23878914EFE38d27C4D67Ab83ed1b93A74D4086a', chainId: 1, decimals: 6, logoURI: @@ -482,7 +482,7 @@ const _tokens = { waUSDT: { name: 'Wrapped Aave Tether USD', symbol: 'waUSDT', - address: '0xf8Fd466F12e236f4c96F7Cce6c79EAdB819abF58', + address: '0x65799b9fD4206CdaA4A1DB79254FCbc2Fd2fFEe6', chainId: 1, decimals: 6, logoURI: @@ -495,7 +495,7 @@ const _tokens = { bbaUSDT: { name: 'Balancer Aave USDT Linear Pool', symbol: 'bbaUSDT', - address: '0x2F4eb100552ef93840d5aDC30560E5513DFfFACb', + address: '0xcfAE6E251369467F465f13836Ac8135bd42f8A56', chainId: 1, decimals: 18, logoURI: @@ -508,7 +508,7 @@ const _tokens = { aUSDC: { name: 'Aave USDC', symbol: 'aUSDC', - address: '0xBcca60bB61934080951369a648Fb03DF4F96263C', + address: '0x98C23E9d8f34FEFb1B7BD6a91B7FF122F4e16F5c', chainId: 1, decimals: 6, logoURI: @@ -521,7 +521,7 @@ const _tokens = { waUSDC: { name: 'Wrapped Aave Tether USD', symbol: 'waUSDC', - address: '0xd093fA4Fb80D09bB30817FDcd442d4d02eD3E5de', + address: '0x02c2d189b45CE213a40097b62D311cf0dD16eC92', chainId: 1, decimals: 6, logoURI: @@ -534,7 +534,7 @@ const _tokens = { bbaUSDC: { name: 'Balancer Aave USDC Linear Pool', symbol: 'bbaUSDC', - address: '0x82698aeCc9E28e9Bb27608Bd52cF57f704BD1B83', + address: '0xc50d4347209F285247BDa8A09Fc1C12CE42031c3', chainId: 1, decimals: 18, logoURI: @@ -560,7 +560,7 @@ const _tokens = { aDAI: { name: 'Aave DAI', symbol: 'aDAI', - address: '0x028171bCA77440897B824Ca71D1c56caC55b68A3', + address: '0x018008bfb33d285247A21d44E50697654f754e63', chainId: 1, decimals: 18, logoURI: @@ -573,7 +573,7 @@ const _tokens = { waDAI: { name: 'Wrapped Aave Tether DAI', symbol: 'waDAI', - address: '0x02d60b84491589974263d922D9cC7a3152618Ef6', + address: '0xEb708639E8e518B86a916db3685f90216b1C1c67', chainId: 1, decimals: 18, logoURI: @@ -586,7 +586,7 @@ const _tokens = { bbaDAI: { name: 'Balancer Aave DAI Linear Pool', symbol: 'bbaDAI', - address: '0xae37D54Ae477268B9997d4161B96b8200755935c', + address: '0xfa24A90A3F2bBE5FEEA92B95cD0d14Ce709649f9', chainId: 1, decimals: 18, logoURI: @@ -596,10 +596,50 @@ const _tokens = { description: 'Balancer linear pool that consist of 50/50 DAI and wrapped Aave Interest Bearing DAI.', }, + aETH: { + name: 'Aave ETH', + symbol: 'aETH', + address: '0x4d5F47FA6A74757f35C14fD3a6Ef8E3C9BC514E8', + chainId: 1, + decimals: 18, + logoURI: + 'https://tokens.pancakeswap.finance/images/0x4988a896b1227218e4A686fdE5EabdcAbd91571f.svg', + website: 'https://weth.io/', + documentation: 'https://docs.aave.com/developers/v/2.0/the-core-protocol/atokens', + description: + 'Aave interest bearing DAI. Ether or ETH is the native currency built on the Ethereum blockchain.', + bridge: 'native', + }, + waETH: { + name: 'Wrapped Aave Tether ETH', + symbol: 'waETH', + address: '0x03928473f25bb2da6Bc880b07eCBaDC636822264', + chainId: 1, + decimals: 18, + logoURI: '', + website: 'https://weth.io/', + documentation: 'https://docs.aave.com/developers/v/2.0/the-core-protocol/atokens', + description: + 'Wrapped Aave interest bearing ETH. Ether or ETH is the native currency built on the Ethereum blockchain.', + bridge: 'native', + }, + bbaETH: { + name: 'Balancer Aave ETH Linear Pool', + symbol: 'bbaETH', + address: '0xbB6881874825E60e1160416D6C426eae65f2459E', + chainId: 1, + decimals: 18, + logoURI: + 'https://tokens.pancakeswap.finance/images/0x4988a896b1227218e4A686fdE5EabdcAbd91571f.svg', + website: 'https://app.balancer.fi/#/', + documentation: 'https://docs.balancer.fi/products/balancer-pools/boosted-pools', + description: 'Balancer linear pool that consist of ETH and wrapped Aave Interest Bearing ETH.', + bridge: 'native', + }, bbaUSD: { name: 'Balancer Aave Stable Composable Pool', symbol: 'bbaUSD', - address: '0xA13a9247ea42D743238089903570127DdA72fE44', + address: '0xc443C15033FCB6Cf72cC24f1BDA0Db070DdD9786', chainId: 1, decimals: 18, logoURI: @@ -1152,9 +1192,22 @@ const _tokens = { logoURI: '', website: 'https://raft.fi', documentation: 'https://docs.raft.fi/', + bridge: 'native', description: 'Raft is a governance-minimized, decentralized protocol that allows people to generate R (a USD stablecoin) by depositing capital-efficient collateral.', }, + GHO: { + name: 'GHO Token', + symbol: 'GHO', + address: '0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f', + chainId: 1, + decimals: 18, + logoURI: '', + website: 'https://aave.com/', + documentation: 'https://docs.aave.com/faq/gho-stablecoin', + description: + 'GHO is a decentralized multi-collateral stablecoin that is fully backed, transparent and native to the Aave Protocol.', + }, } as const; export const tokens: ConstRecord = _tokens; diff --git a/src/api/stats/ethereum/getAuraApys.js b/src/api/stats/ethereum/getAuraApys.js index 2949784cd..9844f3dd4 100644 --- a/src/api/stats/ethereum/getAuraApys.js +++ b/src/api/stats/ethereum/getAuraApys.js @@ -11,6 +11,7 @@ import IBalancerVault from '../../../abis/IBalancerVault'; import IAaveProtocolDataProvider from '../../../abis/matic/AaveProtocolDataProvider'; import AuraToken from '../../../abis/ethereum/AuraToken'; import { fetchContract } from '../../rpc/client'; +import jp from 'jsonpath'; import AuraGauge from '../../../abis/ethereum/AuraGauge'; const { @@ -94,7 +95,7 @@ const getPoolApy = async (pool, auraData, balance, rewardRate, finish, extras) = getTotalStakedInUsd(pool, balance), pool.name == 'aura-wsteth-reth-sfrxeth-v3' ? getThreeEthPoolYield(pool) - : pool.lidoUrl || pool.rocketUrl + : pool.lsUrl ? getLiquidStakingPoolYield(pool) : 0, getComposableAaveYield(), @@ -184,17 +185,33 @@ const getLiquidStakingPoolYield = async pool => { } let apr = 0; - try { - const response = pool.lidoUrl - ? await fetch(pool.lidoUrl).then(res => res.json()) - : await fetch(pool.rocketUrl).then(res => res.json()); + let lsApr = 0; + if (Array.isArray(pool.lsUrl)) { + for (let i = 0; i < pool.lsUrl.length; i++) { + let response; + try { + response = await fetch(pool.lsUrl[i]).then(res => res.json()); + lsApr = await jp.query(response, pool.dataPath[i]); + } catch (e) { + console.error(`Aura: Liquid Staking URL Fetch Error ${pool.name}`); + } - const lsApr = pool.lidoUrl ? response.data.smaApr : response.yearlyAPR; + pool.balancerChargesFee + ? (apr = apr + (lsApr * qty[pool.lsIndex[i]].dividedBy(totalQty).toNumber()) / 100 / 2) + : (apr = apr + (lsApr * qty[pool.lsIndex[i]].dividedBy(totalQty).toNumber()) / 100); + } + } else { + let response; + try { + response = await fetch(pool.lsUrl).then(res => res.json()); + lsApr = await jp.query(response, pool.dataPath); + } catch (e) { + console.error(`Aura: Liquid Staking URL Fetch Error ${pool.name}`); + } - apr = (lsApr * qty[pool.lsIndex].dividedBy(totalQty).toNumber()) / 100; - apr = pool.balancerChargesFee ? apr / 2 : apr; - } catch (err) { - console.error(`Error fetching ls yield for ${pool.name} ` + err.message); + pool.balancerChargesFee + ? (apr = (lsApr * qty[pool.lsIndex].dividedBy(totalQty).toNumber()) / 100 / 2) + : (apr = (lsApr * qty[pool.lsIndex].dividedBy(totalQty).toNumber()) / 100); } // console.log(pool.name, lsApr, apr); @@ -218,7 +235,7 @@ const getThreeEthPoolYield = async pool => { let apr = 0; try { const [wstEthResponse, sfrxEthResponse, rEthResponse] = await Promise.all([ - fetch(pool.lidoUrl).then(res => res.json()), + fetch('https://eth-api.lido.fi/v1/protocol/steth/apr/sma').then(res => res.json()), fetch('https://api.frax.finance/v2/frxeth/summary/latest').then(res => res.json()), fetch('https://api.rocketpool.net/api/apr').then(res => res.json()), ]); diff --git a/src/api/stats/getAmmPrices.ts b/src/api/stats/getAmmPrices.ts index beb2a6742..c3ee28ee5 100644 --- a/src/api/stats/getAmmPrices.ts +++ b/src/api/stats/getAmmPrices.ts @@ -602,6 +602,7 @@ const seedPeggedPrices = { aUSDT: 'USDT', // Aave aDAI: 'DAI', // Aave aUSDC: 'USDC', // Aave + aETH: 'ETH', // Aave amUSDT: 'USDT', // Aave amUSDC: 'USDC', // Aave amDAI: 'DAI', // Aave diff --git a/src/data/ethereum/auraBalancerLpPools.json b/src/data/ethereum/auraBalancerLpPools.json index f882179a8..2feba55b4 100644 --- a/src/data/ethereum/auraBalancerLpPools.json +++ b/src/data/ethereum/auraBalancerLpPools.json @@ -1,4 +1,83 @@ [ + { + "name": "aura-gho-lusd", + "address": "0x3FA8C89704e5d07565444009e5d9e624B40Be813", + "vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8", + "gauge": "0x9305F7B6017c08BB71004A85fd78Adf3E32ce5CE", + "composable": true, + "bptIndex": 0, + "vaultPoolId": "0x3fa8c89704e5d07565444009e5d9e624b40be813000000000000000000000599", + "decimals": "1e18", + "tokens": [ + { + "oracleId": "bptToken" + }, + { + "oracle": "tokens", + "oracleId": "GHO", + "decimals": "1e18" + }, + { + "oracle": "tokens", + "oracleId": "LUSD", + "decimals": "1e18" + } + ] + }, + { + "name": "aura-gho-bbausd", + "address": "0xc2B021133D1b0cF07dba696fd5DD89338428225B", + "vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8", + "gauge": "0xF937b186687C0B11Dc0F7AFBA3B4458c30d9CF89", + "composable": true, + "bptIndex": 1, + "vaultPoolId": "0xc2b021133d1b0cf07dba696fd5dd89338428225b000000000000000000000598", + "decimals": "1e18", + "tokens": [ + { + "oracle": "tokens", + "oracleId": "GHO", + "decimals": "1e18" + }, + { + "oracleId": "bptToken" + }, + { + "oracle": "tokens", + "oracleId": "bbaUSD", + "decimals": "1e18" + } + ] + }, + { + "name": "aura-ethx-bbaeth", + "address": "0x4CbdE5C4B4B53EBE4aF4adB85404725985406163", + "vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8", + "gauge": "0xD7a1c1CD199dBBc0A39B8Aff3c85999D09dA1195", + "lsUrl": "https://universe.staderlabs.com/eth/apy", + "dataPath": "$.value", + "lsIndex": 0, + "balancerChargesFee": true, + "composable": true, + "bptIndex": 0, + "vaultPoolId": "0x4cbde5c4b4b53ebe4af4adb85404725985406163000000000000000000000595", + "decimals": "1e18", + "tokens": [ + { + "oracleId": "bptToken" + }, + { + "oracle": "tokens", + "oracleId": "ETHx", + "decimals": "1e18" + }, + { + "oracle": "tokens", + "oracleId": "bbaETH", + "decimals": "1e18" + } + ] + }, { "name": "aura-wsteth-reth-sfrxeth-v3", "address": "0x42ED016F826165C2e5976fe5bC3df540C5aD0Af7", @@ -34,7 +113,8 @@ "address": "0x380aAbE019ed2a9C2d632b51eDDD30fd804d0fAD", "vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8", "gauge": "0xb83aA654fDAF392F0b19f0ca1537786546febaD0", - "lidoUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "lsUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "dataPath": "$.data.smaApr", "lsIndex": 1, "balancerChargesFee": false, "vaultPoolId": "0x380aabe019ed2a9c2d632b51eddd30fd804d0fad000200000000000000000554", @@ -98,7 +178,8 @@ "gauge": "0xeE66a8958EBFEEfA209769530b5E05A38762509a", "composable": true, "bptIndex": 0, - "lidoUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "lsUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "dataPath": "$.data.smaApr", "lsIndex": 0, "vaultPoolId": "0x2e848426aec6dbf2260535a5bea048ed94d9ff3d000000000000000000000536", "decimals": "1e18", @@ -145,7 +226,6 @@ "gauge": "0xd26948E7a0223700e3C3cdEA21cA2471abCb8d47", "composable": true, "bptIndex": 0, - "lidoUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", "balancerChargesFee": false, "vaultPoolId": "0x5aee1e99fe86960377de9f88689616916d5dcabe000000000000000000000467", "decimals": "1e18", @@ -177,7 +257,8 @@ "gauge": "0xe35ae62Ff773D518172d4B0b1af293704790B670", "vaultPoolId": "0x9c6d47ff73e0f5e51be5fd53236e3f595c5793f200020000000000000000042c", "lsIndex": 0, - "lidoUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "lsUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "dataPath": "$.data.smaApr", "decimals": "1e18", "tokens": [ { @@ -264,7 +345,8 @@ "address": "0x798b112420AD6391A4129Ac25eF59663a44C88bB", "vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8", "gauge": "0x9AccD370C03a3cc4Bf717a81aD5A46e6c88FA109", - "lidoUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "lsUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "dataPath": "$.data.smaApr", "lsIndex": 1, "balancerChargesFee": false, "vaultPoolId": "0x798b112420ad6391a4129ac25ef59663a44c88bb0002000000000000000003f4", @@ -290,7 +372,8 @@ "composable": true, "bptIndex": 0, "lsIndex": 0, - "lidoUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "lsUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "dataPath": "$.data.smaApr", "balancerChargesFee": false, "vaultPoolId": "0x4edcb2b46377530bc18bb4d2c7fe46a992c73e100000000000000000000003ec", "decimals": "1e18", @@ -346,7 +429,8 @@ "vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8", "gauge": "0x59d66c58e83a26d6a0e35114323f65c3945c89c1", "lsIndex": 0, - "lidoUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "lsUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "dataPath": "$.data.smaApr", "balancerChargesFee": false, "vaultPoolId": "0x32296969ef14eb0c6d29669c550d4a0449130230000200000000000000000080", "decimals": "1e18", @@ -432,7 +516,8 @@ "vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8", "gauge": "0xe5d920029556a49a9cA4DD808CD62a1876C10eBA", "vaultPoolId": "0x25accb7943fd73dda5e23ba6329085a3c24bfb6a000200000000000000000387", - "lidoUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "lsUrl": "https://eth-api.lido.fi/v1/protocol/steth/apr/sma", + "dataPath": "$.data.smaApr", "lsIndex": 0, "includesComposableStable": false, "composableSplit": 2, diff --git a/src/data/ethereum/balancerLinearPools.json b/src/data/ethereum/balancerLinearPools.json index 62b24b26d..cf1612c1c 100644 --- a/src/data/ethereum/balancerLinearPools.json +++ b/src/data/ethereum/balancerLinearPools.json @@ -1,9 +1,34 @@ [ + { + "name": "bbaETH", + "address": "0xbB6881874825E60e1160416D6C426eae65f2459E", + "vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8", + "vaultPoolId": "0xbb6881874825e60e1160416d6c426eae65f2459e000000000000000000000592", + "decimals": "1e18", + "chainId": 1, + "composable": true, + "bptIndex": 0, + "tokens": [ + { + "oracleId": "BPTToken" + }, + { + "oracle": "tokens", + "oracleId": "waETH", + "decimals": "1e18" + }, + { + "oracle": "tokens", + "oracleId": "WETH", + "decimals": "1e18" + } + ] + }, { "name": "bbaUSDT", - "address": "0x2F4eb100552ef93840d5aDC30560E5513DFfFACb", + "address": "0xcfAE6E251369467F465f13836Ac8135bd42f8A56", "vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8", - "vaultPoolId": "0x2f4eb100552ef93840d5adc30560e5513dfffacb000000000000000000000334", + "vaultPoolId": "0xcfae6e251369467f465f13836ac8135bd42f8a56000000000000000000000591", "decimals": "1e18", "chainId": 1, "composable": true, @@ -14,21 +39,21 @@ }, { "oracle": "tokens", - "oracleId": "USDT", + "oracleId": "waUSDT", "decimals": "1e6" }, { "oracle": "tokens", - "oracleId": "waUSDT", + "oracleId": "USDT", "decimals": "1e6" } ] }, { "name": "bbaUSDC", - "address": "0x82698aeCc9E28e9Bb27608Bd52cF57f704BD1B83", + "address": "0xc50d4347209F285247BDa8A09Fc1C12CE42031c3", "vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8", - "vaultPoolId": "0x82698aecc9e28e9bb27608bd52cf57f704bd1b83000000000000000000000336", + "vaultPoolId": "0xc50d4347209f285247bda8a09fc1c12ce42031c3000000000000000000000590", "decimals": "1e18", "chainId": 1, "composable": true, @@ -51,18 +76,16 @@ }, { "name": "bbaDAI", - "address": "0xae37D54Ae477268B9997d4161B96b8200755935c", + "address": "0xfa24A90A3F2bBE5FEEA92B95cD0d14Ce709649f9", "vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8", - "vaultPoolId": "0xae37d54ae477268b9997d4161b96b8200755935c000000000000000000000337", + "vaultPoolId": "0xfa24a90a3f2bbe5feea92b95cd0d14ce709649f900000000000000000000058f", "decimals": "1e18", "chainId": 1, "composable": true, - "bptIndex": 2, + "bptIndex": 0, "tokens": [ { - "oracle": "tokens", - "oracleId": "waDAI", - "decimals": "1e18" + "oracleId": "BPTToken" }, { "oracle": "tokens", @@ -70,7 +93,9 @@ "decimals": "1e18" }, { - "oracleId": "BPTToken" + "oracle": "tokens", + "oracleId": "waDAI", + "decimals": "1e18" } ] }, diff --git a/src/data/ethereum/bbaUSD.json b/src/data/ethereum/bbaUSD.json index 0c21027a0..b2eb43aea 100644 --- a/src/data/ethereum/bbaUSD.json +++ b/src/data/ethereum/bbaUSD.json @@ -1,18 +1,16 @@ [ { "name": "bbaUSD", - "address": "0xA13a9247ea42D743238089903570127DdA72fE44", + "address": "0xc443C15033FCB6Cf72cC24f1BDA0Db070DdD9786", "vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8", - "vaultPoolId": "0xa13a9247ea42d743238089903570127dda72fe4400000000000000000000035d", + "vaultPoolId": "0xc443c15033fcb6cf72cc24f1bda0db070ddd9786000000000000000000000593", "decimals": "1e18", "chainId": 1, "composable": true, - "bptIndex": 2, + "bptIndex": 0, "tokens": [ { - "oracle": "tokens", - "oracleId": "bbaUSDT", - "decimals": "1e18" + "oracleId": "BPTToken" }, { "oracle": "tokens", @@ -20,7 +18,9 @@ "decimals": "1e18" }, { - "oracleId": "BPTToken" + "oracle": "tokens", + "oracleId": "bbaUSDT", + "decimals": "1e18" }, { "oracle": "tokens", diff --git a/src/utils/fetchConcentratedLiquidityTokenPrices.ts b/src/utils/fetchConcentratedLiquidityTokenPrices.ts index 143a205f6..4d954aa9f 100644 --- a/src/utils/fetchConcentratedLiquidityTokenPrices.ts +++ b/src/utils/fetchConcentratedLiquidityTokenPrices.ts @@ -40,6 +40,14 @@ const tokens: Partial firstToken: 'USDC', secondToken: 'AXL', }, + { + type: 'UniV3', + oracleId: 'GHO', + decimalDelta: 1e12, + pool: '0x54EEbc36527FE2E5624051E3c895810d7b68bcFc', + firstToken: 'USDC', + secondToken: 'GHO', + }, ], polygon: [ { diff --git a/src/utils/fetchWrappedAaveTokenPrices.js b/src/utils/fetchWrappedAaveTokenPrices.js index 6536b4b01..10e68155f 100644 --- a/src/utils/fetchWrappedAaveTokenPrices.js +++ b/src/utils/fetchWrappedAaveTokenPrices.js @@ -9,7 +9,7 @@ const RAY_DECIMALS = '1e27'; const { ethereum: { - tokens: { aUSDT, waUSDT, aUSDC, waUSDC, aDAI, waDAI }, + tokens: { aUSDT, waUSDT, aUSDC, waUSDC, aDAI, waDAI, aETH, waETH }, }, polygon: { tokens: { amUSDT, wamUSDT, amUSDC, wamUSDC, amDAI, wamDAI, aWMATIC, waWMATIC, aWETH, waWETH }, @@ -27,6 +27,7 @@ const tokens = { [aUSDT, waUSDT], [aUSDC, waUSDC], [aDAI, waDAI], + [aETH, waETH], ], polygon: [ [amUSDT, wamUSDT], From c1179d6f5942a79a144d9dc5381fb4c88e7b40a4 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Mon, 31 Jul 2023 16:16:28 +0000 Subject: [PATCH 37/51] ci: version bump to 0.43.45 --- packages/address-book/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/address-book/package.json b/packages/address-book/package.json index ccb7f56cd..e54e113fd 100644 --- a/packages/address-book/package.json +++ b/packages/address-book/package.json @@ -1,6 +1,6 @@ { "name": "blockchain-addressbook", - "version": "0.43.44", + "version": "0.43.45", "description": "A collection of useful addresses on various chains for defi development", "main": "build/address-book/index.js", "types": "build/address-book/index.d.ts", From 09aca0e048186d150e389c533b1e375ce3cd7e69 Mon Sep 17 00:00:00 2001 From: ReflectiveChimp <55021052+ReflectiveChimp@users.noreply.github.com> Date: Mon, 31 Jul 2023 17:17:40 +0100 Subject: [PATCH 38/51] Viem: chainlink + rate limiting --- src/abis/ChainLinkOracle.json | 239 ------------------------------ src/abis/ChainLinkOracle.ts | 235 +++++++++++++++++++++++++++++ src/api/rpc/client.ts | 51 ++++++- src/api/rpc/transport.ts | 25 ++++ src/utils/env.ts | 39 +++++ src/utils/fetchChainLinkPrices.ts | 87 ++++------- 6 files changed, 376 insertions(+), 300 deletions(-) delete mode 100644 src/abis/ChainLinkOracle.json create mode 100644 src/abis/ChainLinkOracle.ts create mode 100644 src/api/rpc/transport.ts create mode 100644 src/utils/env.ts diff --git a/src/abis/ChainLinkOracle.json b/src/abis/ChainLinkOracle.json deleted file mode 100644 index fe49b5585..000000000 --- a/src/abis/ChainLinkOracle.json +++ /dev/null @@ -1,239 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "address", "name": "_aggregator", "type": "address" }, - { "internalType": "address", "name": "_accessController", "type": "address" } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "int256", "name": "current", "type": "int256" }, - { "indexed": true, "internalType": "uint256", "name": "roundId", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "updatedAt", "type": "uint256" } - ], - "name": "AnswerUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint256", "name": "roundId", "type": "uint256" }, - { "indexed": true, "internalType": "address", "name": "startedBy", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "startedAt", "type": "uint256" } - ], - "name": "NewRound", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "to", "type": "address" } - ], - "name": "OwnershipTransferRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "to", "type": "address" } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "accessController", - "outputs": [ - { "internalType": "contract AccessControllerInterface", "name": "", "type": "address" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "aggregator", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_aggregator", "type": "address" }], - "name": "confirmAggregator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "description", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "_roundId", "type": "uint256" }], - "name": "getAnswer", - "outputs": [{ "internalType": "int256", "name": "", "type": "int256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint80", "name": "_roundId", "type": "uint80" }], - "name": "getRoundData", - "outputs": [ - { "internalType": "uint80", "name": "roundId", "type": "uint80" }, - { "internalType": "int256", "name": "answer", "type": "int256" }, - { "internalType": "uint256", "name": "startedAt", "type": "uint256" }, - { "internalType": "uint256", "name": "updatedAt", "type": "uint256" }, - { "internalType": "uint80", "name": "answeredInRound", "type": "uint80" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "_roundId", "type": "uint256" }], - "name": "getTimestamp", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "latestAnswer", - "outputs": [{ "internalType": "int256", "name": "", "type": "int256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "latestRound", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "latestRoundData", - "outputs": [ - { "internalType": "uint80", "name": "roundId", "type": "uint80" }, - { "internalType": "int256", "name": "answer", "type": "int256" }, - { "internalType": "uint256", "name": "startedAt", "type": "uint256" }, - { "internalType": "uint256", "name": "updatedAt", "type": "uint256" }, - { "internalType": "uint80", "name": "answeredInRound", "type": "uint80" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "latestTimestamp", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [{ "internalType": "address payable", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], - "name": "phaseAggregators", - "outputs": [ - { "internalType": "contract AggregatorV2V3Interface", "name": "", "type": "address" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "phaseId", - "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_aggregator", "type": "address" }], - "name": "proposeAggregator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "proposedAggregator", - "outputs": [ - { "internalType": "contract AggregatorV2V3Interface", "name": "", "type": "address" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint80", "name": "_roundId", "type": "uint80" }], - "name": "proposedGetRoundData", - "outputs": [ - { "internalType": "uint80", "name": "roundId", "type": "uint80" }, - { "internalType": "int256", "name": "answer", "type": "int256" }, - { "internalType": "uint256", "name": "startedAt", "type": "uint256" }, - { "internalType": "uint256", "name": "updatedAt", "type": "uint256" }, - { "internalType": "uint80", "name": "answeredInRound", "type": "uint80" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proposedLatestRoundData", - "outputs": [ - { "internalType": "uint80", "name": "roundId", "type": "uint80" }, - { "internalType": "int256", "name": "answer", "type": "int256" }, - { "internalType": "uint256", "name": "startedAt", "type": "uint256" }, - { "internalType": "uint256", "name": "updatedAt", "type": "uint256" }, - { "internalType": "uint80", "name": "answeredInRound", "type": "uint80" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_accessController", "type": "address" }], - "name": "setController", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_to", "type": "address" }], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - } -] diff --git a/src/abis/ChainLinkOracle.ts b/src/abis/ChainLinkOracle.ts new file mode 100644 index 000000000..6786fcf20 --- /dev/null +++ b/src/abis/ChainLinkOracle.ts @@ -0,0 +1,235 @@ +import { Abi } from 'abitype'; + +export const chainLinkOracleAbi = [ + { + inputs: [ + { internalType: 'address', name: '_aggregator', type: 'address' }, + { internalType: 'address', name: '_accessController', type: 'address' }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'int256', name: 'current', type: 'int256' }, + { indexed: true, internalType: 'uint256', name: 'roundId', type: 'uint256' }, + { indexed: false, internalType: 'uint256', name: 'updatedAt', type: 'uint256' }, + ], + name: 'AnswerUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'uint256', name: 'roundId', type: 'uint256' }, + { indexed: true, internalType: 'address', name: 'startedBy', type: 'address' }, + { indexed: false, internalType: 'uint256', name: 'startedAt', type: 'uint256' }, + ], + name: 'NewRound', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'address', name: 'from', type: 'address' }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, + ], + name: 'OwnershipTransferRequested', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'address', name: 'from', type: 'address' }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'acceptOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'accessController', + outputs: [{ internalType: 'contract AccessControllerInterface', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'aggregator', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '_aggregator', type: 'address' }], + name: 'confirmAggregator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'description', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: '_roundId', type: 'uint256' }], + name: 'getAnswer', + outputs: [{ internalType: 'int256', name: '', type: 'int256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint80', name: '_roundId', type: 'uint80' }], + name: 'getRoundData', + outputs: [ + { internalType: 'uint80', name: 'roundId', type: 'uint80' }, + { internalType: 'int256', name: 'answer', type: 'int256' }, + { internalType: 'uint256', name: 'startedAt', type: 'uint256' }, + { internalType: 'uint256', name: 'updatedAt', type: 'uint256' }, + { internalType: 'uint80', name: 'answeredInRound', type: 'uint80' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: '_roundId', type: 'uint256' }], + name: 'getTimestamp', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'latestAnswer', + outputs: [{ internalType: 'int256', name: '', type: 'int256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'latestRound', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'latestRoundData', + outputs: [ + { internalType: 'uint80', name: 'roundId', type: 'uint80' }, + { internalType: 'int256', name: 'answer', type: 'int256' }, + { internalType: 'uint256', name: 'startedAt', type: 'uint256' }, + { internalType: 'uint256', name: 'updatedAt', type: 'uint256' }, + { internalType: 'uint80', name: 'answeredInRound', type: 'uint80' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'latestTimestamp', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [{ internalType: 'address payable', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint16', name: '', type: 'uint16' }], + name: 'phaseAggregators', + outputs: [{ internalType: 'contract AggregatorV2V3Interface', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'phaseId', + outputs: [{ internalType: 'uint16', name: '', type: 'uint16' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '_aggregator', type: 'address' }], + name: 'proposeAggregator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'proposedAggregator', + outputs: [{ internalType: 'contract AggregatorV2V3Interface', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint80', name: '_roundId', type: 'uint80' }], + name: 'proposedGetRoundData', + outputs: [ + { internalType: 'uint80', name: 'roundId', type: 'uint80' }, + { internalType: 'int256', name: 'answer', type: 'int256' }, + { internalType: 'uint256', name: 'startedAt', type: 'uint256' }, + { internalType: 'uint256', name: 'updatedAt', type: 'uint256' }, + { internalType: 'uint80', name: 'answeredInRound', type: 'uint80' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'proposedLatestRoundData', + outputs: [ + { internalType: 'uint80', name: 'roundId', type: 'uint80' }, + { internalType: 'int256', name: 'answer', type: 'int256' }, + { internalType: 'uint256', name: 'startedAt', type: 'uint256' }, + { internalType: 'uint256', name: 'updatedAt', type: 'uint256' }, + { internalType: 'uint80', name: 'answeredInRound', type: 'uint80' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '_accessController', type: 'address' }], + name: 'setController', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '_to', type: 'address' }], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'version', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, +] as const satisfies Abi; diff --git a/src/api/rpc/client.ts b/src/api/rpc/client.ts index 44325dd9d..9d423e0b4 100644 --- a/src/api/rpc/client.ts +++ b/src/api/rpc/client.ts @@ -1,15 +1,59 @@ -import { PublicClient, createPublicClient, http, getContract } from 'viem'; +import { + createPublicClient, + getContract, + http, + HttpTransport, + HttpTransportConfig, + PublicClient, +} from 'viem'; import { Abi } from 'abitype'; import { getChain } from './chains'; import { ChainId } from '../../../packages/address-book/address-book'; +import { rateLimitedHttp } from './transport'; +import PQueue from 'p-queue'; +import { envBoolean, envNumber } from '../../utils/env'; const multicallClientsByChain: Record = {}; const singleCallClientsByChain: Record = {}; +const queueByDomain: Record = {}; + +/** + * Return a new queue per domain + * @param rpcUrl + */ +function getQueueFor(rpcUrl: string): PQueue { + const { hostname } = new URL(rpcUrl); + if (!queueByDomain[hostname]) { + // Default: Max 5 requests per second with 2 active requests + queueByDomain[hostname] = new PQueue({ + concurrency: envNumber('RPC_RATE_LIMIT_CONCURRENCY', 2), + intervalCap: envNumber('RPC_RATE_LIMIT_INTERVAL_CAP', 5), + interval: envNumber('RPC_RATE_LIMIT_INTERVAL', 1000), + carryoverConcurrencyCount: true, + autoStart: true, + timeout: 30 * 1000, + throwOnTimeout: true, + }); + } + + return queueByDomain[hostname]; +} + +function makeHttpTransport(url: string, config: HttpTransportConfig = {}): HttpTransport { + // Default: disable rate limiting + if (envBoolean('RPC_RATE_LIMIT', false)) { + const queue = getQueueFor(url); + return rateLimitedHttp(queue, url, config); + } + + return http(url, config); +} const getMulticallClientForChain = (chainId: ChainId): PublicClient => { const chain = getChain[chainId]; if (!chain) throw new Error('Unknown chainId ' + chainId); if (!multicallClientsByChain[chain.id]) { + const url = chain.rpcUrls.public.http[0]; multicallClientsByChain[chain.id] = createPublicClient({ batch: { multicall: { @@ -18,7 +62,7 @@ const getMulticallClientForChain = (chainId: ChainId): PublicClient => { }, }, chain: chain, - transport: http(chain.rpcUrls.public.http[0], { + transport: makeHttpTransport(url, { // Test impact before enabling // batch: { // wait: 500, @@ -37,9 +81,10 @@ const getSingleCallClientForChain = (chainId: ChainId): PublicClient => { const chain = getChain[chainId]; if (!chain) throw new Error('Unknown chainId ' + chainId); if (!singleCallClientsByChain[chain.id]) { + const url = chain.rpcUrls.public.http[0]; singleCallClientsByChain[chain.id] = createPublicClient({ chain: chain, - transport: http(chain.rpcUrls.public.http[0], { + transport: makeHttpTransport(url, { timeout: 15000, retryCount: 3, retryDelay: 350, diff --git a/src/api/rpc/transport.ts b/src/api/rpc/transport.ts new file mode 100644 index 000000000..0fb40f482 --- /dev/null +++ b/src/api/rpc/transport.ts @@ -0,0 +1,25 @@ +import PQueue from 'p-queue'; +import { http, HttpTransport, HttpTransportConfig } from 'viem'; + +/** + * Wrapped version of http transport with rate limit support + * @see @view/src/clients/transports/http.ts + */ +export function rateLimitedHttp( + queue: PQueue, + url?: string, + config: HttpTransportConfig = {} +): HttpTransport { + const original = http(url, config); + + return args => { + const transport = original(args); + const originalRequest = transport.request; + + transport.request = function (arg) { + return queue.add(() => originalRequest(arg)); + }.bind(transport); + + return transport; + }; +} diff --git a/src/utils/env.ts b/src/utils/env.ts new file mode 100644 index 000000000..381eb44c6 --- /dev/null +++ b/src/utils/env.ts @@ -0,0 +1,39 @@ +/** + * Undefined, NaN, or Infinity returns defaultValue + * Otherwise returns value cast to Number + */ +export function envNumber(key: string, defaultValue: number): number { + if (!(key in process.env)) { + return defaultValue; + } + + const value = process.env[key]; + if (value.length === 0) { + return defaultValue; + } + + const numberValue = Number(value); + if (isNaN(numberValue) || !isFinite(numberValue)) { + return defaultValue; + } + + return numberValue; +} + +/** + * Undefined returns defaultValue + * "true" or "1" returns true + * Otherwise returns false + */ +export function envBoolean(key: string, defaultValue: boolean): boolean { + if (!(key in process.env)) { + return defaultValue; + } + + const value = process.env[key]; + if (value.length === 0) { + return defaultValue; + } + + return value.toLowerCase() === 'true' || value === '1'; +} diff --git a/src/utils/fetchChainLinkPrices.ts b/src/utils/fetchChainLinkPrices.ts index 35712f8ee..f78340f53 100644 --- a/src/utils/fetchChainLinkPrices.ts +++ b/src/utils/fetchChainLinkPrices.ts @@ -1,14 +1,12 @@ -import { groupBy, mapValues, partition } from 'lodash'; +import { groupBy, mapValues } from 'lodash'; import { ApiChain, toChainId } from './chain'; -import { web3Factory } from './web3'; -import { MULTICALL_V3 } from './web3Helpers'; -import { Multicall } from 'ethereum-multicall'; -import chainLinkOracleAbi from '../abis/ChainLinkOracle.json'; import BigNumber from 'bignumber.js'; import { fromWei } from './big-number'; import { subSeconds } from 'date-fns'; import { isResultFulfilled } from './promise'; import { median } from './number'; +import { fetchContract } from '../api/rpc/client'; +import { chainLinkOracleAbi } from '../abis/ChainLinkOracle'; type Oracle = { oracleId: string; @@ -145,75 +143,48 @@ async function fetchPricesForChain( chain: ApiChain, oracles: Oracle[] ): Promise> { - const chainId = toChainId(chain); - const multicallAddress = MULTICALL_V3[chainId]; - if (!multicallAddress) { - throw new Error(`Multicallv3 address not found for chain ${this.chain}`); - } - const multicall = new Multicall({ - web3Instance: web3Factory(chainId), - tryAggregate: true, - multicallCustomContractAddress: multicallAddress, - }); - - const { results } = await multicall.call( - oracles.map(oracle => ({ - reference: oracle.oracleId, - contractAddress: oracle.address, - abi: chainLinkOracleAbi, - calls: [ - { - reference: 'roundData', - methodName: 'latestRoundData', - methodParameters: [], - }, - { - reference: 'decimals', - methodName: 'decimals', - methodParameters: [], - }, - ], - })) + const results = await Promise.allSettled( + oracles.map(async (oracle): Promise => { + const contract = fetchContract(oracle.address, chainLinkOracleAbi, toChainId(chain)); + const [roundData, decimals] = await Promise.all([ + contract.read.latestRoundData(), + contract.read.decimals(), + ]); + + return { + roundId: roundData[0].toString(), + answer: fromWei(new BigNumber(roundData[1].toString()), decimals).toNumber(), + startedAt: new Date(Number(roundData[2]) * 1000), + updatedAt: new Date(Number(roundData[3]) * 1000), + answeredInRound: new BigNumber(roundData[4].toString()).toString(10), + }; + }) ); const now = new Date(); - const prices: Record = {}; - Object.values(results).forEach(({ originalContractCallContext, callsReturnContext }) => { - const oracleId = originalContractCallContext.reference; - const oracle = oracles.find(o => o.oracleId === oracleId); - const [roundDataResult, decimalsResult] = callsReturnContext; + results.forEach((result, index) => { + const oracle = oracles[index]; - if (!roundDataResult.success || !decimalsResult.success) { - console.error(`ChainLink: Failed to fetch price for ${oracleId} on chain ${chain}`); - return; - } - - if (roundDataResult.returnValues.length !== 5 || decimalsResult.returnValues.length !== 1) { - console.error(`ChainLink: Error in fetched price for ${oracleId} on chain ${chain}`); + if (!isResultFulfilled(result)) { + console.error( + `ChainLink: Failed to fetch price for ${oracle.oracleId} on chain ${chain}`, + result.reason + ); return; } - const decimals = parseInt(decimalsResult.returnValues[0], 16); - - const roundData: RoundData = { - roundId: new BigNumber(roundDataResult.returnValues[0].hex).toString(10), - answer: fromWei(new BigNumber(roundDataResult.returnValues[1].hex), decimals).toNumber(), - startedAt: new Date(parseInt(roundDataResult.returnValues[2].hex, 16) * 1000), - updatedAt: new Date(parseInt(roundDataResult.returnValues[3].hex, 16) * 1000), - answeredInRound: new BigNumber(roundDataResult.returnValues[4].hex).toString(10), - }; - + const roundData = result.value; const heartbeatAgo = subSeconds(now, oracle.heartbeat + Math.max(oracle.heartbeat * 0.2, 300)); // 10% leeway or min. 5 minutes if (roundData.updatedAt < heartbeatAgo) { console.error( - `ChainLink: Price for ${oracleId} on chain ${chain} is too old (Updated at ${roundData.updatedAt}, heartbeat ${oracle.heartbeat}s)` + `ChainLink: Price for ${oracle.oracleId} on chain ${chain} is too old (Updated at ${roundData.updatedAt}, heartbeat ${oracle.heartbeat}s)` ); return; } - prices[oracleId] = roundData.answer; + prices[oracle.oracleId] = roundData.answer; }); return prices; From 9906dc96abb2db0d92e0c8a49cd00b203b339560 Mon Sep 17 00:00:00 2001 From: MirthFutures Date: Mon, 31 Jul 2023 14:16:30 -0400 Subject: [PATCH 39/51] Add LUSD mainnet to addressbook --- .../address-book/ethereum/tokens/tokens.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/address-book/address-book/ethereum/tokens/tokens.ts b/packages/address-book/address-book/ethereum/tokens/tokens.ts index bc643b3ce..989f26e2b 100644 --- a/packages/address-book/address-book/ethereum/tokens/tokens.ts +++ b/packages/address-book/address-book/ethereum/tokens/tokens.ts @@ -646,6 +646,7 @@ const _tokens = { 'https://tokens.pancakeswap.finance/images/0x4988a896b1227218e4A686fdE5EabdcAbd91571f.svg', website: 'https://app.balancer.fi/#/', documentation: 'https://docs.balancer.fi/products/balancer-pools/boosted-pools', + bridge: 'native', description: 'Balancer composable pool that consist of bbaUSDT, bbaUSDC, and bbaDAI. bbTokens are Aave boosted linear pools.', }, @@ -1156,6 +1157,7 @@ const _tokens = { decimals: 18, logoURI: '', website: 'https://www.staderlabs.com/eth/', + bridge: 'native', description: "ETHx is an innovative liquid staking token developed by Stader, designed to revolutionize Ethereum staking. Stader's vision for ETHx is to transform the staking experience, providing users with the unprecedented freedom to move and utilize their staked ETH while continuing to earn rewards and engage with the growing DeFi ecosystem.", documentation: 'https://staderlabs.gitbook.io/ethereum', @@ -1168,6 +1170,7 @@ const _tokens = { decimals: 18, logoURI: '', website: 'https://register.app/#/overview?token=0xE72B141DF173b999AE7c1aDcbF60Cc9833Ce56a8', + bridge: 'native', description: 'Safety-first diversified ETH staking index with up to 4.5% APY backed by Lido Staked ETH and Rocket Pool ETH.', }, @@ -1205,9 +1208,23 @@ const _tokens = { logoURI: '', website: 'https://aave.com/', documentation: 'https://docs.aave.com/faq/gho-stablecoin', + bridge: 'native', description: 'GHO is a decentralized multi-collateral stablecoin that is fully backed, transparent and native to the Aave Protocol.', }, + LUSD: { + name: 'LUSD Stablecoin', + symbol: 'LUSD', + address: '0x5f98805A4E8be255a32880FDeC7F6728C6568bA0', + chainId: 1, + decimals: 18, + logoURI: '', + website: 'https://www.liquity.org/', + bridge: 'native', + description: + 'Liquity is a decentralized borrowing protocol that allows you to draw interest-free loans against Ether used as collateral. Loans are paid out in LUSD (a USD pegged stablecoin) and need to maintain a minimum collateral ratio of 110%.', + documentation: 'https://docs.liquity.org/', + }, } as const; export const tokens: ConstRecord = _tokens; From 1cb18c1d3b19e0dca7ba25291161e22fc4d37304 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Mon, 31 Jul 2023 18:17:30 +0000 Subject: [PATCH 40/51] ci: version bump to 0.43.46 --- packages/address-book/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/address-book/package.json b/packages/address-book/package.json index e54e113fd..bd1c8724e 100644 --- a/packages/address-book/package.json +++ b/packages/address-book/package.json @@ -1,6 +1,6 @@ { "name": "blockchain-addressbook", - "version": "0.43.45", + "version": "0.43.46", "description": "A collection of useful addresses on various chains for defi development", "main": "build/address-book/index.js", "types": "build/address-book/index.d.ts", From 91245a8aa2a402c5867fc9eabdaf3f9db5ffbd3d Mon Sep 17 00:00:00 2001 From: RM Date: Tue, 1 Aug 2023 16:36:05 +0700 Subject: [PATCH 41/51] Add new USDR pools --- .../address-book/polygon/tokens/tokens.ts | 26 +++++++- src/data/matic/pearlLpPools.json | 62 ++++++++++++++++++- src/data/matic/pearlStableLpPools.json | 60 ++++++++++++++++++ 3 files changed, 146 insertions(+), 2 deletions(-) diff --git a/packages/address-book/address-book/polygon/tokens/tokens.ts b/packages/address-book/address-book/polygon/tokens/tokens.ts index 6ec4cbe1d..b69985314 100644 --- a/packages/address-book/address-book/polygon/tokens/tokens.ts +++ b/packages/address-book/address-book/polygon/tokens/tokens.ts @@ -1788,7 +1788,7 @@ const _tokens = { logoURI: 'https://bscscan.com/token/images/brztoken_32.png', documentation: 'https://brztoken.io/files/white_paper_BRZ_2023.pdf', }, - wUSDR: { + multiWUSDR: { name: 'Real USD', symbol: 'wUSDR', address: '0xAF0D9D65fC54de245cdA37af3d18cbEc860A4D4b', @@ -1812,6 +1812,30 @@ const _tokens = { 'Real USD (USDR) is the world’s first stablecoin collateralized by tokenized, yield-producing real estate. USDR has a value accrual system built into its design. Using a consistent stream of dependable yield derived from rental revenue, Real USD delivers a native yield to holders.', logoURI: '', }, + wUSDR: { + name: 'Real USD', + symbol: 'wUSDR', + address: '0x00e8c0E92eB3Ad88189E7125Ec8825eDc03Ab265', + chainId: 137, + decimals: 9, + website: 'https://www.tangible.store/realusd', + documentation: 'https://docs.tangible.store/', + description: + 'Real USD (USDR) is the world’s first stablecoin collateralized by tokenized, yield-producing real estate. USDR has a value accrual system built into its design. Using a consistent stream of dependable yield derived from rental revenue, Real USD delivers a native yield to holders.', + logoURI: '', + }, + USDRv3: { + name: 'Real USD', + symbol: 'USDR', + address: '0x40379a439D4F6795B6fc9aa5687dB461677A2dBa', + chainId: 137, + decimals: 9, + website: 'https://www.tangible.store/realusd', + documentation: 'https://docs.tangible.store/', + description: + 'Real USD (USDR) is the world’s first stablecoin collateralized by tokenized, yield-producing real estate. USDR has a value accrual system built into its design. Using a consistent stream of dependable yield derived from rental revenue, Real USD delivers a native yield to holders.', + logoURI: '', + }, amWBTC: { name: 'Aave WBTC', symbol: 'amWBTC', diff --git a/src/data/matic/pearlLpPools.json b/src/data/matic/pearlLpPools.json index 38117de98..440091839 100644 --- a/src/data/matic/pearlLpPools.json +++ b/src/data/matic/pearlLpPools.json @@ -19,6 +19,26 @@ "decimals": "1e9" } }, + { + "name": "pearl-wusdr-usdrv3", + "address": "0xBaBe0E5b209494aa5e13722a8B62829155ae2A3f", + "gauge": "0x8834d93F25F5b345960E6FCad3C8d9a0B8e71E94", + "decimals": "1e18", + "chainId": 137, + "beefyFee": 0.095, + "lp0": { + "address": "0x00e8c0E92eB3Ad88189E7125Ec8825eDc03Ab265", + "oracle": "tokens", + "oracleId": "wUSDR", + "decimals": "1e9" + }, + "lp1": { + "address": "0x40379a439D4F6795B6fc9aa5687dB461677A2dBa", + "oracle": "tokens", + "oracleId": "USDR", + "decimals": "1e9" + } + }, { "name": "pearl-wusdr-usdr", "address": "0x10E1b58B3C93890D04D539b5f39Aa4Df27A362b2", @@ -29,7 +49,7 @@ "lp0": { "address": "0xAF0D9D65fC54de245cdA37af3d18cbEc860A4D4b", "oracle": "tokens", - "oracleId": "WUSDR", + "oracleId": "wUSDR", "decimals": "1e9" }, "lp1": { @@ -99,6 +119,26 @@ "decimals": "1e9" } }, + { + "name": "pearl-usdrv3-pearl", + "address": "0xEf8BF7E7471eE5dE8C93CcE284a71b7D751d8cCC", + "gauge": "0x4d88Fc6f0818fC4DD4288601404CC650C1302C7e", + "decimals": "1e18", + "chainId": 137, + "beefyFee": 0.095, + "lp0": { + "address": "0x40379a439D4F6795B6fc9aa5687dB461677A2dBa", + "oracle": "tokens", + "oracleId": "USDR", + "decimals": "1e9" + }, + "lp1": { + "address": "0x7238390d5f6F64e67c3211C343A410E2A3DEc142", + "oracle": "tokens", + "oracleId": "PEARL", + "decimals": "1e18" + } + }, { "name": "pearl-pearl-usdr", "address": "0x74ee7376Ac31628a66b2Bb0eb2D14b549AB37275", @@ -138,5 +178,25 @@ "oracleId": "USDR", "decimals": "1e9" } + }, + { + "name": "pearl-matic-usdrv3", + "address": "0x260605380EC5d3378D8E029740831f9D677D2efB", + "gauge": "0x067C9E6107Bd2D1b6385be0BAD82D74d9Fd47612", + "decimals": "1e18", + "chainId": 137, + "beefyFee": 0.095, + "lp0": { + "address": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", + "oracle": "tokens", + "oracleId": "WMATIC", + "decimals": "1e18" + }, + "lp1": { + "address": "0x40379a439D4F6795B6fc9aa5687dB461677A2dBa", + "oracle": "tokens", + "oracleId": "USDR", + "decimals": "1e9" + } } ] diff --git a/src/data/matic/pearlStableLpPools.json b/src/data/matic/pearlStableLpPools.json index 573adc17e..eed974a6c 100644 --- a/src/data/matic/pearlStableLpPools.json +++ b/src/data/matic/pearlStableLpPools.json @@ -1,4 +1,64 @@ [ + { + "name": "pearl-usdrv3-usdt", + "address": "0xE520733f62f99Aa4Fba3024C03BB37BDD18F1d62", + "gauge": "0x2542F85f646cC1eC87C051debf47226aD2523d00", + "decimals": "1e18", + "chainId": 137, + "beefyFee": 0.095, + "lp0": { + "address": "0x40379a439D4F6795B6fc9aa5687dB461677A2dBa", + "oracle": "tokens", + "oracleId": "USDR", + "decimals": "1e9" + }, + "lp1": { + "address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", + "oracle": "tokens", + "oracleId": "USDT", + "decimals": "1e6" + } + }, + { + "name": "pearl-usdrv3-dai", + "address": "0xF78be5C18049E2320D7647e40fD127F5DCBa6717", + "gauge": "0xBE8D6FC6499C2D753aC67db0219378E65e406483", + "decimals": "1e18", + "chainId": 137, + "beefyFee": 0.095, + "lp0": { + "address": "0x40379a439D4F6795B6fc9aa5687dB461677A2dBa", + "oracle": "tokens", + "oracleId": "USDR", + "decimals": "1e9" + }, + "lp1": { + "address": "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063", + "oracle": "tokens", + "oracleId": "DAI", + "decimals": "1e18" + } + }, + { + "name": "pearl-usdc-usdrv3", + "address": "0xa3e39aD6fCD3610B5DF6fD6Da07df3be7cE24302", + "gauge": "0xCDc08E33c6ecdd9A153c1337C9fA1C11d1B1aaCe", + "decimals": "1e18", + "chainId": 137, + "beefyFee": 0.095, + "lp0": { + "address": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", + "oracle": "tokens", + "oracleId": "USDC", + "decimals": "1e6" + }, + "lp1": { + "address": "0x40379a439D4F6795B6fc9aa5687dB461677A2dBa", + "oracle": "tokens", + "oracleId": "USDR", + "decimals": "1e9" + } + }, { "name": "pearl-dai-usdr", "address": "0x6ab291A9BB3C20F0017f2E93A6d1196842D09bF4", From 33ab02ac158d36e9bd2a9a746ca949cabdd90767 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Tue, 1 Aug 2023 09:38:19 +0000 Subject: [PATCH 42/51] ci: version bump to 0.43.47 --- packages/address-book/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/address-book/package.json b/packages/address-book/package.json index bd1c8724e..d9212a3ec 100644 --- a/packages/address-book/package.json +++ b/packages/address-book/package.json @@ -1,6 +1,6 @@ { "name": "blockchain-addressbook", - "version": "0.43.46", + "version": "0.43.47", "description": "A collection of useful addresses on various chains for defi development", "main": "build/address-book/index.js", "types": "build/address-book/index.d.ts", From 73974d4064988697aec04124084f6b08cb81bf64 Mon Sep 17 00:00:00 2001 From: MirthFutures Date: Tue, 1 Aug 2023 09:04:57 -0400 Subject: [PATCH 43/51] Fix GLMR price --- src/data/moonbeam/beamswapLpPools.json | 30 ++++++------- src/data/moonbeam/beamswapStableLpPools.json | 8 ++-- src/data/moonbeam/solarFlareLpPools.json | 30 ++++++------- src/data/moonbeam/stellaswapLpPools.json | 44 ++++++++++---------- src/data/moonbeam/stellaswapLpV2Pools.json | 18 ++++---- src/data/moonbeam/stellaswapStablePools.json | 2 +- 6 files changed, 66 insertions(+), 66 deletions(-) diff --git a/src/data/moonbeam/beamswapLpPools.json b/src/data/moonbeam/beamswapLpPools.json index 0bd721ad4..5521af39a 100644 --- a/src/data/moonbeam/beamswapLpPools.json +++ b/src/data/moonbeam/beamswapLpPools.json @@ -86,7 +86,7 @@ "lp0": { "address": "0x595c8481c48894771CE8FaDE54ac6Bf59093F9E8", "oracle": "tokens", - "oracleId": "BIFI", + "oracleId": "gmultiBIFI", "decimals": "1e18" }, "lp1": { @@ -105,13 +105,13 @@ "lp0": { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" }, "lp1": { "address": "0xC19281F22A075E0F10351cd5D6Ea9f0AC63d4327", "oracle": "tokens", - "oracleId": "FTM", + "oracleId": "gmultiFTM", "decimals": "1e18" } }, @@ -124,13 +124,13 @@ "lp0": { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" }, "lp1": { "address": "0xeFAeeE334F0Fd1712f9a8cc375f427D9Cdd40d73", "oracle": "tokens", - "oracleId": "USDT", + "oracleId": "gmultiUSDT", "decimals": "1e6" } }, @@ -143,7 +143,7 @@ "lp0": { "address": "0xA649325Aa7C5093d12D6F98EB4378deAe68CE23F", "oracle": "tokens", - "oracleId": "BUSD", + "oracleId": "gmultiBUSD", "decimals": "1e18" }, "lp1": { @@ -162,13 +162,13 @@ "lp0": { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" }, "lp1": { "address": "0xfA9343C3897324496A05fC75abeD6bAC29f8A40f", "oracle": "tokens", - "oracleId": "ETH", + "oracleId": "gmultiETH", "decimals": "1e18" } }, @@ -181,13 +181,13 @@ "lp0": { "address": "0xA649325Aa7C5093d12D6F98EB4378deAe68CE23F", "oracle": "tokens", - "oracleId": "BUSD", + "oracleId": "gmultiBUSD", "decimals": "1e18" }, "lp1": { "address": "0xc9BAA8cfdDe8E328787E29b4B078abf2DaDc2055", "oracle": "tokens", - "oracleId": "BNB", + "oracleId": "gmultiBNB", "decimals": "1e18" } }, @@ -200,13 +200,13 @@ "lp0": { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" }, "lp1": { "address": "0xA649325Aa7C5093d12D6F98EB4378deAe68CE23F", "oracle": "tokens", - "oracleId": "BUSD", + "oracleId": "gmultiBUSD", "decimals": "1e18" } }, @@ -238,13 +238,13 @@ "lp0": { "address": "0x765277EebeCA2e31912C9946eAe1021199B39C61", "oracle": "tokens", - "oracleId": "DAI", + "oracleId": "gmultiDAI", "decimals": "1e18" }, "lp1": { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" } }, @@ -257,7 +257,7 @@ "lp0": { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" }, "lp1": { diff --git a/src/data/moonbeam/beamswapStableLpPools.json b/src/data/moonbeam/beamswapStableLpPools.json index e555ab831..f6b650709 100644 --- a/src/data/moonbeam/beamswapStableLpPools.json +++ b/src/data/moonbeam/beamswapStableLpPools.json @@ -34,22 +34,22 @@ "tokens": [ { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" }, { "address": "0xeFAeeE334F0Fd1712f9a8cc375f427D9Cdd40d73", - "oracleId": "USDT", + "oracleId": "gmultiUSDT", "decimals": "1e6" }, { "address": "0x765277EebeCA2e31912C9946eAe1021199B39C61", - "oracleId": "DAI", + "oracleId": "gmultiDAI", "decimals": "1e18" }, { "address": "0xA649325Aa7C5093d12D6F98EB4378deAe68CE23F", - "oracleId": "BUSD", + "oracleId": "gmultiBUSD", "decimals": "1e18" } ] diff --git a/src/data/moonbeam/solarFlareLpPools.json b/src/data/moonbeam/solarFlareLpPools.json index 39de5933d..5a25eab88 100644 --- a/src/data/moonbeam/solarFlareLpPools.json +++ b/src/data/moonbeam/solarFlareLpPools.json @@ -8,7 +8,7 @@ "lp0": { "address": "0x085416975fe14C2A731a97eC38B9bF8135231F62", "oracle": "tokens", - "oracleId": "UST", + "oracleId": "gUST", "decimals": "1e6" }, "lp1": { @@ -27,7 +27,7 @@ "lp0": { "address": "0x31DAB3430f3081dfF3Ccd80F17AD98583437B213", "oracle": "tokens", - "oracleId": "LUNA", + "oracleId": "gLUNA", "decimals": "1e6" }, "lp1": { @@ -46,7 +46,7 @@ "lp0": { "address": "0x1DC78Acda13a8BC4408B207c9E48CDBc096D95e0", "oracle": "tokens", - "oracleId": "WBTC", + "oracleId": "gmultiWBTC", "decimals": "1e8" }, "lp1": { @@ -71,7 +71,7 @@ "lp1": { "address": "0xc9BAA8cfdDe8E328787E29b4B078abf2DaDc2055", "oracle": "tokens", - "oracleId": "BNB", + "oracleId": "gmultiBNB", "decimals": "1e18" } }, @@ -84,7 +84,7 @@ "lp0": { "address": "0x8f552a71EFE5eeFc207Bf75485b356A0b3f01eC9", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" }, "lp1": { @@ -103,13 +103,13 @@ "lp0": { "address": "0x1DC78Acda13a8BC4408B207c9E48CDBc096D95e0", "oracle": "tokens", - "oracleId": "WBTC", + "oracleId": "gmultiWBTC", "decimals": "1e8" }, "lp1": { "address": "0x30D2a9F5FDf90ACe8c17952cbb4eE48a55D916A7", "oracle": "tokens", - "oracleId": "WETH", + "oracleId": "gmultiETH", "decimals": "1e18" } }, @@ -122,13 +122,13 @@ "lp0": { "address": "0xA649325Aa7C5093d12D6F98EB4378deAe68CE23F", "oracle": "tokens", - "oracleId": "BUSD", + "oracleId": "gmultiBUSD", "decimals": "1e18" }, "lp1": { "address": "0xc9BAA8cfdDe8E328787E29b4B078abf2DaDc2055", "oracle": "tokens", - "oracleId": "BNB", + "oracleId": "gmultiBNB", "decimals": "1e18" } }, @@ -160,13 +160,13 @@ "lp0": { "address": "0x8e70cD5B4Ff3f62659049e74b6649c6603A0E594", "oracle": "tokens", - "oracleId": "USDT", + "oracleId": "gmultiUSDT", "decimals": "1e6" }, "lp1": { "address": "0x8f552a71EFE5eeFc207Bf75485b356A0b3f01eC9", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" } }, @@ -179,7 +179,7 @@ "lp0": { "address": "0x30D2a9F5FDf90ACe8c17952cbb4eE48a55D916A7", "oracle": "tokens", - "oracleId": "WETH", + "oracleId": "gmultiETH", "decimals": "1e18" }, "lp1": { @@ -198,13 +198,13 @@ "lp0": { "address": "0x8f552a71EFE5eeFc207Bf75485b356A0b3f01eC9", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" }, "lp1": { "address": "0xA649325Aa7C5093d12D6F98EB4378deAe68CE23F", "oracle": "tokens", - "oracleId": "BUSD", + "oracleId": "gmultiBUSD", "decimals": "1e18" } }, @@ -236,7 +236,7 @@ "lp0": { "address": "0x8f552a71EFE5eeFc207Bf75485b356A0b3f01eC9", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" }, "lp1": { diff --git a/src/data/moonbeam/stellaswapLpPools.json b/src/data/moonbeam/stellaswapLpPools.json index e4be1c226..0c7b587b0 100644 --- a/src/data/moonbeam/stellaswapLpPools.json +++ b/src/data/moonbeam/stellaswapLpPools.json @@ -8,7 +8,7 @@ "lp0": { "address": "0x085416975fe14C2A731a97eC38B9bF8135231F62", "oracle": "tokens", - "oracleId": "UST", + "oracleId": "gUST", "decimals": "1e6" }, "lp1": { @@ -27,7 +27,7 @@ "lp0": { "address": "0x31DAB3430f3081dfF3Ccd80F17AD98583437B213", "oracle": "tokens", - "oracleId": "LUNA", + "oracleId": "gLUNA", "decimals": "1e6" }, "lp1": { @@ -46,13 +46,13 @@ "lp0": { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" }, "lp1": { "address": "0xC19281F22A075E0F10351cd5D6Ea9f0AC63d4327", "oracle": "tokens", - "oracleId": "FTM", + "oracleId": "gmultiFTM", "decimals": "1e18" } }, @@ -71,7 +71,7 @@ "lp1": { "address": "0xC19281F22A075E0F10351cd5D6Ea9f0AC63d4327", "oracle": "tokens", - "oracleId": "FTM", + "oracleId": "gmultiFTM", "decimals": "1e18" } }, @@ -84,13 +84,13 @@ "lp0": { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" }, "lp1": { "address": "0xfA9343C3897324496A05fC75abeD6bAC29f8A40f", "oracle": "tokens", - "oracleId": "ETH", + "oracleId": "gmultiETH", "decimals": "1e18" } }, @@ -109,7 +109,7 @@ "lp1": { "address": "0x3405A1bd46B85c5C029483FbECf2F3E611026e45", "oracle": "tokens", - "oracleId": "MATIC", + "oracleId": "gmultiMATIC", "decimals": "1e18" } }, @@ -122,7 +122,7 @@ "lp0": { "address": "0x3405A1bd46B85c5C029483FbECf2F3E611026e45", "oracle": "tokens", - "oracleId": "MATIC", + "oracleId": "gmultiMATIC", "decimals": "1e18" }, "lp1": { @@ -141,7 +141,7 @@ "lp0": { "address": "0x922D641a426DcFFaeF11680e5358F34d97d112E1", "oracle": "tokens", - "oracleId": "WBTC", + "oracleId": "gmultiWBTC", "decimals": "1e8" }, "lp1": { @@ -160,7 +160,7 @@ "lp0": { "address": "0x4792C1EcB969B036eb51330c63bD27899A13D84e", "oracle": "tokens", - "oracleId": "AVAX", + "oracleId": "gmultiAVAX", "decimals": "1e18" }, "lp1": { @@ -185,7 +185,7 @@ "lp1": { "address": "0x4792C1EcB969B036eb51330c63bD27899A13D84e", "oracle": "tokens", - "oracleId": "AVAX", + "oracleId": "gmultiAVAX", "decimals": "1e18" } }, @@ -198,7 +198,7 @@ "lp0": { "address": "0xA649325Aa7C5093d12D6F98EB4378deAe68CE23F", "oracle": "tokens", - "oracleId": "BUSD", + "oracleId": "gmultiBUSD", "decimals": "1e18" }, "lp1": { @@ -223,7 +223,7 @@ "lp1": { "address": "0xfA9343C3897324496A05fC75abeD6bAC29f8A40f", "oracle": "tokens", - "oracleId": "ETH", + "oracleId": "gmultiETH", "decimals": "1e18" } }, @@ -242,7 +242,7 @@ "lp1": { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" } }, @@ -255,7 +255,7 @@ "lp0": { "address": "0x818ec0a7fe18ff94269904fced6ae3dae6d6dc0b", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" }, "lp1": { @@ -274,13 +274,13 @@ "lp0": { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" }, "lp1": { "address": "0xc9BAA8cfdDe8E328787E29b4B078abf2DaDc2055", "oracle": "tokens", - "oracleId": "BNB", + "oracleId": "gmultiBNB", "decimals": "1e18" } }, @@ -293,13 +293,13 @@ "lp0": { "address": "0x765277eebeca2e31912c9946eae1021199b39c61", "oracle": "tokens", - "oracleId": "DAI", + "oracleId": "gmultiDAI", "decimals": "1e18" }, "lp1": { "address": "0x818ec0a7fe18ff94269904fced6ae3dae6d6dc0b", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" } }, @@ -312,13 +312,13 @@ "lp0": { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" }, "lp1": { "address": "0xeFAeeE334F0Fd1712f9a8cc375f427D9Cdd40d73", "oracle": "tokens", - "oracleId": "USDT", + "oracleId": "gmultiUSDT", "decimals": "1e6" } }, diff --git a/src/data/moonbeam/stellaswapLpV2Pools.json b/src/data/moonbeam/stellaswapLpV2Pools.json index a35fcb2cd..7679af23e 100644 --- a/src/data/moonbeam/stellaswapLpV2Pools.json +++ b/src/data/moonbeam/stellaswapLpV2Pools.json @@ -195,7 +195,7 @@ "lp1": { "address": "0xdFA46478F9e5EA86d57387849598dbFB2e964b02", "oracle": "tokens", - "oracleId": "MAI", + "oracleId": "gMAI", "decimals": "1e18" } }, @@ -209,7 +209,7 @@ "lp0": { "address": "0x9Fda7cEeC4c18008096C2fE2B85F05dc300F94d0", "oracle": "tokens", - "oracleId": "LDO", + "oracleId": "gmultiLDO", "decimals": "1e18" }, "lp1": { @@ -247,7 +247,7 @@ "lp0": { "address": "0x1DC78Acda13a8BC4408B207c9E48CDBc096D95e0", "oracle": "tokens", - "oracleId": "WBTC", + "oracleId": "gmultiWBTC", "decimals": "1e8" }, "lp1": { @@ -272,7 +272,7 @@ "lp1": { "address": "0xCb4A7569a61300C50Cf80A2be16329AD9F5F8F9e", "oracle": "tokens", - "oracleId": "BUSD", + "oracleId": "gmultiBUSD", "decimals": "1e18" } }, @@ -367,7 +367,7 @@ "lp1": { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "gmultiUSDC", "decimals": "1e6" } }, @@ -399,7 +399,7 @@ "lp0": { "address": "0x3D632d9e1a60a0880Dd45E61f279D919b5748377", "oracle": "tokens", - "oracleId": "APE", + "oracleId": "gmultiAPE", "decimals": "1e18" }, "lp1": { @@ -443,7 +443,7 @@ "lp1": { "address": "0x81ECac0D6Be0550A00FF064a4f9dd2400585FE9c", "oracle": "tokens", - "oracleId": "USDTc", + "oracleId": "USDT", "decimals": "1e6" } }, @@ -456,13 +456,13 @@ "lp0": { "address": "0x81ECac0D6Be0550A00FF064a4f9dd2400585FE9c", "oracle": "tokens", - "oracleId": "USDTc", + "oracleId": "USDT", "decimals": "1e6" }, "lp1": { "address": "0xc9BAA8cfdDe8E328787E29b4B078abf2DaDc2055", "oracle": "tokens", - "oracleId": "BNB", + "oracleId": "gmultiBNB", "decimals": "1e18" } } diff --git a/src/data/moonbeam/stellaswapStablePools.json b/src/data/moonbeam/stellaswapStablePools.json index 47db45296..9657808ce 100644 --- a/src/data/moonbeam/stellaswapStablePools.json +++ b/src/data/moonbeam/stellaswapStablePools.json @@ -63,7 +63,7 @@ "tokens": [ { "address": "0xfA9343C3897324496A05fC75abeD6bAC29f8A40f", - "oracleId": "ETH", + "oracleId": "gmultiETH", "decimals": "1e18" }, { From 40d7c6734e6af10a0ea2e851a62f545db746a841 Mon Sep 17 00:00:00 2001 From: MirthFutures Date: Tue, 1 Aug 2023 09:28:27 -0400 Subject: [PATCH 44/51] Fix KAVA USDC price --- src/api/stats/getAmmPrices.ts | 1 + src/data/kava/curvePools.json | 2 +- src/data/kava/equilibreLpPools.json | 66 +++++++++++------------ src/data/kava/equilibreStableLpPools.json | 14 ++--- src/data/kava/sushiKavaLpPools.json | 45 +++++----------- src/utils/fetchChainLinkPrices.ts | 6 +++ 6 files changed, 61 insertions(+), 73 deletions(-) diff --git a/src/api/stats/getAmmPrices.ts b/src/api/stats/getAmmPrices.ts index c3ee28ee5..af29e6c45 100644 --- a/src/api/stats/getAmmPrices.ts +++ b/src/api/stats/getAmmPrices.ts @@ -598,6 +598,7 @@ const seedPeggedPrices = { WAVAX: 'AVAX', // Wrapped native WBNB: 'BNB', // Wrapped native WFTM: 'FTM', // Wrapped native + WKAVA: 'KAVA', // Wrapped native asUSDC: 'USDC', // Solana aUSDT: 'USDT', // Aave aDAI: 'DAI', // Aave diff --git a/src/data/kava/curvePools.json b/src/data/kava/curvePools.json index b31fcc2a8..8748b8e4f 100644 --- a/src/data/kava/curvePools.json +++ b/src/data/kava/curvePools.json @@ -91,7 +91,7 @@ }, { "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "kmultiUSDC", "decimals": "1e6" }, { diff --git a/src/data/kava/equilibreLpPools.json b/src/data/kava/equilibreLpPools.json index d2db96708..b77be75c2 100644 --- a/src/data/kava/equilibreLpPools.json +++ b/src/data/kava/equilibreLpPools.json @@ -19,26 +19,6 @@ "decimals": "1e6" } }, - { - "name": "equilibre-usdt-wkava", - "address": "0xBe87F2e81aa16238445651fAbf62Ae097498C200", - "gauge": "0x5383dEB37479599a33584f7Bbc346ab299e30FF0", - "decimals": "1e18", - "chainId": 2222, - "beefyFee": 0.095, - "lp0": { - "address": "0x919C1c267BC06a7039e03fcc2eF738525769109c", - "oracle": "tokens", - "oracleId": "USDT", - "decimals": "1e6" - }, - "lp1": { - "address": "0xc86c7C0eFbd6A49B35E8714C5f59D99De09A225b", - "oracle": "tokens", - "oracleId": "WKAVA", - "decimals": "1e18" - } - }, { "name": "equilibre-axleth-wkava", "address": "0x93932676cDC21F61fCd476CaaB3Ec3b3F3f347D7", @@ -115,7 +95,7 @@ "lp1": { "address": "0xfA9343C3897324496A05fC75abeD6bAC29f8A40f", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "kmultiUSDC", "decimals": "1e6" } }, @@ -135,7 +115,7 @@ "lp1": { "address": "0xfA9343C3897324496A05fC75abeD6bAC29f8A40f", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "kmultiUSDC", "decimals": "1e6" } }, @@ -149,13 +129,13 @@ "lp0": { "address": "0xE3F5a90F9cb311505cd691a46596599aA1A0AD7D", "oracle": "tokens", - "oracleId": "ETH", + "oracleId": "kmultiETH", "decimals": "1e18" }, "lp1": { "address": "0xfA9343C3897324496A05fC75abeD6bAC29f8A40f", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "kmultiUSDC", "decimals": "1e6" } }, @@ -175,7 +155,7 @@ "lp1": { "address": "0xE3F5a90F9cb311505cd691a46596599aA1A0AD7D", "oracle": "tokens", - "oracleId": "ETH", + "oracleId": "kmultiETH", "decimals": "1e18" } }, @@ -189,7 +169,7 @@ "lp0": { "address": "0xb84Df10966a5D7e1ab46D9276F55d57bD336AFC7", "oracle": "tokens", - "oracleId": "MAI", + "oracleId": "kMAI", "decimals": "1e18" }, "lp1": { @@ -209,7 +189,7 @@ "lp0": { "address": "0xABd380327Fe66724FFDa91A87c772FB8D00bE488", "oracle": "tokens", - "oracleId": "BNB", + "oracleId": "kmultiBNB", "decimals": "1e18" }, "lp1": { @@ -229,7 +209,7 @@ "lp0": { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", "oracle": "tokens", - "oracleId": "WBTC", + "oracleId": "kmultiWBTC", "decimals": "1e8" }, "lp1": { @@ -249,13 +229,13 @@ "lp0": { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", "oracle": "tokens", - "oracleId": "WBTC", + "oracleId": "kmultiWBTC", "decimals": "1e8" }, "lp1": { "address": "0xE3F5a90F9cb311505cd691a46596599aA1A0AD7D", "oracle": "tokens", - "oracleId": "ETH", + "oracleId": "kmultiETH", "decimals": "1e18" } }, @@ -275,7 +255,7 @@ "lp1": { "address": "0xE3F5a90F9cb311505cd691a46596599aA1A0AD7D", "oracle": "tokens", - "oracleId": "ETH", + "oracleId": "kmultiETH", "decimals": "1e18" } }, @@ -315,7 +295,7 @@ "lp1": { "address": "0xfA9343C3897324496A05fC75abeD6bAC29f8A40f", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "kmultiUSDC", "decimals": "1e6" } }, @@ -335,7 +315,7 @@ "lp1": { "address": "0xfA9343C3897324496A05fC75abeD6bAC29f8A40f", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "kmultiUSDC", "decimals": "1e6" } }, @@ -358,5 +338,25 @@ "oracleId": "WKAVA", "decimals": "1e18" } + }, + { + "name": "equilibre-usdt-wkava", + "address": "0xBe87F2e81aa16238445651fAbf62Ae097498C200", + "gauge": "0x5383dEB37479599a33584f7Bbc346ab299e30FF0", + "decimals": "1e18", + "chainId": 2222, + "beefyFee": 0.095, + "lp0": { + "address": "0x919C1c267BC06a7039e03fcc2eF738525769109c", + "oracle": "tokens", + "oracleId": "USDT", + "decimals": "1e6" + }, + "lp1": { + "address": "0xc86c7C0eFbd6A49B35E8714C5f59D99De09A225b", + "oracle": "tokens", + "oracleId": "WKAVA", + "decimals": "1e18" + } } ] diff --git a/src/data/kava/equilibreStableLpPools.json b/src/data/kava/equilibreStableLpPools.json index 45833747e..afdcdac88 100644 --- a/src/data/kava/equilibreStableLpPools.json +++ b/src/data/kava/equilibreStableLpPools.json @@ -35,7 +35,7 @@ "lp1": { "address": "0xb84Df10966a5D7e1ab46D9276F55d57bD336AFC7", "oracle": "tokens", - "oracleId": "MAI", + "oracleId": "kMAI", "decimals": "1e18" } }, @@ -75,7 +75,7 @@ "lp1": { "address": "0xfA9343C3897324496A05fC75abeD6bAC29f8A40f", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "kmultiUSDC", "decimals": "1e6" } }, @@ -95,7 +95,7 @@ "lp1": { "address": "0xfA9343C3897324496A05fC75abeD6bAC29f8A40f", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "kmultiUSDC", "decimals": "1e6" } }, @@ -109,13 +109,13 @@ "lp0": { "address": "0x765277EebeCA2e31912C9946eAe1021199B39C61", "oracle": "tokens", - "oracleId": "DAI", + "oracleId": "kmultiDAI", "decimals": "1e18" }, "lp1": { "address": "0xfA9343C3897324496A05fC75abeD6bAC29f8A40f", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "kmultiUSDC", "decimals": "1e6" } }, @@ -129,13 +129,13 @@ "lp0": { "address": "0xb84Df10966a5D7e1ab46D9276F55d57bD336AFC7", "oracle": "tokens", - "oracleId": "MAI", + "oracleId": "kMAI", "decimals": "1e18" }, "lp1": { "address": "0xfA9343C3897324496A05fC75abeD6bAC29f8A40f", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "kmultiUSDC", "decimals": "1e6" } } diff --git a/src/data/kava/sushiKavaLpPools.json b/src/data/kava/sushiKavaLpPools.json index a9403a601..4494a6aef 100644 --- a/src/data/kava/sushiKavaLpPools.json +++ b/src/data/kava/sushiKavaLpPools.json @@ -1,23 +1,4 @@ [ - { - "name": "sushi-kava-wkava-usdcaxl", - "address": "0xb379Eb428A28a927a16ee7f95100Ac6A5117AaA1", - "decimals": "1e18", - "poolId": 9, - "chainId": 2222, - "lp0": { - "address": "0xc86c7C0eFbd6A49B35E8714C5f59D99De09A225b", - "oracle": "tokens", - "oracleId": "WKAVA", - "decimals": "1e18" - }, - "lp1": { - "address": "0xEB466342C4d449BC9f53A865D5Cb90586f405215", - "oracle": "tokens", - "oracleId": "axlUSDC", - "decimals": "1e6" - } - }, { "name": "sushi-kava-wkava-usdc", "address": "0x88395b86cF9787E131D2fB5462a22b44056BF574", @@ -33,7 +14,7 @@ "lp1": { "address": "0xfA9343C3897324496A05fC75abeD6bAC29f8A40f", "oracle": "tokens", - "oracleId": "USDC", + "oracleId": "kmultiUSDC", "decimals": "1e6" } }, @@ -65,13 +46,13 @@ "lp0": { "address": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b", "oracle": "tokens", - "oracleId": "WBTC", + "oracleId": "kmultiWBTC", "decimals": "1e8" }, "lp1": { "address": "0xE3F5a90F9cb311505cd691a46596599aA1A0AD7D", "oracle": "tokens", - "oracleId": "ETH", + "oracleId": "kmultiETH", "decimals": "1e18" } }, @@ -90,27 +71,27 @@ "lp1": { "address": "0xE3F5a90F9cb311505cd691a46596599aA1A0AD7D", "oracle": "tokens", - "oracleId": "ETH", + "oracleId": "kmultiETH", "decimals": "1e18" } }, { - "name": "sushi-kava-usdt-wkava", - "address": "0x5B3b7e769ebb5F35262B1cE532f230ed4EBB9C51", + "name": "sushi-kava-wkava-usdcaxl", + "address": "0xb379Eb428A28a927a16ee7f95100Ac6A5117AaA1", "decimals": "1e18", - "poolId": 1, + "poolId": 9, "chainId": 2222, "lp0": { - "address": "0xB44a9B6905aF7c801311e8F4E76932ee959c663C", - "oracle": "tokens", - "oracleId": "USDT", - "decimals": "1e6" - }, - "lp1": { "address": "0xc86c7C0eFbd6A49B35E8714C5f59D99De09A225b", "oracle": "tokens", "oracleId": "WKAVA", "decimals": "1e18" + }, + "lp1": { + "address": "0xEB466342C4d449BC9f53A865D5Cb90586f405215", + "oracle": "tokens", + "oracleId": "axlUSDC", + "decimals": "1e6" } } ] diff --git a/src/utils/fetchChainLinkPrices.ts b/src/utils/fetchChainLinkPrices.ts index f78340f53..9e9ab18b4 100644 --- a/src/utils/fetchChainLinkPrices.ts +++ b/src/utils/fetchChainLinkPrices.ts @@ -106,6 +106,12 @@ const oracles: Oracle[] = [ chain: 'fantom', heartbeat: 3600, }, + { + oracleId: 'KAVA', + address: '0x7899dd75C329eFe63e35b02bC7d60D3739FB23c5', + chain: 'polygon', + heartbeat: 3600, + }, ]; export async function fetchChainLinkPrices(): Promise> { From 5440867f8657786c30f5796804beaea691eadcc0 Mon Sep 17 00:00:00 2001 From: MirthFutures Date: Tue, 1 Aug 2023 10:13:39 -0400 Subject: [PATCH 45/51] Update Kava AB naming --- .../address-book/kava/tokens/tokens.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/address-book/address-book/kava/tokens/tokens.ts b/packages/address-book/address-book/kava/tokens/tokens.ts index 1f021370d..258434fb1 100644 --- a/packages/address-book/address-book/kava/tokens/tokens.ts +++ b/packages/address-book/address-book/kava/tokens/tokens.ts @@ -21,7 +21,7 @@ const _tokens = { WNATIVE: KAVA, USDC: { name: 'USD Coin', - symbol: 'USDC', + symbol: 'kmultiUSDC', address: '0xfA9343C3897324496A05fC75abeD6bAC29f8A40f', chainId: 2222, decimals: 6, @@ -58,7 +58,6 @@ const _tokens = { 'Tether is a stablecoin pegged to the US Dollar. A stablecoin is a type of cryptocurrency whose value is pegged to another fiat currency like the US Dollar or to a commodity like Gold. Tether is the first stablecoin to be created and it is the most popular stablecoin used in the ecosystem.', logoURI: 'https://hecoinfo.com/token/images/USDTHECO_32.png', bridge: 'native', - }, DAI: { name: 'Dai Stablecoin', @@ -89,7 +88,7 @@ const _tokens = { WBTC: { name: 'Wrapped BTC', address: '0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b', - symbol: 'WBTC', + symbol: 'kmultiWBTC', decimals: 8, website: 'https://wbtc.network/', description: @@ -102,7 +101,7 @@ const _tokens = { ETH: { name: 'Ether', address: '0xE3F5a90F9cb311505cd691a46596599aA1A0AD7D', - symbol: 'ETH', + symbol: 'kmultiETH', decimals: 18, chainId: 2222, website: 'https://ethereum.org/', @@ -152,7 +151,7 @@ const _tokens = { 'Multi-Collateral Dai (Axelar), brings a lot of new and exciting features, such as support for new CDP collateral types and Dai Savings Rate.', logoURI: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png', - bridge: 'axelar', + bridge: 'axelar', }, VARA: { name: 'VARA', @@ -170,7 +169,7 @@ const _tokens = { }, BIFI: { name: 'Beefy.Finance', - symbol: 'BIFI', + symbol: 'kmultiBIFI', address: '0xC19281F22A075E0F10351cd5D6Ea9f0AC63d4327', chainId: 2222, decimals: 18, @@ -184,7 +183,7 @@ const _tokens = { }, MAI: { name: 'Mai Stablecoin', - symbol: 'MAI', + symbol: 'kMAI', address: '0xb84Df10966a5D7e1ab46D9276F55d57bD336AFC7', chainId: 2222, decimals: 18, @@ -196,7 +195,7 @@ const _tokens = { }, BNB: { name: 'Binance Chain', - symbol: 'BNB', + symbol: 'kmultiBNB', address: '0xABd380327Fe66724FFDa91A87c772FB8D00bE488', chainId: 2222, decimals: 18, @@ -243,7 +242,7 @@ const _tokens = { 'You, the Spellcaster, can provide collateral in the form of various interest bearing crypto assets such as yvYFI, yvUSDT, yvUSDC, xSUSHI and more. With this, you can borrow magic internet money (MIM) which is a stable coin that you can swap for any other traditional stable coin.', logoURI: '', documentation: 'https://docs.abracadabra.money/', - bridge: 'layer-zero' + bridge: 'layer-zero', }, axlETH: { name: 'Axelar Wrapped ETH', From 38fcb9cfc7c7e7547d5da666b28a31903f2bee9e Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Tue, 1 Aug 2023 14:14:38 +0000 Subject: [PATCH 46/51] ci: version bump to 0.43.48 --- packages/address-book/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/address-book/package.json b/packages/address-book/package.json index d9212a3ec..27735e37f 100644 --- a/packages/address-book/package.json +++ b/packages/address-book/package.json @@ -1,6 +1,6 @@ { "name": "blockchain-addressbook", - "version": "0.43.47", + "version": "0.43.48", "description": "A collection of useful addresses on various chains for defi development", "main": "build/address-book/index.js", "types": "build/address-book/index.d.ts", From e02f3bb13af4f6f0753477f8b18cb39aa3025f86 Mon Sep 17 00:00:00 2001 From: MirthFutures Date: Tue, 1 Aug 2023 11:01:15 -0400 Subject: [PATCH 47/51] Change USDC ID in kava ab --- packages/address-book/address-book/kava/tokens/tokens.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/address-book/address-book/kava/tokens/tokens.ts b/packages/address-book/address-book/kava/tokens/tokens.ts index 258434fb1..33f6d3a2e 100644 --- a/packages/address-book/address-book/kava/tokens/tokens.ts +++ b/packages/address-book/address-book/kava/tokens/tokens.ts @@ -19,7 +19,7 @@ const _tokens = { KAVA, WKAVA: KAVA, WNATIVE: KAVA, - USDC: { + kmultiUSDC: { name: 'USD Coin', symbol: 'kmultiUSDC', address: '0xfA9343C3897324496A05fC75abeD6bAC29f8A40f', From c7eff31ba732407a107ae5f743e638ff3139d3b5 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Tue, 1 Aug 2023 15:02:31 +0000 Subject: [PATCH 48/51] ci: version bump to 0.43.49 --- packages/address-book/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/address-book/package.json b/packages/address-book/package.json index 27735e37f..b8918ef73 100644 --- a/packages/address-book/package.json +++ b/packages/address-book/package.json @@ -1,6 +1,6 @@ { "name": "blockchain-addressbook", - "version": "0.43.48", + "version": "0.43.49", "description": "A collection of useful addresses on various chains for defi development", "main": "build/address-book/index.js", "types": "build/address-book/index.d.ts", From a20707a93af443cb163ff5f15d15a68fdb04e868 Mon Sep 17 00:00:00 2001 From: chebiN <17909998+seguido@users.noreply.github.com> Date: Tue, 1 Aug 2023 15:27:07 -0300 Subject: [PATCH 49/51] remove eth-cvx nft from treasury assets --- src/api/treasury/nftAssets.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/api/treasury/nftAssets.ts b/src/api/treasury/nftAssets.ts index c121f25a2..243137b7a 100644 --- a/src/api/treasury/nftAssets.ts +++ b/src/api/treasury/nftAssets.ts @@ -12,15 +12,6 @@ export const treasuryConcLiquidityAssets: Partial Date: Thu, 20 Jul 2023 21:30:31 -0700 Subject: [PATCH 50/51] Remove VelocimeterV1 LPs --- .../canto/platforms/velocimeter.ts | 2 - .../address-book/canto/tokens/tokens.ts | 12 -- src/api/stats/canto/getVelocimeterApys.js | 44 +------ .../stats/canto/getVelocimeterStablePrices.js | 5 +- src/api/stats/getAmmPrices.ts | 2 - src/data/canto/velocimeterLpPools.json | 122 ------------------ src/data/canto/velocimeterStableLpPools.json | 22 ---- 7 files changed, 7 insertions(+), 202 deletions(-) delete mode 100644 src/data/canto/velocimeterLpPools.json delete mode 100644 src/data/canto/velocimeterStableLpPools.json diff --git a/packages/address-book/address-book/canto/platforms/velocimeter.ts b/packages/address-book/address-book/canto/platforms/velocimeter.ts index 04070e482..a98956c1c 100644 --- a/packages/address-book/address-book/canto/platforms/velocimeter.ts +++ b/packages/address-book/address-book/canto/platforms/velocimeter.ts @@ -1,7 +1,5 @@ export const velocimeter = { - routerv1: '0x9B2920e72dF6E1A7053bEa7235c65079F5104398', router: '0x8e2e2f70B4bD86F82539187A634FB832398cc771', - voterv1: '0xC5B58aE761a77fF16d548dE9b42933c8FBfe4c33', voter: '0x8e3525Dbc8356c08d2d55F3ACb6416b5979D3389', bifiCantoLp: '0x2dBFeB48dEaccBFf9b0a54dEd1BC172e135a809C', } as const; diff --git a/packages/address-book/address-book/canto/tokens/tokens.ts b/packages/address-book/address-book/canto/tokens/tokens.ts index 2b9a50795..1d28e8b99 100644 --- a/packages/address-book/address-book/canto/tokens/tokens.ts +++ b/packages/address-book/address-book/canto/tokens/tokens.ts @@ -88,18 +88,6 @@ const _tokens = { 'Tether is a stablecoin pegged to the US Dollar. A stablecoin is a type of cryptocurrency whose value is pegged to another fiat currency like the US Dollar or to a commodity like Gold. Tether is the first stablecoin to be created and it is the most popular stablecoin used in the ecosystem.', logoURI: '', }, - FLOWV1: { - name: 'Velocimeter', - symbol: 'FLOWv1', - address: '0x2Baec546a92cA3469f71b7A091f7dF61e5569889', - chainId: 7700, - decimals: 18, - logoURI: '', - website: 'https://canto.velocimeter.xyz/home', - description: - 'Velocimeter addresses these issues and presents an attractive alternative by addressing the core issues in Solidly and adding its own improvements. To recall, the key innovation of Solidly was to align protocol emissions with fees generated, not simply liquidity. To do this, it would allow protocols and other large stakeholders to become veNFT "voters", using their locked voting power to direct future emissions and collecting fees (termed bribes in Solidly) from the pools they voted for.', - documentation: 'https://docs.velocimeter.xyz/', - }, GRAV: { name: 'Graviton', symbol: 'GRAV', diff --git a/src/api/stats/canto/getVelocimeterApys.js b/src/api/stats/canto/getVelocimeterApys.js index 53b1bbd81..856e1e4b9 100644 --- a/src/api/stats/canto/getVelocimeterApys.js +++ b/src/api/stats/canto/getVelocimeterApys.js @@ -1,60 +1,26 @@ const { CANTO_CHAIN_ID: chainId } = require('../../../constants'); -import { getEDecimals } from '../../../utils/getEDecimals'; const { getSolidlyGaugeApys } = require('../common/getSolidlyGaugeApys'); -const stablePools = require('../../../data/canto/velocimeterStableLpPools.json'); -const volatilePools = require('../../../data/canto/velocimeterLpPools.json'); + const stableV2Pools = require('../../../data/canto/velocimeterV2StableLpPools.json'); const volatileV2Pools = require('../../../data/canto/velocimeterV2LpPools.json'); - import { addressBook } from '../../../../packages/address-book/address-book'; const { canto: { - tokens: { FLOWV1, FLOW }, + tokens: { FLOW }, }, } = addressBook; -const pools = [...stablePools, ...volatilePools]; const poolsV2 = [...stableV2Pools, ...volatileV2Pools]; -const getVelocimeterApys = async () => { - const gaugeApys = getSolidlyGaugeApys({ - chainId: chainId, - pools: pools, - oracleId: 'FLOWV1', - oracle: 'tokens', - decimals: getEDecimals(FLOWV1.decimals), - reward: FLOWV1.address, - boosted: false, - // log: true, - }); - - const gaugeV2Apys = getSolidlyGaugeApys({ +const getVelocimeterApys = async () => + getSolidlyGaugeApys({ chainId: chainId, pools: poolsV2, oracleId: 'FLOW', oracle: 'tokens', - decimals: getEDecimals(FLOW.decimals), + decimals: '1e18', reward: FLOW.address, boosted: false, // log: true, }); - let apys = {}; - let apyBreakdowns = {}; - - const results = await Promise.allSettled([gaugeApys, gaugeV2Apys]); - for (const result of results) { - if (result.status !== 'fulfilled') { - console.warn('getVelocimeterApys error', result.reason); - } else { - apys = { ...apys, ...result.value.apys }; - apyBreakdowns = { ...apyBreakdowns, ...result.value.apyBreakdowns }; - } - } - - return { - apys, - apyBreakdowns, - }; -}; - module.exports = getVelocimeterApys; diff --git a/src/api/stats/canto/getVelocimeterStablePrices.js b/src/api/stats/canto/getVelocimeterStablePrices.js index df79f439b..f8e00aa11 100644 --- a/src/api/stats/canto/getVelocimeterStablePrices.js +++ b/src/api/stats/canto/getVelocimeterStablePrices.js @@ -1,10 +1,9 @@ const getSolidlyStablePrices = require('../common/getSolidlyStablePrices'); -const v1pools = require('../../../data/canto/velocimeterStableLpPools.json'); const v2pools = require('../../../data/canto/velocimeterV2StableLpPools.json'); const { CANTO_CHAIN_ID } = require('../../../constants'); -const pools = [...v1pools, ...v2pools]; + const getVelocimeterStablePrices = async tokenPrices => { - return await getSolidlyStablePrices(CANTO_CHAIN_ID, pools, tokenPrices); + return await getSolidlyStablePrices(CANTO_CHAIN_ID, v2pools, tokenPrices); }; module.exports = getVelocimeterStablePrices; diff --git a/src/api/stats/getAmmPrices.ts b/src/api/stats/getAmmPrices.ts index 983f8ef92..c98e9190e 100644 --- a/src/api/stats/getAmmPrices.ts +++ b/src/api/stats/getAmmPrices.ts @@ -261,7 +261,6 @@ import synapseLpPools from '../../data/ethereum/synapseLpPools.json'; import solidlyLpPools from '../../data/ethereum/solidlyLpPools.json'; import cantoLpPools from '../../data/canto/cantoLpPools.json'; import solidLizardPools from '../../data/arbitrum/solidlizardLpPools.json'; -import velocimeterPools from '../../data/canto/velocimeterLpPools.json'; import velocimeterV2Pools from '../../data/canto/velocimeterV2LpPools.json'; import equilibrePools from '../../data/kava/equilibreLpPools.json'; import versePools from '../../data/ethereum/verseLpPools.json'; @@ -298,7 +297,6 @@ const pools = normalizePoolOracleIds([ ...versePools, ...equilibrePools, ...velocimeterV2Pools, - ...velocimeterPools, ...solidLizardPools, ...cantoLpPools, ...solidlyLpPools, diff --git a/src/data/canto/velocimeterLpPools.json b/src/data/canto/velocimeterLpPools.json deleted file mode 100644 index 3ef860f58..000000000 --- a/src/data/canto/velocimeterLpPools.json +++ /dev/null @@ -1,122 +0,0 @@ -[ - { - "name": "velocimeter-flow-wcanto", - "address": "0x862050752bE9F4ae310FC8A58C9208eE3fa22148", - "gauge": "0xFD2F8bD82b0ecAcbe42BD9097c36EA667B66A023", - "decimals": "1e18", - "chainId": 7700, - "beefyFee": 0.095, - "lp0": { - "address": "0x2Baec546a92cA3469f71b7A091f7dF61e5569889", - "oracle": "tokens", - "oracleId": "FLOWV1", - "decimals": "1e18" - }, - "lp1": { - "address": "0x826551890Dc65655a0Aceca109aB11AbDbD7a07B", - "oracle": "tokens", - "oracleId": "WCANTO", - "decimals": "1e18" - } - }, - { - "name": "velocimeter-note-grav", - "address": "0x9AFE631835cdBced9D6159c7Ba9083000F3042b3", - "gauge": "0xEE364d444350683589481D9cef5c4048f591FbB0", - "decimals": "1e18", - "chainId": 7700, - "beefyFee": 0.095, - "lp0": { - "address": "0x4e71A2E537B7f9D9413D3991D37958c0b5e1e503", - "oracle": "tokens", - "oracleId": "NOTE", - "decimals": "1e18" - }, - "lp1": { - "address": "0xc03345448969Dd8C00e9E4A85d2d9722d093aF8E", - "oracle": "tokens", - "oracleId": "GRAV", - "decimals": "1e6" - } - }, - { - "name": "velocimeter-flow-note", - "address": "0xa694B9527Bc94D99F8C382D942C1D992166c4434", - "gauge": "0x31FAA19b132Ef9c5978fdA13AC5c6bFd8C2Fc279", - "decimals": "1e18", - "chainId": 7700, - "beefyFee": 0.095, - "lp0": { - "address": "0x2Baec546a92cA3469f71b7A091f7dF61e5569889", - "oracle": "tokens", - "oracleId": "FLOWV1", - "decimals": "1e18" - }, - "lp1": { - "address": "0x4e71A2E537B7f9D9413D3991D37958c0b5e1e503", - "oracle": "tokens", - "oracleId": "NOTE", - "decimals": "1e18" - } - }, - { - "name": "velocimeter-wcanto-atom", - "address": "0xa87B17Fc81bECf329860097b20073AAD86BAca9d", - "gauge": "0xBa6118e533Eb9012c8125c604D19485639e14096", - "decimals": "1e18", - "chainId": 7700, - "beefyFee": 0.095, - "lp0": { - "address": "0x826551890Dc65655a0Aceca109aB11AbDbD7a07B", - "oracle": "tokens", - "oracleId": "WCANTO", - "decimals": "1e18" - }, - "lp1": { - "address": "0xecEEEfCEE421D8062EF8d6b4D814efe4dc898265", - "oracle": "tokens", - "oracleId": "ATOM", - "decimals": "1e6" - } - }, - { - "name": "velocimeter-usdc-wcanto", - "address": "0xA4Ed386124c023aCA6AA89b184F90e1375eE677c", - "gauge": "0x82FfFFDb581eb28448ba1aB0A3c8BA553981e3ad", - "decimals": "1e18", - "chainId": 7700, - "beefyFee": 0.095, - "lp0": { - "address": "0x80b5a32E4F032B2a058b4F29EC95EEfEEB87aDcd", - "oracle": "tokens", - "oracleId": "USDC", - "decimals": "1e6" - }, - "lp1": { - "address": "0x826551890Dc65655a0Aceca109aB11AbDbD7a07B", - "oracle": "tokens", - "oracleId": "WCANTO", - "decimals": "1e18" - } - }, - { - "name": "velocimeter-note-wcanto", - "address": "0xE5A5A9699D75536ceC2Fc0c682C16A56dF811eD9", - "gauge": "0x8C58052EB6263dB1623390202AdB3390f40E2258", - "decimals": "1e18", - "chainId": 7700, - "beefyFee": 0.095, - "lp0": { - "address": "0x4e71A2E537B7f9D9413D3991D37958c0b5e1e503", - "oracle": "tokens", - "oracleId": "NOTE", - "decimals": "1e18" - }, - "lp1": { - "address": "0x826551890Dc65655a0Aceca109aB11AbDbD7a07B", - "oracle": "tokens", - "oracleId": "WCANTO", - "decimals": "1e18" - } - } -] diff --git a/src/data/canto/velocimeterStableLpPools.json b/src/data/canto/velocimeterStableLpPools.json deleted file mode 100644 index 51233da4b..000000000 --- a/src/data/canto/velocimeterStableLpPools.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "name": "velocimeter-note-usdc", - "address": "0x94C1dFfefa4eaC0801e3af0EE7108d8a08CF5f9e", - "gauge": "0x7a475831e2F4911287dDF3BACe5146388974aba5", - "decimals": "1e18", - "chainId": 7700, - "beefyFee": 0.095, - "lp0": { - "address": "0x4e71A2E537B7f9D9413D3991D37958c0b5e1e503", - "oracle": "tokens", - "oracleId": "NOTE", - "decimals": "1e18" - }, - "lp1": { - "address": "0x80b5a32E4F032B2a058b4F29EC95EEfEEB87aDcd", - "oracle": "tokens", - "oracleId": "USDC", - "decimals": "1e6" - } - } -] From 01877c8dc906c0629f9995d045e48547d2d58034 Mon Sep 17 00:00:00 2001 From: shatterproof <4100078+shatterproof@users.noreply.github.com> Date: Tue, 1 Aug 2023 15:15:13 -0700 Subject: [PATCH 51/51] Add Velocimeter CVM --- package.json | 2 +- .../address-book/address-book/canto/index.ts | 2 + .../address-book/canto/platforms/cvm.ts | 4 ++ .../address-book/canto/tokens/tokens.ts | 24 +++++++++++ .../address-book/fantom/tokens/tokens.ts | 2 +- scripts/add-solidly.ts | 12 +++--- src/api/stats/canto/getCvmApys.js | 26 ++++++++++++ src/api/stats/canto/getVelocimeterApys.js | 8 ++-- .../stats/canto/getVelocimeterStablePrices.js | 4 +- src/api/stats/canto/index.js | 4 +- src/data/canto/cvmLpPools.json | 42 +++++++++++++++++++ src/data/canto/cvmStableLpPools.json | 1 + 12 files changed, 115 insertions(+), 16 deletions(-) create mode 100644 packages/address-book/address-book/canto/platforms/cvm.ts create mode 100644 src/api/stats/canto/getCvmApys.js create mode 100644 src/data/canto/cvmLpPools.json create mode 100644 src/data/canto/cvmStableLpPools.json diff --git a/package.json b/package.json index 57903b931..388c62ba3 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "bsc:swapfish:add": "ts-node scripts/add-farm.ts --network bsc --project swapfishBsc --newFee true", "bsc:thena:add": "ts-node scripts/add-solidly.ts --network bsc --project thena --newFee true --lp", "bsc:thena:gamma:add": "ts-node scripts/add-gamma.ts --network bsc --project thena --lp", - "canto:velocimeter:add": "ts-node scripts/add-solidly.ts --network canto --project velocimeter --newFee true --lp", + "canto:cvm:add": "ts-node scripts/add-solidly.ts --network canto --project cvm --newFee true --lp", "fantom:spooky:add": "ts-node scripts/add-farm.ts --network fantom --project spooky", "fantom:spiritv:add": "ts-node scripts/add-solidly.ts --network fantom --project spiritVolatile --newFee true", "fantom:spirits:add": "ts-node scripts/add-solidly.ts --network fantom --project spiritStable --newFee true", diff --git a/packages/address-book/address-book/canto/index.ts b/packages/address-book/address-book/canto/index.ts index dfc1e9580..8ffec694c 100644 --- a/packages/address-book/address-book/canto/index.ts +++ b/packages/address-book/address-book/canto/index.ts @@ -1,5 +1,6 @@ import { beefyfinance } from './platforms/beefyfinance'; import { velocimeter } from './platforms/velocimeter'; +import { cvm } from './platforms/cvm'; import { tokens } from './tokens/tokens'; import { convertSymbolTokenMapToAddressTokenMap } from '../../util/convertSymbolTokenMapToAddressTokenMap'; import Chain from '../../types/chain'; @@ -9,6 +10,7 @@ const _canto = { platforms: { beefyfinance, velocimeter, + cvm, }, tokens, tokenAddressMap: convertSymbolTokenMapToAddressTokenMap(tokens), diff --git a/packages/address-book/address-book/canto/platforms/cvm.ts b/packages/address-book/address-book/canto/platforms/cvm.ts new file mode 100644 index 000000000..4504331ae --- /dev/null +++ b/packages/address-book/address-book/canto/platforms/cvm.ts @@ -0,0 +1,4 @@ +export const cvm = { + router: '0x2c8F86334552d062A0d7465C7f524eff15AB046c', + voter: '0xd5FA5bfd83ea4A088a3A28E12AD6494750aC7B8c', +} as const; diff --git a/packages/address-book/address-book/canto/tokens/tokens.ts b/packages/address-book/address-book/canto/tokens/tokens.ts index 1d28e8b99..939cf9d6e 100644 --- a/packages/address-book/address-book/canto/tokens/tokens.ts +++ b/packages/address-book/address-book/canto/tokens/tokens.ts @@ -262,6 +262,30 @@ const _tokens = { '$BLOTR is the governance token for $sCANTO (Liquid Staked Canto) used to vote on protocol upgrades, incentivize $sCANTO liquidity pools, and for other future protocol mechanisms.', documentation: 'https://docs.scanto.io/governance-token', }, + CVM: { + name: 'Canto Velocimeter', + symbol: 'CVM', + address: '0xbAD86785eB08fe9d0948B7D9d24523000A177cD0', + chainId: 7700, + decimals: 18, + logoURI: '', + website: 'https://cantov3.velocimeter.xyz', + description: + 'CVM is the native token for Velocimeter on Canto (CVM), a project providing liquidity on the chain where it is needed most. The CVM token can be locked to earn rewards on the CVM platform.', + documentation: 'https://docs.velocimeter.xyz/tokenomics', + }, + oCVM: { + name: 'Option to buy CVM', + symbol: 'oCVM', + address: '0x5C2a258A169Fd683e784686E606E33f6D8c31b9a', + chainId: 7700, + decimals: 18, + logoURI: '', + website: 'https://cantov3.velocimeter.xyz', + description: + 'oCVM is an options token that helps to reduce sell pressure on the native CVM token. It is earned by liquidity providers (LPs) who provide liquidity to the CVM pools. oCVM can be redeemed for CVM at a discount, or it can be locked up for a period of time as veCVM. veCVM is a governance token that allows holders to vote on the distribution of emissions, as well as receive weekly bribes and fees.', + documentation: 'https://docs.velocimeter.xyz/oFVMmech', + }, } as const; export const tokens: ConstRecord = _tokens; diff --git a/packages/address-book/address-book/fantom/tokens/tokens.ts b/packages/address-book/address-book/fantom/tokens/tokens.ts index 31ae16af9..5968a1fee 100644 --- a/packages/address-book/address-book/fantom/tokens/tokens.ts +++ b/packages/address-book/address-book/fantom/tokens/tokens.ts @@ -1949,7 +1949,7 @@ const _tokens = { website: 'https://www.fvm.exchange', bridge: 'native', description: - 'oFVM is a new options token that helps to reduce sell pressure on the native FVM token. It is earned by liquidity providers (LPs) who provide liquidity to the FVM-FTM pool. oFVM can be redeemed for FVM at a discount, or it can be locked up for a period of time as veFVM. veFVM is a governance token that allows holders to vote on the distribution of emissions, as well as receive weekly bribes and fees.', + 'oFVM is an options token that helps to reduce sell pressure on the native FVM token. It is earned by liquidity providers (LPs) who provide liquidity to the FVM pools. oFVM can be redeemed for FVM at a discount, or it can be locked up for a period of time as veFVM. veFVM is a governance token that allows holders to vote on the distribution of emissions, as well as receive weekly bribes and fees.', documentation: 'https://docs.velocimeter.xyz/oFVMmech', }, } as const; diff --git a/scripts/add-solidly.ts b/scripts/add-solidly.ts index 10906ec73..b5ec7ef85 100644 --- a/scripts/add-solidly.ts +++ b/scripts/add-solidly.ts @@ -31,7 +31,7 @@ const { platforms: { solidlizard }, }, canto: { - platforms: { velocimeter }, + platforms: { cvm }, }, kava: { platforms: { equilibre }, @@ -112,11 +112,11 @@ const projects = { volatileFile: '../src/data/arbitrum/solidlizardLpPools.json', voter: solidlizard.voter, }, - velocimeter: { - prefix: 'velocimeterv2', - stableFile: '../src/data/canto/velocimeterV2StableLpPools.json', - volatileFile: '../src/data/canto/velocimeterV2LpPools.json', - voter: velocimeter.voter, + cvm: { + prefix: 'cvm', + stableFile: '../src/data/canto/cvmStableLpPools.json', + volatileFile: '../src/data/canto/cvmLpPools.json', + voter: cvm.voter, }, velocore: { prefix: 'velocore', diff --git a/src/api/stats/canto/getCvmApys.js b/src/api/stats/canto/getCvmApys.js new file mode 100644 index 000000000..0b5c87100 --- /dev/null +++ b/src/api/stats/canto/getCvmApys.js @@ -0,0 +1,26 @@ +const { CANTO_CHAIN_ID: chainId } = require('../../../constants'); +const { getSolidlyGaugeApys } = require('../common/getSolidlyGaugeApys'); + +const stablePools = require('../../../data/canto/cvmStableLpPools.json'); +const volatilePools = require('../../../data/canto/cvmLpPools.json'); +import { addressBook } from '../../../../packages/address-book/address-book'; +const { + canto: { + tokens: { CVM }, + }, +} = addressBook; + +const pools = [...stablePools, ...volatilePools]; +const getCvmApys = async () => + getSolidlyGaugeApys({ + chainId: chainId, + pools: pools, + oracleId: 'oCVM', + oracle: 'tokens', + decimals: '1e18', + reward: CVM.address, + boosted: false, + // log: true, + }); + +module.exports = getCvmApys; diff --git a/src/api/stats/canto/getVelocimeterApys.js b/src/api/stats/canto/getVelocimeterApys.js index 856e1e4b9..915fc2128 100644 --- a/src/api/stats/canto/getVelocimeterApys.js +++ b/src/api/stats/canto/getVelocimeterApys.js @@ -1,8 +1,8 @@ const { CANTO_CHAIN_ID: chainId } = require('../../../constants'); const { getSolidlyGaugeApys } = require('../common/getSolidlyGaugeApys'); -const stableV2Pools = require('../../../data/canto/velocimeterV2StableLpPools.json'); -const volatileV2Pools = require('../../../data/canto/velocimeterV2LpPools.json'); +const stablePools = require('../../../data/canto/velocimeterV2StableLpPools.json'); +const volatilePools = require('../../../data/canto/velocimeterV2LpPools.json'); import { addressBook } from '../../../../packages/address-book/address-book'; const { canto: { @@ -10,11 +10,11 @@ const { }, } = addressBook; -const poolsV2 = [...stableV2Pools, ...volatileV2Pools]; +const pools = [...stablePools, ...volatilePools]; const getVelocimeterApys = async () => getSolidlyGaugeApys({ chainId: chainId, - pools: poolsV2, + pools: pools, oracleId: 'FLOW', oracle: 'tokens', decimals: '1e18', diff --git a/src/api/stats/canto/getVelocimeterStablePrices.js b/src/api/stats/canto/getVelocimeterStablePrices.js index f8e00aa11..4c34ec75d 100644 --- a/src/api/stats/canto/getVelocimeterStablePrices.js +++ b/src/api/stats/canto/getVelocimeterStablePrices.js @@ -1,9 +1,9 @@ const getSolidlyStablePrices = require('../common/getSolidlyStablePrices'); -const v2pools = require('../../../data/canto/velocimeterV2StableLpPools.json'); +const pools = require('../../../data/canto/velocimeterV2StableLpPools.json'); const { CANTO_CHAIN_ID } = require('../../../constants'); const getVelocimeterStablePrices = async tokenPrices => { - return await getSolidlyStablePrices(CANTO_CHAIN_ID, v2pools, tokenPrices); + return await getSolidlyStablePrices(CANTO_CHAIN_ID, pools, tokenPrices); }; module.exports = getVelocimeterStablePrices; diff --git a/src/api/stats/canto/index.js b/src/api/stats/canto/index.js index 9dad9a080..5b86a1bc8 100644 --- a/src/api/stats/canto/index.js +++ b/src/api/stats/canto/index.js @@ -1,9 +1,9 @@ const getCantoLpApys = require('./getCantoLpApys'); -const getVelocimeterApys = require('./getVelocimeterApys'); +const getCvmApys = require('./getCvmApys'); const getCantoBifiGovApy = require('./getCantoBifiGovApy'); const { getCantoBifiMaxiApy } = require('./getCantoBifiMaxiApy'); -const getApys = [getCantoLpApys, getVelocimeterApys, getCantoBifiGovApy, getCantoBifiMaxiApy]; +const getApys = [getCantoLpApys, getCvmApys, getCantoBifiGovApy, getCantoBifiMaxiApy]; const getCantoApys = async () => { const start = Date.now(); diff --git a/src/data/canto/cvmLpPools.json b/src/data/canto/cvmLpPools.json new file mode 100644 index 000000000..bd8058ffc --- /dev/null +++ b/src/data/canto/cvmLpPools.json @@ -0,0 +1,42 @@ +[ + { + "name": "cvm-scanto-cvm", + "address": "0xf976E39201bD847D38B92A6b19b5106809C09391", + "gauge": "0x59314fE93468141b143B549dAad76Ec959B269D6", + "decimals": "1e18", + "chainId": 7700, + "beefyFee": 0.095, + "lp0": { + "address": "0x9F823D534954Fc119E31257b3dDBa0Db9E2Ff4ed", + "oracle": "tokens", + "oracleId": "sCANTO", + "decimals": "1e18" + }, + "lp1": { + "address": "0xbAD86785eB08fe9d0948B7D9d24523000A177cD0", + "oracle": "tokens", + "oracleId": "CVM", + "decimals": "1e18" + } + }, + { + "name": "cvm-wcanto-scanto", + "address": "0xa934F9F89b085332181267C0EcE69E9b2Ce745C8", + "gauge": "0x319aCC5A29E13e45f77b5320eC8f2d2c735259dB", + "decimals": "1e18", + "chainId": 7700, + "beefyFee": 0.095, + "lp0": { + "address": "0x826551890Dc65655a0Aceca109aB11AbDbD7a07B", + "oracle": "tokens", + "oracleId": "WCANTO", + "decimals": "1e18" + }, + "lp1": { + "address": "0x9F823D534954Fc119E31257b3dDBa0Db9E2Ff4ed", + "oracle": "tokens", + "oracleId": "sCANTO", + "decimals": "1e18" + } + } +] diff --git a/src/data/canto/cvmStableLpPools.json b/src/data/canto/cvmStableLpPools.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/src/data/canto/cvmStableLpPools.json @@ -0,0 +1 @@ +[]