From 358ffa9965ec61102bf109ac4e0cae2afb83391d Mon Sep 17 00:00:00 2001 From: tommy4241 Date: Thu, 25 Aug 2022 00:33:02 +1000 Subject: [PATCH 1/3] Implement idle-tranche strategy apy --- data/constants.js | 1 + data/icons/idletranche-wsteth.png | Bin 0 -> 25248 bytes data/icons/wsteth.png | Bin 0 -> 1628 bytes data/mainnet/addresses.json | 9 + data/mainnet/pools.js | 32 + data/mainnet/tokens.js | 31 + src/lib/web3/contracts/idle-cdo/contract.json | 649 ++++++++++++++++++ src/lib/web3/contracts/idle-cdo/methods.js | 7 + .../idle-gauge-controller/contract.json | 424 ++++++++++++ .../idle-gauge-controller/methods.js | 8 + .../idle-gauge-distributor/contract.json | 230 +++++++ .../idle-gauge-distributor/methods.js | 7 + .../idle-liquidity-gauge/contract.json | 556 +++++++++++++++ .../contracts/idle-liquidity-gauge/methods.js | 9 + .../contracts/idle-multi-reward/contract.json | 365 ++++++++++ .../contracts/idle-multi-reward/methods.js | 8 + .../web3/contracts/lido-wsteth/contract.json | 207 ++++++ src/lib/web3/contracts/lido-wsteth/methods.js | 5 + .../implementations/idle-finance-tranche.js | 99 +++ 19 files changed, 2647 insertions(+) create mode 100644 data/icons/idletranche-wsteth.png create mode 100644 data/icons/wsteth.png create mode 100644 src/lib/web3/contracts/idle-cdo/contract.json create mode 100644 src/lib/web3/contracts/idle-cdo/methods.js create mode 100644 src/lib/web3/contracts/idle-gauge-controller/contract.json create mode 100644 src/lib/web3/contracts/idle-gauge-controller/methods.js create mode 100644 src/lib/web3/contracts/idle-gauge-distributor/contract.json create mode 100644 src/lib/web3/contracts/idle-gauge-distributor/methods.js create mode 100644 src/lib/web3/contracts/idle-liquidity-gauge/contract.json create mode 100644 src/lib/web3/contracts/idle-liquidity-gauge/methods.js create mode 100644 src/lib/web3/contracts/idle-multi-reward/contract.json create mode 100644 src/lib/web3/contracts/idle-multi-reward/methods.js create mode 100644 src/lib/web3/contracts/lido-wsteth/contract.json create mode 100644 src/lib/web3/contracts/lido-wsteth/methods.js create mode 100644 src/vaults/apys/implementations/idle-finance-tranche.js diff --git a/data/constants.js b/data/constants.js index 5384409..949b0d6 100644 --- a/data/constants.js +++ b/data/constants.js @@ -154,6 +154,7 @@ const ESTIMATED_APY_TYPES = { NOTIONAL: 'NOTIONAL', APE: 'APE', MESHSWAP: 'MESHSWAP', + IDLE_FINANCE_TRANCHE: 'IDLE_FINANCE_TRANCHE', } const COLLATERAL_TYPE = { diff --git a/data/icons/idletranche-wsteth.png b/data/icons/idletranche-wsteth.png new file mode 100644 index 0000000000000000000000000000000000000000..3be119573ba2a52c98edd438a66ca10ca6fa1627 GIT binary patch literal 25248 zcmd43i93|x_dh;Dwovv=$P$$z3EB5lLb7E~D(jHlFoW!rE!lU|Xqk zUIm_Xk70s={|Fr3D9I5_bUyF|ej)q(T-N~vqM*I_AppfEGJ!zv6<;XGYPu$_Cy^u? ze5^Tt;WMEB^KL8pH~D?%LdNb2V<97O@L%be+;k(pclz`r6y(9&*Y&uP=x9jOB8lF3 zX+D>ebHi|<$`X=#KJ6zSczWOwW(RAo35U4mAc_0YKAcs?KHper#rOvFd3H-5RxyppRPXIZYZ3-c*whv zCuuj{F~lAN3>s3~n1tgNGP+ccI>#rG!lyS+PjlT}5YO0C{7YHtisdNq6rRFHN{ z4*2n7_uw>{00cT@r)m0WuFREC|EWKHdV;fG`rbZn+5NC z$5hzp%*9k`J~65;%?=ShNt@dXyxt_kEHQIU#S0j zLcJ?=3(%dTw&IAdBsr=1Ikz7wVI}s5rvU3t;*bBf(d!SV z)Y!`%5wsenL7^LTV+0@>mm#&;bo4qQ*+8Pu9^2g_$}^rMGBbaZw@dn>6ko9L+*d-r z8qOPJg__K>?@XXteQa{-EFh5M)u6zZc^OeV`eH34Nn>dJ79;$tDckKI2dvX{r`A37 zlT|FwrxNr|Z1i1XH!+kTP=^B-gJqf6Yxjx3EK4*K^hb=+?2aRsTnIv|IPAN&coJ^o zj$m%z)7RpOnR7XzO$VFTK%n^>E40$DjZ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-ME?2z09b!>0ydx!*wa@x2HU@4jycLfZ4fAQPEDx>DE zdi2}aV=gx|`b}vGaJ?S{K&y}+rxwZM(Gy!!%r`bGD?|?JLJrt)n-G*|Nex1N`v>fzpzPJ=Fd#D zNdw(8i5%0v@VkfBH?>_2UNf&~>S*ttg(qdRXifu_73N8Nf)i#*cG?(SfbYz6oeSEn zGD0nGvKeu$-M&Wr5O-ylw!T7BC+_Whr65W@|tR2ApF=3h@cM^ zukP#-)qpHn$6$Bl@lR>}@@6e^RqaOkS`(;w{^5s=Hk)6lDE1V)^7QcnTy4RGEjuhq z^YQ^e#}>{2*YA}zWbysgTRW%pmgzld@LY%Z;qPDrUFB5|Pw6Ftb0#6{5&-hF`;n`0 zov`*!{KhT#aTzb$b{~;|&|Lx0#sO{ntTO+!Kn#bo9Ix_dx2|n(D%8gFNj>}XEb0e~ z#cBK+{2gsaRKfMwRxSszekyBj>?pK_%}7&HFH|(Pg!ECT0=d!Js#pgM-50pVIj|`-4967hJ%9VZfe^W0MX6 z4F;jOA@v||@Q`T+xZk0|)AFCNHNnnEYi zNkPSgHpDwuzO9CHRojsr)wlKr|I%qFF{HBVjgS`;A_1~$h7j<|4^~%ty}37vHVbxl zjnBljN3VMMFS~UU<=l7m;eW}jHlqs5{fXp}e{Q#h<9nk=X-SL@9bT{QmRzO|L&TTX zZIV7>)wXrsHf?iL4A71rkzUW2?uT^=)7NcNC#K&N*RGHZ}ih zms1w$4ERjQJ|{!$UW{x&Y`s(w9J>8bUgQP_R(3t7LdzMgC=Ic{Ls#a)eVL}P;u-u^JjVFf_hov2J3Ioc_E@ld|2OV2?&uloVsz{x{tG^^WX}Kq literal 0 HcmV?d00001 diff --git a/data/icons/wsteth.png b/data/icons/wsteth.png new file mode 100644 index 0000000000000000000000000000000000000000..14c1e2863cf57f7deaf5278430b5741efc615fb3 GIT binary patch literal 1628 zcmV-i2BZ0jP)004R>004l5008;`004mK004C`008P>0026e000+ooVrmw00006 zVoOIv0RI600RN!9r;`8x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mm0mpg~W$vq@S;~cdxzGRj~gYyl@CkT4*NhfsFwHqLDlk zuE;a01R|D#eW#@lsfX(7*)`ICJpMI&Fb05UK#F)cALEigA!FfckX zFgi3dD=;uRFfjK93Z?)603~!qSaf7zbY(hiZ)9m^c>ppnGBGVNFfA}QR4_0)F)%tb aGb=DKIxsMXTe2De0000 + Deposit and stake: +
    +
  1. + Go to  + + Lido + + and wrap stETH into wstETH and +
  2. +
  3. + Go back to this vault, hit "MAX" and then "Deposit". Leave + "Stake for rewards" checked for staking +
  4. +
+ + `, + }, { chain: CHAINS_ID.ETH_MAINNET, id: 'convex_DOLA_FRAXBP', diff --git a/data/mainnet/tokens.js b/data/mainnet/tokens.js index 6aa5d5f..158c04c 100644 --- a/data/mainnet/tokens.js +++ b/data/mainnet/tokens.js @@ -45,6 +45,37 @@ module.exports = { ], cmcRewardTokenSymbols: ['FARM', 'WETH'], }, + wstETH: { + isNew: true, + category: VAULT_CATEGORIES_IDS.IDLE, + chain: CHAINS_ID.ETH_MAINNET, + logoUrl: './icons/wsteth.png', + apyIconUrls: ['./icons/idle.png', './icons/ldo.png'], + apyTokenSymbols: ['IDLE', 'LDO'], + displayName: 'wstETH', + subLabel: 'Idle Finance Tranche', + tokenAddress: addresses.V2.wstETH.Underlying, + decimals: '18', + vaultAddress: addresses.V2.wstETH.NewVault, + priceFunction: { + type: GET_PRICE_TYPES.COINGECKO_CONTRACT, + params: [addresses.WSTETH], + }, + estimateApyFunctions: [ + { + type: ESTIMATED_APY_TYPES.IDLE_FINANCE_TRANCHE, + params: [ + addresses.V2.wstETH.TrancheCDO, + addresses.V2.wstETH.LiquidityGauge, + [addresses.LDO], + addresses.WSTETH, + true, + '0.7', + ], + }, + ], + cmcRewardTokenSymbols: ['iFARM', 'IDLE', 'LDO'], + }, USDD: { chain: CHAINS_ID.ETH_MAINNET, logoUrl: './icons/usdd.png', diff --git a/src/lib/web3/contracts/idle-cdo/contract.json b/src/lib/web3/contracts/idle-cdo/contract.json new file mode 100644 index 0000000..a0f1b38 --- /dev/null +++ b/src/lib/web3/contracts/idle-cdo/contract.json @@ -0,0 +1,649 @@ +{ + "abi": [ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "account", "type": "address" } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { "indexed": false, "internalType": "address", "name": "_ref", "type": "address" } + ], + "name": "Referral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "account", "type": "address" } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "AAStaking", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "AATranche", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BBStaking", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BBTranche", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FULL_ALLOC", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_FEE", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ONE_TRANCHE_TOKEN", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_limit", "type": "uint256" }], + "name": "_setLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "allowAAWithdraw", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "allowBBWithdraw", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], + "name": "depositAA", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { "internalType": "address", "name": "_referral", "type": "address" } + ], + "name": "depositAARef", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], + "name": "depositBB", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { "internalType": "address", "name": "_referral", "type": "address" } + ], + "name": "depositBBRef", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "emergencyShutdown", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "fee", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feeReceiver", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feeSplit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_tranche", "type": "address" }], + "name": "getApr", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getContractValue", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentAARatio", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_tranche", "type": "address" }], + "name": "getIdealApr", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getIncentiveTokens", + "outputs": [{ "internalType": "address[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governanceRecoveryFund", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guardian", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bool[]", "name": "_skipFlags", "type": "bool[]" }, + { "internalType": "bool[]", "name": "_skipReward", "type": "bool[]" }, + { "internalType": "uint256[]", "name": "_minAmount", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "_sellAmounts", "type": "uint256[]" }, + { "internalType": "bytes", "name": "_extraData", "type": "bytes" } + ], + "name": "harvest", + "outputs": [{ "internalType": "uint256[][]", "name": "_res", "type": "uint256[][]" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "idealRange", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "incentiveTokens", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_limit", "type": "uint256" }, + { "internalType": "address", "name": "_guardedToken", "type": "address" }, + { "internalType": "address", "name": "_governanceFund", "type": "address" }, + { "internalType": "address", "name": "_owner", "type": "address" }, + { "internalType": "address", "name": "_rebalancer", "type": "address" }, + { "internalType": "address", "name": "_strategy", "type": "address" }, + { "internalType": "uint256", "name": "_trancheAPRSplitRatio", "type": "uint256" }, + { "internalType": "uint256", "name": "_trancheIdealWeightRatio", "type": "uint256" }, + { "internalType": "address[]", "name": "_incentiveTokens", "type": "address[]" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isAYSActive", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastNAVAA", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastNAVBB", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastStrategyPrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "limit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { "internalType": "bool", "name": "_revertIfNeeded", "type": "bool" } + ], + "name": "liquidate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "oneToken", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "priceAA", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "priceBB", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rebalancer", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "referral", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releaseBlocksPeriod", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revertIfTooLow", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "_allowed", "type": "bool" }], + "name": "setAllowAAWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "_allowed", "type": "bool" }], + "name": "setAllowBBWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_fee", "type": "uint256" }], + "name": "setFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_feeReceiver", "type": "address" }], + "name": "setFeeReceiver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_feeSplit", "type": "uint256" }], + "name": "setFeeSplit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_guardian", "type": "address" }], + "name": "setGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_idealRange", "type": "uint256" }], + "name": "setIdealRange", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address[]", "name": "_incentiveTokens", "type": "address[]" }], + "name": "setIncentiveTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "_active", "type": "bool" }], + "name": "setIsAYSActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "_isStkAAVEActive", "type": "bool" }], + "name": "setIsStkAAVEActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_rebalancer", "type": "address" }], + "name": "setRebalancer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_referral", "type": "address" }], + "name": "setReferral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_releaseBlocksPeriod", "type": "uint256" }], + "name": "setReleaseBlocksPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "_allowed", "type": "bool" }], + "name": "setRevertIfTooLow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "_allowed", "type": "bool" }], + "name": "setSkipDefaultCheck", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_AAStaking", "type": "address" }, + { "internalType": "address", "name": "_BBStaking", "type": "address" } + ], + "name": "setStakingRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_strategy", "type": "address" }, + { "internalType": "address[]", "name": "_incentiveTokens", "type": "address[]" } + ], + "name": "setStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_trancheAPRSplitRatio", "type": "uint256" }], + "name": "setTrancheAPRSplitRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_trancheIdealWeightRatio", "type": "uint256" } + ], + "name": "setTrancheIdealWeightRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_unlentPerc", "type": "uint256" }], + "name": "setUnlentPerc", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "skipDefaultCheck", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "strategy", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "strategyToken", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "trancheAPRSplitRatio", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "trancheIdealWeightRatio", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_tranche", "type": "address" }], + "name": "tranchePrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_token", "type": "address" }, + { "internalType": "uint256", "name": "_value", "type": "uint256" } + ], + "name": "transferToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unclaimedFees", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unlentPerc", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_tranche", "type": "address" }], + "name": "virtualPrice", + "outputs": [{ "internalType": "uint256", "name": "_virtualPrice", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "weth", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], + "name": "withdrawAA", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], + "name": "withdrawBB", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/src/lib/web3/contracts/idle-cdo/methods.js b/src/lib/web3/contracts/idle-cdo/methods.js new file mode 100644 index 0000000..a990514 --- /dev/null +++ b/src/lib/web3/contracts/idle-cdo/methods.js @@ -0,0 +1,7 @@ +const { countFunctionCall } = require('../..') + +const priceAA = instance => countFunctionCall(instance.methods.priceAA().call()) + +module.exports = { + priceAA, +} diff --git a/src/lib/web3/contracts/idle-gauge-controller/contract.json b/src/lib/web3/contracts/idle-gauge-controller/contract.json new file mode 100644 index 0000000..01ab3f7 --- /dev/null +++ b/src/lib/web3/contracts/idle-gauge-controller/contract.json @@ -0,0 +1,424 @@ +{ + "address": { + "ropsten": "", + "mainnet": "0xaC69078141f76A1e257Ee889920d02Cc547d632f" + }, + "abi": [ + { + "name": "CommitOwnership", + "inputs": [{ "name": "admin", "type": "address", "indexed": false }], + "anonymous": false, + "type": "event" + }, + { + "name": "ApplyOwnership", + "inputs": [{ "name": "admin", "type": "address", "indexed": false }], + "anonymous": false, + "type": "event" + }, + { + "name": "AddType", + "inputs": [ + { "name": "name", "type": "string", "indexed": false }, + { "name": "type_id", "type": "int128", "indexed": false } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "NewTypeWeight", + "inputs": [ + { "name": "type_id", "type": "int128", "indexed": false }, + { "name": "time", "type": "uint256", "indexed": false }, + { "name": "weight", "type": "uint256", "indexed": false }, + { "name": "total_weight", "type": "uint256", "indexed": false } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "NewGaugeWeight", + "inputs": [ + { "name": "gauge_address", "type": "address", "indexed": false }, + { "name": "time", "type": "uint256", "indexed": false }, + { "name": "weight", "type": "uint256", "indexed": false }, + { "name": "total_weight", "type": "uint256", "indexed": false } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "VoteForGauge", + "inputs": [ + { "name": "time", "type": "uint256", "indexed": false }, + { "name": "user", "type": "address", "indexed": false }, + { "name": "gauge_addr", "type": "address", "indexed": false }, + { "name": "weight", "type": "uint256", "indexed": false } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "NewGauge", + "inputs": [ + { "name": "addr", "type": "address", "indexed": false }, + { "name": "gauge_type", "type": "int128", "indexed": false }, + { "name": "weight", "type": "uint256", "indexed": false } + ], + "anonymous": false, + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "constructor", + "inputs": [{ "name": "_voting_escrow", "type": "address" }], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "commit_transfer_ownership", + "inputs": [{ "name": "addr", "type": "address" }], + "outputs": [], + "gas": 38895 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "apply_transfer_ownership", + "inputs": [], + "outputs": [], + "gas": 41034 + }, + { + "stateMutability": "view", + "type": "function", + "name": "gauge_types", + "inputs": [{ "name": "_addr", "type": "address" }], + "outputs": [{ "name": "", "type": "int128" }], + "gas": 3014 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "add_gauge", + "inputs": [ + { "name": "addr", "type": "address" }, + { "name": "gauge_type", "type": "int128" } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "add_gauge", + "inputs": [ + { "name": "addr", "type": "address" }, + { "name": "gauge_type", "type": "int128" }, + { "name": "weight", "type": "uint256" } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "checkpoint", + "inputs": [], + "outputs": [], + "gas": 18271410417 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "checkpoint_gauge", + "inputs": [{ "name": "addr", "type": "address" }], + "outputs": [], + "gas": 18325922441 + }, + { + "stateMutability": "view", + "type": "function", + "name": "gauge_relative_weight", + "inputs": [{ "name": "addr", "type": "address" }], + "outputs": [{ "name": "", "type": "uint256" }] + }, + { + "stateMutability": "view", + "type": "function", + "name": "gauge_relative_weight", + "inputs": [ + { "name": "addr", "type": "address" }, + { "name": "time", "type": "uint256" } + ], + "outputs": [{ "name": "", "type": "uint256" }] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "gauge_relative_weight_write", + "inputs": [{ "name": "addr", "type": "address" }], + "outputs": [{ "name": "", "type": "uint256" }] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "gauge_relative_weight_write", + "inputs": [ + { "name": "addr", "type": "address" }, + { "name": "time", "type": "uint256" } + ], + "outputs": [{ "name": "", "type": "uint256" }] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "add_type", + "inputs": [{ "name": "_name", "type": "string" }], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "add_type", + "inputs": [ + { "name": "_name", "type": "string" }, + { "name": "weight", "type": "uint256" } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "change_type_weight", + "inputs": [ + { "name": "type_id", "type": "int128" }, + { "name": "weight", "type": "uint256" } + ], + "outputs": [], + "gas": 36722675398 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "change_gauge_weight", + "inputs": [ + { "name": "addr", "type": "address" }, + { "name": "weight", "type": "uint256" } + ], + "outputs": [], + "gas": 36831772473 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "vote_for_gauge_weights", + "inputs": [ + { "name": "_gauge_addr", "type": "address" }, + { "name": "_user_weight", "type": "uint256" } + ], + "outputs": [], + "gas": 18380903247 + }, + { + "stateMutability": "view", + "type": "function", + "name": "get_gauge_weight", + "inputs": [{ "name": "addr", "type": "address" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 5290 + }, + { + "stateMutability": "view", + "type": "function", + "name": "get_type_weight", + "inputs": [{ "name": "type_id", "type": "int128" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 5331 + }, + { + "stateMutability": "view", + "type": "function", + "name": "get_total_weight", + "inputs": [], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 5020 + }, + { + "stateMutability": "view", + "type": "function", + "name": "get_weights_sum_per_type", + "inputs": [{ "name": "type_id", "type": "int128" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 5391 + }, + { + "stateMutability": "view", + "type": "function", + "name": "admin", + "inputs": [], + "outputs": [{ "name": "", "type": "address" }], + "gas": 2868 + }, + { + "stateMutability": "view", + "type": "function", + "name": "future_admin", + "inputs": [], + "outputs": [{ "name": "", "type": "address" }], + "gas": 2898 + }, + { + "stateMutability": "view", + "type": "function", + "name": "voting_escrow", + "inputs": [], + "outputs": [{ "name": "", "type": "address" }], + "gas": 2928 + }, + { + "stateMutability": "view", + "type": "function", + "name": "n_gauge_types", + "inputs": [], + "outputs": [{ "name": "", "type": "int128" }], + "gas": 2958 + }, + { + "stateMutability": "view", + "type": "function", + "name": "n_gauges", + "inputs": [], + "outputs": [{ "name": "", "type": "int128" }], + "gas": 2988 + }, + { + "stateMutability": "view", + "type": "function", + "name": "gauge_type_names", + "inputs": [{ "name": "arg0", "type": "int128" }], + "outputs": [{ "name": "", "type": "string" }], + "gas": 13544 + }, + { + "stateMutability": "view", + "type": "function", + "name": "gauges", + "inputs": [{ "name": "arg0", "type": "uint256" }], + "outputs": [{ "name": "", "type": "address" }], + "gas": 3093 + }, + { + "stateMutability": "view", + "type": "function", + "name": "vote_user_slopes", + "inputs": [ + { "name": "arg0", "type": "address" }, + { "name": "arg1", "type": "address" } + ], + "outputs": [ + { "name": "slope", "type": "uint256" }, + { "name": "power", "type": "uint256" }, + { "name": "end", "type": "uint256" } + ], + "gas": 8108 + }, + { + "stateMutability": "view", + "type": "function", + "name": "vote_user_power", + "inputs": [{ "name": "arg0", "type": "address" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3323 + }, + { + "stateMutability": "view", + "type": "function", + "name": "last_user_vote", + "inputs": [ + { "name": "arg0", "type": "address" }, + { "name": "arg1", "type": "address" } + ], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3568 + }, + { + "stateMutability": "view", + "type": "function", + "name": "points_weight", + "inputs": [ + { "name": "arg0", "type": "address" }, + { "name": "arg1", "type": "uint256" } + ], + "outputs": [ + { "name": "bias", "type": "uint256" }, + { "name": "slope", "type": "uint256" } + ], + "gas": 5888 + }, + { + "stateMutability": "view", + "type": "function", + "name": "time_weight", + "inputs": [{ "name": "arg0", "type": "address" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3413 + }, + { + "stateMutability": "view", + "type": "function", + "name": "points_sum", + "inputs": [ + { "name": "arg0", "type": "int128" }, + { "name": "arg1", "type": "uint256" } + ], + "outputs": [ + { "name": "bias", "type": "uint256" }, + { "name": "slope", "type": "uint256" } + ], + "gas": 6029 + }, + { + "stateMutability": "view", + "type": "function", + "name": "time_sum", + "inputs": [{ "name": "arg0", "type": "uint256" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3303 + }, + { + "stateMutability": "view", + "type": "function", + "name": "points_total", + "inputs": [{ "name": "arg0", "type": "uint256" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3403 + }, + { + "stateMutability": "view", + "type": "function", + "name": "time_total", + "inputs": [], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3318 + }, + { + "stateMutability": "view", + "type": "function", + "name": "points_type_weight", + "inputs": [ + { "name": "arg0", "type": "int128" }, + { "name": "arg1", "type": "uint256" } + ], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3759 + }, + { + "stateMutability": "view", + "type": "function", + "name": "time_type_weight", + "inputs": [{ "name": "arg0", "type": "uint256" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3423 + } + ] +} diff --git a/src/lib/web3/contracts/idle-gauge-controller/methods.js b/src/lib/web3/contracts/idle-gauge-controller/methods.js new file mode 100644 index 0000000..7297701 --- /dev/null +++ b/src/lib/web3/contracts/idle-gauge-controller/methods.js @@ -0,0 +1,8 @@ +const { countFunctionCall } = require('../..') + +const gaugeRelativeWeight = (gauge, instance) => + countFunctionCall(instance.methods.gauge_relative_weight(gauge).call()) + +module.exports = { + gaugeRelativeWeight, +} diff --git a/src/lib/web3/contracts/idle-gauge-distributor/contract.json b/src/lib/web3/contracts/idle-gauge-distributor/contract.json new file mode 100644 index 0000000..d27cae2 --- /dev/null +++ b/src/lib/web3/contracts/idle-gauge-distributor/contract.json @@ -0,0 +1,230 @@ +{ + "address": { + "ropsten": "", + "mainnet": "0x1276A8ee84900bD8CcA6e9b3ccB99FF4771Fe329" + }, + "abi": [ + { + "inputs": [ + { "internalType": "contract IERC20", "name": "_idle", "type": "address" }, + { "internalType": "address", "name": "_treasury", "type": "address" }, + { "internalType": "address", "name": "_emergencyAdmin", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "time", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "rate", "type": "uint256" } + ], + "name": "UpdateDistributionParameters", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldProxy", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newProxy", "type": "address" } + ], + "name": "UpdateDistributorProxy", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "rate", "type": "uint256" } + ], + "name": "UpdatePendingRate", + "type": "event" + }, + { + "inputs": [], + "name": "EPOCH_DURATION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INITIAL_DISTRIBUTION_DELAY", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INITIAL_RATE", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ONE_WEEK", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "availableToDistribute", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "distribute", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "distributed", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "distributorProxy", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "emergencyAdmin", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], + "name": "emergencyWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "epochNumber", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochStartingDistributed", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "futureEpochTimeWrite", + "outputs": [{ "internalType": "uint256", "name": "_futureEpochTime", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "ratePerEpoch", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "proxy", "type": "address" }], + "name": "setDistributorProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "emergencyAdmin_", "type": "address" }], + "name": "setEmergencyAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newRate", "type": "uint256" }], + "name": "setPendingRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "startEpochTime", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startEpochTimeWrite", + "outputs": [{ "internalType": "uint256", "name": "_startEpochTime", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "updateDistributionParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/src/lib/web3/contracts/idle-gauge-distributor/methods.js b/src/lib/web3/contracts/idle-gauge-distributor/methods.js new file mode 100644 index 0000000..ac91077 --- /dev/null +++ b/src/lib/web3/contracts/idle-gauge-distributor/methods.js @@ -0,0 +1,7 @@ +const { countFunctionCall } = require('../..') + +const rate = instance => countFunctionCall(instance.methods.rate().call()) + +module.exports = { + rate, +} diff --git a/src/lib/web3/contracts/idle-liquidity-gauge/contract.json b/src/lib/web3/contracts/idle-liquidity-gauge/contract.json new file mode 100644 index 0000000..7e26b69 --- /dev/null +++ b/src/lib/web3/contracts/idle-liquidity-gauge/contract.json @@ -0,0 +1,556 @@ +{ + "abi": [ + { + "name": "Deposit", + "inputs": [ + { "name": "provider", "type": "address", "indexed": true }, + { "name": "value", "type": "uint256", "indexed": false } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Withdraw", + "inputs": [ + { "name": "provider", "type": "address", "indexed": true }, + { "name": "value", "type": "uint256", "indexed": false } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "UpdateLiquidityLimit", + "inputs": [ + { "name": "user", "type": "address", "indexed": false }, + { "name": "original_balance", "type": "uint256", "indexed": false }, + { "name": "original_supply", "type": "uint256", "indexed": false }, + { "name": "working_balance", "type": "uint256", "indexed": false }, + { "name": "working_supply", "type": "uint256", "indexed": false } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "CommitOwnership", + "inputs": [{ "name": "admin", "type": "address", "indexed": false }], + "anonymous": false, + "type": "event" + }, + { + "name": "ApplyOwnership", + "inputs": [{ "name": "admin", "type": "address", "indexed": false }], + "anonymous": false, + "type": "event" + }, + { + "name": "Transfer", + "inputs": [ + { "name": "_from", "type": "address", "indexed": true }, + { "name": "_to", "type": "address", "indexed": true }, + { "name": "_value", "type": "uint256", "indexed": false } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Approval", + "inputs": [ + { "name": "_owner", "type": "address", "indexed": true }, + { "name": "_spender", "type": "address", "indexed": true }, + { "name": "_value", "type": "uint256", "indexed": false } + ], + "anonymous": false, + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "constructor", + "inputs": [ + { "name": "_lp_token", "type": "address" }, + { "name": "_distributor_proxy", "type": "address" }, + { "name": "_admin", "type": "address" } + ], + "outputs": [] + }, + { + "stateMutability": "view", + "type": "function", + "name": "decimals", + "inputs": [], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 288 + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_checkpoint", + "inputs": [], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 4560 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "user_checkpoint", + "inputs": [{ "name": "addr", "type": "address" }], + "outputs": [{ "name": "", "type": "bool" }], + "gas": 3133382 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claimable_tokens", + "inputs": [{ "name": "addr", "type": "address" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3046449 + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_contract", + "inputs": [], + "outputs": [{ "name": "", "type": "address" }], + "gas": 2718 + }, + { + "stateMutability": "view", + "type": "function", + "name": "last_claim", + "inputs": [], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 2544 + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimed_reward", + "inputs": [ + { "name": "_addr", "type": "address" }, + { "name": "_token", "type": "address" } + ], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3066 + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimable_reward", + "inputs": [ + { "name": "_addr", "type": "address" }, + { "name": "_token", "type": "address" } + ], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3034 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claimable_reward_write", + "inputs": [ + { "name": "_addr", "type": "address" }, + { "name": "_token", "type": "address" } + ], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 1209922 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_rewards_receiver", + "inputs": [{ "name": "_receiver", "type": "address" }], + "outputs": [], + "gas": 35733 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [{ "name": "_addr", "type": "address" }], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [ + { "name": "_addr", "type": "address" }, + { "name": "_receiver", "type": "address" } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "kick", + "inputs": [{ "name": "addr", "type": "address" }], + "outputs": [], + "gas": 3147973 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [{ "name": "_value", "type": "uint256" }], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [ + { "name": "_value", "type": "uint256" }, + { "name": "_addr", "type": "address" } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [ + { "name": "_value", "type": "uint256" }, + { "name": "_addr", "type": "address" }, + { "name": "_claim_rewards", "type": "bool" } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "withdraw", + "inputs": [{ "name": "_value", "type": "uint256" }], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "withdraw", + "inputs": [ + { "name": "_value", "type": "uint256" }, + { "name": "_claim_rewards", "type": "bool" } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "transfer", + "inputs": [ + { "name": "_to", "type": "address" }, + { "name": "_value", "type": "uint256" } + ], + "outputs": [{ "name": "", "type": "bool" }], + "gas": 17167132 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "transferFrom", + "inputs": [ + { "name": "_from", "type": "address" }, + { "name": "_to", "type": "address" }, + { "name": "_value", "type": "uint256" } + ], + "outputs": [{ "name": "", "type": "bool" }], + "gas": 17205082 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "approve", + "inputs": [ + { "name": "_spender", "type": "address" }, + { "name": "_value", "type": "uint256" } + ], + "outputs": [{ "name": "", "type": "bool" }], + "gas": 38211 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "increaseAllowance", + "inputs": [ + { "name": "_spender", "type": "address" }, + { "name": "_added_value", "type": "uint256" } + ], + "outputs": [{ "name": "", "type": "bool" }], + "gas": 40755 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "decreaseAllowance", + "inputs": [ + { "name": "_spender", "type": "address" }, + { "name": "_subtracted_value", "type": "uint256" } + ], + "outputs": [{ "name": "", "type": "bool" }], + "gas": 40779 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_rewards", + "inputs": [ + { "name": "_reward_contract", "type": "address" }, + { "name": "_sigs", "type": "bytes32" }, + { "name": "_reward_tokens", "type": "address[8]" } + ], + "outputs": [], + "gas": 2740447 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_killed", + "inputs": [{ "name": "_is_killed", "type": "bool" }], + "outputs": [], + "gas": 38145 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "commit_transfer_ownership", + "inputs": [{ "name": "addr", "type": "address" }], + "outputs": [], + "gas": 39525 + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "accept_transfer_ownership", + "inputs": [], + "outputs": [], + "gas": 39470 + }, + { + "stateMutability": "view", + "type": "function", + "name": "distributor_proxy", + "inputs": [], + "outputs": [{ "name": "", "type": "address" }], + "gas": 3078 + }, + { + "stateMutability": "view", + "type": "function", + "name": "distributor", + "inputs": [], + "outputs": [{ "name": "", "type": "address" }], + "gas": 3108 + }, + { + "stateMutability": "view", + "type": "function", + "name": "lp_token", + "inputs": [], + "outputs": [{ "name": "", "type": "address" }], + "gas": 3138 + }, + { + "stateMutability": "view", + "type": "function", + "name": "controller", + "inputs": [], + "outputs": [{ "name": "", "type": "address" }], + "gas": 3168 + }, + { + "stateMutability": "view", + "type": "function", + "name": "voting_escrow", + "inputs": [], + "outputs": [{ "name": "", "type": "address" }], + "gas": 3198 + }, + { + "stateMutability": "view", + "type": "function", + "name": "future_epoch_time", + "inputs": [], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3228 + }, + { + "stateMutability": "view", + "type": "function", + "name": "balanceOf", + "inputs": [{ "name": "arg0", "type": "address" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3473 + }, + { + "stateMutability": "view", + "type": "function", + "name": "totalSupply", + "inputs": [], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3288 + }, + { + "stateMutability": "view", + "type": "function", + "name": "allowance", + "inputs": [ + { "name": "arg0", "type": "address" }, + { "name": "arg1", "type": "address" } + ], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3748 + }, + { + "stateMutability": "view", + "type": "function", + "name": "name", + "inputs": [], + "outputs": [{ "name": "", "type": "string" }], + "gas": 13578 + }, + { + "stateMutability": "view", + "type": "function", + "name": "symbol", + "inputs": [], + "outputs": [{ "name": "", "type": "string" }], + "gas": 11331 + }, + { + "stateMutability": "view", + "type": "function", + "name": "working_balances", + "inputs": [{ "name": "arg0", "type": "address" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3623 + }, + { + "stateMutability": "view", + "type": "function", + "name": "working_supply", + "inputs": [], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3438 + }, + { + "stateMutability": "view", + "type": "function", + "name": "period", + "inputs": [], + "outputs": [{ "name": "", "type": "int128" }], + "gas": 3468 + }, + { + "stateMutability": "view", + "type": "function", + "name": "period_timestamp", + "inputs": [{ "name": "arg0", "type": "uint256" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3543 + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_inv_supply", + "inputs": [{ "name": "arg0", "type": "uint256" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3573 + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_inv_supply_of", + "inputs": [{ "name": "arg0", "type": "address" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3773 + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_checkpoint_of", + "inputs": [{ "name": "arg0", "type": "address" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3803 + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_fraction", + "inputs": [{ "name": "arg0", "type": "address" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3833 + }, + { + "stateMutability": "view", + "type": "function", + "name": "inflation_rate", + "inputs": [], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3648 + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_tokens", + "inputs": [{ "name": "arg0", "type": "uint256" }], + "outputs": [{ "name": "", "type": "address" }], + "gas": 3723 + }, + { + "stateMutability": "view", + "type": "function", + "name": "rewards_receiver", + "inputs": [{ "name": "arg0", "type": "address" }], + "outputs": [{ "name": "", "type": "address" }], + "gas": 3923 + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_integral", + "inputs": [{ "name": "arg0", "type": "address" }], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 3953 + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_integral_for", + "inputs": [ + { "name": "arg0", "type": "address" }, + { "name": "arg1", "type": "address" } + ], + "outputs": [{ "name": "", "type": "uint256" }], + "gas": 4198 + }, + { + "stateMutability": "view", + "type": "function", + "name": "admin", + "inputs": [], + "outputs": [{ "name": "", "type": "address" }], + "gas": 3798 + }, + { + "stateMutability": "view", + "type": "function", + "name": "future_admin", + "inputs": [], + "outputs": [{ "name": "", "type": "address" }], + "gas": 3828 + }, + { + "stateMutability": "view", + "type": "function", + "name": "is_killed", + "inputs": [], + "outputs": [{ "name": "", "type": "bool" }], + "gas": 3858 + } + ] +} diff --git a/src/lib/web3/contracts/idle-liquidity-gauge/methods.js b/src/lib/web3/contracts/idle-liquidity-gauge/methods.js new file mode 100644 index 0000000..7ae70fa --- /dev/null +++ b/src/lib/web3/contracts/idle-liquidity-gauge/methods.js @@ -0,0 +1,9 @@ +const { countFunctionCall } = require('../..') + +const rewardContract = instance => countFunctionCall(instance.methods.reward_contract().call()) +const totalSupply = instance => countFunctionCall(instance.methods.totalSupply().call()) + +module.exports = { + rewardContract, + totalSupply, +} diff --git a/src/lib/web3/contracts/idle-multi-reward/contract.json b/src/lib/web3/contracts/idle-multi-reward/contract.json new file mode 100644 index 0000000..ef75494 --- /dev/null +++ b/src/lib/web3/contracts/idle-multi-reward/contract.json @@ -0,0 +1,365 @@ +{ + "abi": [ + { + "inputs": [ + { "internalType": "address", "name": "_owner", "type": "address" }, + { "internalType": "address", "name": "_stakingToken", "type": "address" } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldOwner", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "bool", "name": "isPaused", "type": "bool" }], + "name": "PauseChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "token", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Recovered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "reward", "type": "uint256" } + ], + "name": "RewardAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "rewardsToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "reward", "type": "uint256" } + ], + "name": "RewardPaid", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "token", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "newDuration", "type": "uint256" } + ], + "name": "RewardsDurationUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Staked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Withdrawn", + "type": "event" + }, + { + "constant": false, + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "_rewardsToken", "type": "address" }, + { "internalType": "address", "name": "_rewardsDistributor", "type": "address" }, + { "internalType": "uint256", "name": "_rewardsDuration", "type": "uint256" } + ], + "name": "addReward", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "address", "name": "_rewardsToken", "type": "address" } + ], + "name": "earned", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "exit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "getReward", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "_rewardsToken", "type": "address" }], + "name": "getRewardForDuration", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "lastPauseTime", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "_rewardsToken", "type": "address" }], + "name": "lastTimeRewardApplicable", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }], + "name": "nominateNewOwner", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "nominatedOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "_rewardsToken", "type": "address" }, + { "internalType": "uint256", "name": "reward", "type": "uint256" } + ], + "name": "notifyRewardAmount", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "paused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "tokenAddress", "type": "address" }, + { "internalType": "uint256", "name": "tokenAmount", "type": "uint256" } + ], + "name": "recoverERC20", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "rewardData", + "outputs": [ + { "internalType": "address", "name": "rewardsDistributor", "type": "address" }, + { "internalType": "uint256", "name": "rewardsDuration", "type": "uint256" }, + { "internalType": "uint256", "name": "periodFinish", "type": "uint256" }, + { "internalType": "uint256", "name": "rewardRate", "type": "uint256" }, + { "internalType": "uint256", "name": "lastUpdateTime", "type": "uint256" }, + { "internalType": "uint256", "name": "rewardPerTokenStored", "type": "uint256" } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "_rewardsToken", "type": "address" }], + "name": "rewardPerToken", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "rewardTokens", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "rewards", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "bool", "name": "_paused", "type": "bool" }], + "name": "setPaused", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "_rewardsToken", "type": "address" }, + { "internalType": "address", "name": "_rewardsDistributor", "type": "address" } + ], + "name": "setRewardsDistributor", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "_rewardsToken", "type": "address" }, + { "internalType": "uint256", "name": "_rewardsDuration", "type": "uint256" } + ], + "name": "setRewardsDuration", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], + "name": "stake", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "stakingToken", + "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "userRewardPerTokenPaid", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], + "name": "withdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/src/lib/web3/contracts/idle-multi-reward/methods.js b/src/lib/web3/contracts/idle-multi-reward/methods.js new file mode 100644 index 0000000..fd5f1e0 --- /dev/null +++ b/src/lib/web3/contracts/idle-multi-reward/methods.js @@ -0,0 +1,8 @@ +const { countFunctionCall } = require('../..') + +const rewardData = (rewardToken, instance) => + countFunctionCall(instance.methods.rewardData(rewardToken).call()) + +module.exports = { + rewardData, +} diff --git a/src/lib/web3/contracts/lido-wsteth/contract.json b/src/lib/web3/contracts/lido-wsteth/contract.json new file mode 100644 index 0000000..2df39c5 --- /dev/null +++ b/src/lib/web3/contracts/lido-wsteth/contract.json @@ -0,0 +1,207 @@ +{ + "address": { + "mainnet": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0" + }, + "abi": [ + { + "inputs": [{ "internalType": "contract IStETH", "name": "_stETH", "type": "address" }], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_wstETHAmount", "type": "uint256" }], + "name": "getStETHByWstETH", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_stETHAmount", "type": "uint256" }], + "name": "getWstETHByStETH", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], + "name": "nonces", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "v", "type": "uint8" }, + { "internalType": "bytes32", "name": "r", "type": "bytes32" }, + { "internalType": "bytes32", "name": "s", "type": "bytes32" } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stETH", + "outputs": [{ "internalType": "contract IStETH", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stEthPerToken", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tokensPerStEth", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_wstETHAmount", "type": "uint256" }], + "name": "unwrap", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_stETHAmount", "type": "uint256" }], + "name": "wrap", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { "stateMutability": "payable", "type": "receive" } + ] +} diff --git a/src/lib/web3/contracts/lido-wsteth/methods.js b/src/lib/web3/contracts/lido-wsteth/methods.js new file mode 100644 index 0000000..1d2b075 --- /dev/null +++ b/src/lib/web3/contracts/lido-wsteth/methods.js @@ -0,0 +1,5 @@ +const { countFunctionCall } = require('../..') + +const stEthPerToken = instance => countFunctionCall(instance.methods.stEthPerToken().call()) + +module.exports = { stEthPerToken } diff --git a/src/vaults/apys/implementations/idle-finance-tranche.js b/src/vaults/apys/implementations/idle-finance-tranche.js new file mode 100644 index 0000000..fefd264 --- /dev/null +++ b/src/vaults/apys/implementations/idle-finance-tranche.js @@ -0,0 +1,99 @@ +/* eslint-disable for-direction */ +const BigNumber = require('bignumber.js') +const { web3 } = require('../../../lib/web3') +const tokenAddresses = require('../../../lib/data/addresses.json') + +const controllerContract = require('../../../lib/web3/contracts/idle-gauge-controller/contract.json') +const distributorContract = require('../../../lib/web3/contracts/idle-gauge-distributor/contract.json') +const liquidityGaugeContract = require('../../../lib/web3/contracts/idle-liquidity-gauge/contract.json') +const multiRewardContract = require('../../../lib/web3/contracts/idle-multi-reward/contract.json') +const trancheCDOContract = require('../../../lib/web3/contracts/idle-cdo/contract.json') +const wstethContract = require('../../../lib/web3/contracts/lido-wsteth/contract.json') + +const { gaugeRelativeWeight } = require('../../../lib/web3/contracts/idle-gauge-controller/methods') +const { rate } = require('../../../lib/web3/contracts/idle-gauge-distributor/methods') +const { + rewardContract, + totalSupply, +} = require('../../../lib/web3/contracts/idle-liquidity-gauge/methods') +const { rewardData } = require('../../../lib/web3/contracts/idle-multi-reward/methods') +const { priceAA } = require('../../../lib/web3/contracts/idle-cdo/methods') +const { stEthPerToken } = require('../../../lib/web3/contracts/lido-wsteth/methods') + +const { getTokenPrice } = require('../../../prices') + +const ONE_YEAR = new BigNumber(3600 * 24 * 365) + +const getApy = async ( + trancheCDO, + liquidityGauge, + rewardTokens, + underlyingToken, + iswstETH, + reduction, +) => { + const controllerInstance = new web3.eth.Contract( + controllerContract.abi, + controllerContract.address.mainnet, + ) + const distributorInstance = new web3.eth.Contract( + distributorContract.abi, + distributorContract.address.mainnet, + ) + const liquidityGaugeInstance = new web3.eth.Contract(liquidityGaugeContract.abi, liquidityGauge) + const trancheCDOInstance = new web3.eth.Contract(trancheCDOContract.abi, trancheCDO) + + const weight = await gaugeRelativeWeight(liquidityGauge, controllerInstance) + const idleRate = await rate(distributorInstance) + const idleForGaugePerYear = new BigNumber(idleRate) + .multipliedBy(ONE_YEAR) + .multipliedBy(new BigNumber(weight)) + .dividedBy(new BigNumber(1e18)) // weight decimal + .dividedBy(new BigNumber(1e18)) // idle token decimal + const idlePrice = await getTokenPrice(tokenAddresses.IDLE) + const idleValuePerYear = new BigNumber(idlePrice).multipliedBy(idleForGaugePerYear) + + let rewardValuePerYear = new BigNumber(0) + if (rewardTokens.length > 0) { + const rewardContractAddr = await rewardContract(liquidityGaugeInstance) + const rewardInstance = new web3.eth.Contract(multiRewardContract.abi, rewardContractAddr) + + for (let i = 0; i < rewardTokens.length; i++) { + const data = await rewardData(rewardTokens[i], rewardInstance) + const tokenPrice = await getTokenPrice(rewardTokens[i]) + const value = new BigNumber(data.rewardRate) + .multipliedBy(new BigNumber(tokenPrice)) + .multipliedBy(ONE_YEAR) + .dividedBy(new BigNumber(1e18)) // token decimal + rewardValuePerYear = rewardValuePerYear.plus(value) + } + } + + const trancheSupply = await totalSupply(liquidityGaugeInstance) + const AATranchePrice = await priceAA(trancheCDOInstance) + let trancheBalancePerUnderlying = new BigNumber(1e18).dividedBy(new BigNumber(AATranchePrice)) + if (iswstETH) { + const wstETHInstance = new web3.eth.Contract(wstethContract.abi, wstethContract.address.mainnet) + const stethPerToken = await stEthPerToken(wstETHInstance) + trancheBalancePerUnderlying = trancheBalancePerUnderlying.multipliedBy( + new BigNumber(stethPerToken), + ) + } + + const underlyingPrice = await getTokenPrice(underlyingToken) + let apy = idleValuePerYear + .plus(rewardValuePerYear) + .multipliedBy(trancheBalancePerUnderlying) + .dividedBy(trancheSupply) + .dividedBy(underlyingPrice) + + if (reduction) { + apy = apy.multipliedBy(reduction) + } + + return apy.multipliedBy(100).toFixed(2, 1) +} + +module.exports = { + getApy, +} From c87c616c11dea09eda74f6069f80c73d4e3cff76 Mon Sep 17 00:00:00 2001 From: tommy4241 Date: Wed, 18 Jan 2023 22:53:23 +1000 Subject: [PATCH 2/3] fix: address comments --- data/constants.js | 1 + data/mainnet/pools.js | 4 ++++ data/mainnet/tokens.js | 2 +- src/lib/web3/contracts/idle-cdo/methods.js | 6 ++++++ .../implementations/idle-finance-tranche.js | 1 + .../implementations/idle-finance-tranche.js | 18 ++++++++++++++++++ 6 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/vaults/trading-apys/implementations/idle-finance-tranche.js diff --git a/data/constants.js b/data/constants.js index 949b0d6..be7e8be 100644 --- a/data/constants.js +++ b/data/constants.js @@ -193,6 +193,7 @@ const TRADING_APY_TYPES = { MSTABLE: 'MSTABLE', LOOKS: 'LOOKS', APE: 'APE', + IDLE_FINANCE_TRANCHE: 'IDLE_FINANCE_TRANCHE', } const POOL_TYPES = { diff --git a/data/mainnet/pools.js b/data/mainnet/pools.js index 0c33d5d..575a509 100644 --- a/data/mainnet/pools.js +++ b/data/mainnet/pools.js @@ -13,6 +13,10 @@ module.exports = [ rewardAPY: [], rewardTokens: [addresses.iFARM], rewardTokenSymbols: ['iFARM'], + tradingApyFunction: { + type: TRADING_APY_TYPES.IDLE_FINANCE_TRANCHE, + params: [addresses.V2.wstETH.TrancheCDO], + }, stakeAndDepositHelpMessage: `
Deposit and stake: diff --git a/data/mainnet/tokens.js b/data/mainnet/tokens.js index 158c04c..e844f2c 100644 --- a/data/mainnet/tokens.js +++ b/data/mainnet/tokens.js @@ -70,7 +70,7 @@ module.exports = { [addresses.LDO], addresses.WSTETH, true, - '0.7', + '0.85', ], }, ], diff --git a/src/lib/web3/contracts/idle-cdo/methods.js b/src/lib/web3/contracts/idle-cdo/methods.js index a990514..2cad826 100644 --- a/src/lib/web3/contracts/idle-cdo/methods.js +++ b/src/lib/web3/contracts/idle-cdo/methods.js @@ -2,6 +2,12 @@ const { countFunctionCall } = require('../..') const priceAA = instance => countFunctionCall(instance.methods.priceAA().call()) +const getApr = (tranche, instance) => countFunctionCall(instance.methods.getApr(tranche).call()) + +const AATranche = instance => countFunctionCall(instance.methods.AATranche().call()) + module.exports = { + getApr, priceAA, + AATranche, } diff --git a/src/vaults/apys/implementations/idle-finance-tranche.js b/src/vaults/apys/implementations/idle-finance-tranche.js index fefd264..5cdcca7 100644 --- a/src/vaults/apys/implementations/idle-finance-tranche.js +++ b/src/vaults/apys/implementations/idle-finance-tranche.js @@ -86,6 +86,7 @@ const getApy = async ( .multipliedBy(trancheBalancePerUnderlying) .dividedBy(trancheSupply) .dividedBy(underlyingPrice) + apy = apy.multipliedBy(new BigNumber(90)).dividedBy(new BigNumber(100)) //10% performance fee if (reduction) { apy = apy.multipliedBy(reduction) diff --git a/src/vaults/trading-apys/implementations/idle-finance-tranche.js b/src/vaults/trading-apys/implementations/idle-finance-tranche.js new file mode 100644 index 0000000..2450e31 --- /dev/null +++ b/src/vaults/trading-apys/implementations/idle-finance-tranche.js @@ -0,0 +1,18 @@ +const BigNumber = require('bignumber.js') +const { web3 } = require('../../../lib/web3') +const trancheCDOContract = require('../../../lib/web3/contracts/idle-cdo/contract.json') +const { getApr, AATranche } = require('../../../lib/web3/contracts/idle-cdo/methods') + +const getTradingApy = async trancheCDO => { + let apy + const trancheCDOInstance = new web3.eth.Contract(trancheCDOContract.abi, trancheCDO) + const tranche = await AATranche(trancheCDOInstance) + apy = new BigNumber(await getApr(tranche, trancheCDOInstance)) + apy = apy.dividedBy(new BigNumber(1e18)) + + return apy.toFixed(2, 1) +} + +module.exports = { + getTradingApy, +} From 55dc1bcb7a0ffde87153a8aa3ca7dc805acaf503 Mon Sep 17 00:00:00 2001 From: tommy4241 Date: Wed, 18 Jan 2023 23:10:01 +1000 Subject: [PATCH 3/3] feat: convert apr to apy --- .../trading-apys/implementations/idle-finance-tranche.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vaults/trading-apys/implementations/idle-finance-tranche.js b/src/vaults/trading-apys/implementations/idle-finance-tranche.js index 2450e31..d558a9a 100644 --- a/src/vaults/trading-apys/implementations/idle-finance-tranche.js +++ b/src/vaults/trading-apys/implementations/idle-finance-tranche.js @@ -4,13 +4,13 @@ const trancheCDOContract = require('../../../lib/web3/contracts/idle-cdo/contrac const { getApr, AATranche } = require('../../../lib/web3/contracts/idle-cdo/methods') const getTradingApy = async trancheCDO => { - let apy const trancheCDOInstance = new web3.eth.Contract(trancheCDOContract.abi, trancheCDO) const tranche = await AATranche(trancheCDOInstance) - apy = new BigNumber(await getApr(tranche, trancheCDOInstance)) - apy = apy.dividedBy(new BigNumber(1e18)) + let apr = new BigNumber(await getApr(tranche, trancheCDOInstance)) + apr = apr.dividedBy(new BigNumber(1e18)).dividedBy(100) + const apy = apr.dividedBy(12).plus(1).exponentiatedBy(12).minus(1) - return apy.toFixed(2, 1) + return apy.multipliedBy(100).toFixed(2, 1) } module.exports = {