From 6fa5a37bb00950065a0fd72a0cb7413d0a8e3cbf Mon Sep 17 00:00:00 2001 From: William Liu Date: Thu, 1 Feb 2024 21:42:01 +0000 Subject: [PATCH] feat: add radpie vaults --- data/constants.js | 2 + data/mainnet/addresses.json | 57 + data/mainnet/pools.js | 177 + data/mainnet/tokens.js | 197 + src/lib/data/addresses.json | 3 +- src/lib/web3/contracts/index.js | 21 + .../web3/contracts/rdp-master/contract.json | 1523 +++++++ src/lib/web3/contracts/rdp-master/methods.js | 7 + .../web3/contracts/rdp-reader/contract.json | 3891 +++++++++++++++++ src/lib/web3/contracts/rdp-reader/methods.js | 9 + .../web3/contracts/rdp-rewarder/contract.json | 670 +++ .../web3/contracts/rdp-rewarder/methods.js | 17 + src/vaults/apys/implementations/radpie.js | 91 + .../trading-apys/implementations/radpie.js | 37 + 14 files changed, 6701 insertions(+), 1 deletion(-) create mode 100644 src/lib/web3/contracts/rdp-master/contract.json create mode 100644 src/lib/web3/contracts/rdp-master/methods.js create mode 100644 src/lib/web3/contracts/rdp-reader/contract.json create mode 100644 src/lib/web3/contracts/rdp-reader/methods.js create mode 100644 src/lib/web3/contracts/rdp-rewarder/contract.json create mode 100644 src/lib/web3/contracts/rdp-rewarder/methods.js create mode 100644 src/vaults/apys/implementations/radpie.js create mode 100644 src/vaults/trading-apys/implementations/radpie.js diff --git a/data/constants.js b/data/constants.js index e535b306..34795279 100644 --- a/data/constants.js +++ b/data/constants.js @@ -93,6 +93,7 @@ const ESTIMATED_APY_TYPES = { LODESTAR_FOLD_HODL_HODLING: 'LODESTAR_FOLD_HODL_HODLING', LODESTAR_STAKE: 'LODESTAR_STAKE', SEAMLESS_FOLD: 'SEAMLESS_FOLD', + RADPIE: 'RADPIE', } const COLLATERAL_TYPE = { @@ -131,6 +132,7 @@ const TRADING_APY_TYPES = { BASESWAP: 'BASESWAP', CURVE_BASE: 'CURVE_BASE', MAGPIE: 'MAGPIE', + RADPIE: 'RADPIE', } const POOL_TYPES = { diff --git a/data/mainnet/addresses.json b/data/mainnet/addresses.json index dd82fe26..a553509a 100644 --- a/data/mainnet/addresses.json +++ b/data/mainnet/addresses.json @@ -1826,6 +1826,7 @@ "pGOLD": "0xF602A45812040D90B202355bdc05438918CD3FE3", "MGP": "0xa61F74247455A40b01b0559ff6274441FAfa22A3", "WOM": "0x7B5EB3940021Ec0e8e463D5dBB4B7B09a89DDF96", + "RDP": "0x54BDBF3cE36f451Ec61493236b8E6213ac87c0f6", "V2": { "balancer_wstETH_wETH_arbitrum": { "Underlying": "0x36bf227d6BaC96e2aB1EbB5492ECec69C691943f", @@ -2417,6 +2418,62 @@ "NewVault": "0x710A1AB6Cb8412DE9613ad6c7195453Ce8b5ca71", "NewStrategy": "0x3Fd1835a620a74B79B9621A43022a247bBf1E6cd", "NewPool": "0xDE750fBAcc4f63C68e09aE0C0F74fFA14672d8b2" + }, + "radpie_ARB": { + "Underlying": "0xf6da879761961ABD22177242904a6E12BB034C22", + "NewVault": "0xABa0cB835f40E7Af29F8016a1DB401e704f855bE", + "NewStrategy": "0xF251d09Bd29253F50b74053e1B8C9153Ae70865c", + "NewPool": "0xA9380eF9E5b24787400C6483Fe97195Cb05E5B59", + "Rewarder": "0xc256d80128113C8c23DFce0F5a877b738738AD7f", + "PoolId": 7 + }, + "radpie_DAI": { + "Underlying": "0x8409DE8E98F80D0E40F42849eF0923c2493BEeAd", + "NewVault": "0xf51902f721136cA1fcE5C12a303d3A76bA177E62", + "NewStrategy": "0x6878408Ef50Bdc1DEdAcC09638827a26F1b47f0C", + "NewPool": "0x2c2Af6FB95B739eb087d334465852920505b26A3", + "Rewarder": "0x8384fCdA31054efc8B4899d81F510e868f747029", + "PoolId": 4 + }, + "radpie_WETH": { + "Underlying": "0x5477B2E46DD6D2D8E52f8329f0DC283F6f768cFa", + "NewVault": "0xE5cfD03f32F2ebA7e5841f50544265beA368EE17", + "NewStrategy": "0x19dD00d742D2428F71ed3773F775a7D915FDB7EC", + "NewPool": "0x7212018672D9C6dC2Fa26a4a42Ac3489BF2871DA", + "Rewarder": "0x9b31dC7E0E43FD3d038fb9723161F51cf6673742", + "PoolId": 5 + }, + "radpie_USDCe": { + "Underlying": "0xd86B1C1C7F921F3663921f8917d086379739cDA3", + "NewVault": "0x0910723E98eB8961a50d8b09b296aDB84656529C", + "NewStrategy": "0xD3E099f1Ca80F2A036b6294f60ADA4123BF060d2", + "NewPool": "0xc9Cd9c73b57d1D5bd36A10A3d0f9DB0b49563393", + "Rewarder": "0x1ef6fEA1279d54b52c828f76807fC55Fa2522270", + "PoolId": 3 + }, + "radpie_USDT": { + "Underlying": "0x399F292939668E591957726df3eC9A0E7dc8Ac57", + "NewVault": "0xa1D4e9bDA2fC90EBFBa2372F4C4BA5ce4F8e8A46", + "NewStrategy": "0xdB832C6B0743ba96627106B621b25Ae0ef07152B", + "NewPool": "0x06826714864803852dD5DA78C13d7C7bC74b54C7", + "Rewarder": "0x3e05797DAB6a53932d413999Ab0Aa31F7E94e0d9", + "PoolId": 2 + }, + "radpie_WBTC": { + "Underlying": "0x6c1B07ed05656DEdd90321E94B1cDB26981e65f2", + "NewVault": "0x3646B87C7DD1c87fe6663FFCAD167b8E5175F001", + "NewStrategy": "0x74321364F0DCeCCf40a8978DD5Fe25513887b2b9", + "NewPool": "0x120eA8fb92F4Bf5C3BCf099Fbf834a5538c21806", + "Rewarder": "0xebCF9116e0379Be0a7bf3F61f13D81D03C0DeAad", + "PoolId": 1 + }, + "radpie_wstETH": { + "Underlying": "0x79a2e71460c97807EC40D6d670838bEe99848F1d", + "NewVault": "0xBdE9Dbd8b1a1C52eC7f880a5172470da2e2aA04D", + "NewStrategy": "0x8c527902897ee2cb0288E6a2c7eD49f01b906B41", + "NewPool": "0x593d275b14a65C40F02c3A60056Fc701e0bC7FCa", + "Rewarder": "0x63614e576F8295Aa8Ac2c8D3AE8f261bE4E9484b", + "PoolId": 6 } } }, diff --git a/data/mainnet/pools.js b/data/mainnet/pools.js index 4738817b..205d5e04 100644 --- a/data/mainnet/pools.js +++ b/data/mainnet/pools.js @@ -4,6 +4,183 @@ const addresses = require('./addresses.json') const strat15PercentFactor = '0.85' module.exports = [ + { + chain: CHAIN_IDS.ARBITRUM_ONE, + id: 'radpie_ARB', + type: POOL_TYPES.INCENTIVE, + tradingApyFunction: { + type: TRADING_APY_TYPES.RADPIE, + params: [addresses.ARBITRUM_ONE.V2.radpie_ARB.PoolId], + }, + contractAddress: addresses.ARBITRUM_ONE.V2.radpie_ARB.NewPool, + collateralAddress: addresses.ARBITRUM_ONE.V2.radpie_ARB.NewVault, + rewardAPY: [], + rewardAPR: null, + rewardTokens: [addresses.ARBITRUM_ONE.iFARM], + rewardTokenSymbols: ['iFARM'], + stakeAndDepositHelpMessage: ` +
+

The vault supplies + ARB to Radpie, earning + RDNT. + At every harvest, the earned RDNT is converted into more + ARB. +

+
+ `, + }, + { + chain: CHAIN_IDS.ARBITRUM_ONE, + id: 'radpie_DAI', + type: POOL_TYPES.INCENTIVE, + tradingApyFunction: { + type: TRADING_APY_TYPES.RADPIE, + params: [addresses.ARBITRUM_ONE.V2.radpie_DAI.PoolId], + }, + contractAddress: addresses.ARBITRUM_ONE.V2.radpie_DAI.NewPool, + collateralAddress: addresses.ARBITRUM_ONE.V2.radpie_DAI.NewVault, + rewardAPY: [], + rewardAPR: null, + rewardTokens: [addresses.ARBITRUM_ONE.iFARM], + rewardTokenSymbols: ['iFARM'], + stakeAndDepositHelpMessage: ` +
+

The vault supplies + DAI to Radpie, earning + RDNT. + At every harvest, the earned RDNT is converted into more + DAI. +

+
+ `, + }, + { + chain: CHAIN_IDS.ARBITRUM_ONE, + id: 'radpie_WETH', + type: POOL_TYPES.INCENTIVE, + tradingApyFunction: { + type: TRADING_APY_TYPES.RADPIE, + params: [addresses.ARBITRUM_ONE.V2.radpie_WETH.PoolId], + }, + contractAddress: addresses.ARBITRUM_ONE.V2.radpie_WETH.NewPool, + collateralAddress: addresses.ARBITRUM_ONE.V2.radpie_WETH.NewVault, + rewardAPY: [], + rewardAPR: null, + rewardTokens: [addresses.ARBITRUM_ONE.iFARM], + rewardTokenSymbols: ['iFARM'], + stakeAndDepositHelpMessage: ` +
+

The vault supplies + WETH to Radpie, earning + RDNT. + At every harvest, the earned RDNT is converted into more + WETH. +

+
+ `, + }, + { + chain: CHAIN_IDS.ARBITRUM_ONE, + id: 'radpie_USDCe', + type: POOL_TYPES.INCENTIVE, + tradingApyFunction: { + type: TRADING_APY_TYPES.RADPIE, + params: [addresses.ARBITRUM_ONE.V2.radpie_USDCe.PoolId], + }, + contractAddress: addresses.ARBITRUM_ONE.V2.radpie_USDCe.NewPool, + collateralAddress: addresses.ARBITRUM_ONE.V2.radpie_USDCe.NewVault, + rewardAPY: [], + rewardAPR: null, + rewardTokens: [addresses.ARBITRUM_ONE.iFARM], + rewardTokenSymbols: ['iFARM'], + stakeAndDepositHelpMessage: ` +
+

The vault supplies + USDC.e to Radpie, earning + RDNT & + ARB. + At every harvest, the earned RDNT and ARB are converted into more + USDC.e. +

+
+ `, + }, + { + chain: CHAIN_IDS.ARBITRUM_ONE, + id: 'radpie_USDT', + type: POOL_TYPES.INCENTIVE, + tradingApyFunction: { + type: TRADING_APY_TYPES.RADPIE, + params: [addresses.ARBITRUM_ONE.V2.radpie_USDT.PoolId], + }, + contractAddress: addresses.ARBITRUM_ONE.V2.radpie_USDT.NewPool, + collateralAddress: addresses.ARBITRUM_ONE.V2.radpie_USDT.NewVault, + rewardAPY: [], + rewardAPR: null, + rewardTokens: [addresses.ARBITRUM_ONE.iFARM], + rewardTokenSymbols: ['iFARM'], + stakeAndDepositHelpMessage: ` +
+

The vault supplies + USDT to Radpie, earning + RDNT & + ARB. + At every harvest, the earned RDNT and ARB are converted into more + USDT. +

+
+ `, + }, + { + chain: CHAIN_IDS.ARBITRUM_ONE, + id: 'radpie_WBTC', + type: POOL_TYPES.INCENTIVE, + tradingApyFunction: { + type: TRADING_APY_TYPES.RADPIE, + params: [addresses.ARBITRUM_ONE.V2.radpie_WBTC.PoolId], + }, + contractAddress: addresses.ARBITRUM_ONE.V2.radpie_WBTC.NewPool, + collateralAddress: addresses.ARBITRUM_ONE.V2.radpie_WBTC.NewVault, + rewardAPY: [], + rewardAPR: null, + rewardTokens: [addresses.ARBITRUM_ONE.iFARM], + rewardTokenSymbols: ['iFARM'], + stakeAndDepositHelpMessage: ` +
+

The vault supplies + WBTC to Radpie, earning + RDNT. + At every harvest, the earned RDNT is converted into more + WBTC. +

+
+ `, + }, + { + chain: CHAIN_IDS.ARBITRUM_ONE, + id: 'radpie_wstETH', + type: POOL_TYPES.INCENTIVE, + tradingApyFunction: { + type: TRADING_APY_TYPES.RADPIE, + params: [addresses.ARBITRUM_ONE.V2.radpie_wstETH.PoolId], + }, + contractAddress: addresses.ARBITRUM_ONE.V2.radpie_wstETH.NewPool, + collateralAddress: addresses.ARBITRUM_ONE.V2.radpie_wstETH.NewVault, + rewardAPY: [], + rewardAPR: null, + rewardTokens: [addresses.ARBITRUM_ONE.iFARM], + rewardTokenSymbols: ['iFARM'], + stakeAndDepositHelpMessage: ` +
+

The vault supplies + wstETH to Radpie, earning + RDNT. + At every harvest, the earned RDNT is converted into more + wstETH. +

+
+ `, + }, { chain: CHAIN_IDS.BASE, id: 'seamless_DAI', diff --git a/data/mainnet/tokens.js b/data/mainnet/tokens.js index a5049083..2d6ba716 100644 --- a/data/mainnet/tokens.js +++ b/data/mainnet/tokens.js @@ -45,6 +45,203 @@ module.exports = { ], cmcRewardTokenSymbols: ['FARM', 'WETH'], }, + RDP: { + chain: CHAIN_IDS.ARBITRUM_ONE, + logoUrl: ['./icons/mgp.png'], + tokenAddress: addresses.ARBITRUM_ONE.RDP, + decimals: '18', + vaultAddress: null, + priceFunction: { + type: GET_PRICE_TYPES.COINGECKO_ID, + params: ['radpie'], + }, + }, + radpie_ARB: { + chain: CHAIN_IDS.ARBITRUM_ONE, + apyIconUrls: ['./icons/rdnt.svg'], + apyTokenSymbols: ['RDNT'], + logoUrl: ['./icons/arb.svg'], + tokenNames: ['ARB'], + platform: ['Radpie'], + tags: ['Advanced'], + tokenAddress: addresses.ARBITRUM_ONE.V2.radpie_ARB.Underlying, + decimals: '18', + vaultAddress: addresses.ARBITRUM_ONE.V2.radpie_ARB.NewVault, + priceFunction: { + type: GET_PRICE_TYPES.COINGECKO_ID, + params: ['arbitrum'], + }, + estimateApyFunctions: [ + { + type: ESTIMATED_APY_TYPES.RADPIE, + params: [ + addresses.ARBITRUM_ONE.V2.radpie_ARB.PoolId, + addresses.ARBITRUM_ONE.V2.radpie_ARB.Rewarder, + profitSharingCut10Percent, + ], + }, + ], + cmcRewardTokenSymbols: ['iFARM', 'RDNT'], + }, + radpie_DAI: { + chain: CHAIN_IDS.ARBITRUM_ONE, + apyIconUrls: ['./icons/rdnt.svg'], + apyTokenSymbols: ['RDNT'], + logoUrl: ['./icons/dai.svg'], + tokenNames: ['DAI'], + platform: ['Radpie'], + tags: ['Beginners', 'Stable'], + tokenAddress: addresses.ARBITRUM_ONE.V2.radpie_DAI.Underlying, + decimals: '18', + vaultAddress: addresses.ARBITRUM_ONE.V2.radpie_DAI.NewVault, + priceFunction: { + type: GET_PRICE_TYPES.COINGECKO_ID, + params: ['dai'], + }, + estimateApyFunctions: [ + { + type: ESTIMATED_APY_TYPES.RADPIE, + params: [ + addresses.ARBITRUM_ONE.V2.radpie_DAI.PoolId, + addresses.ARBITRUM_ONE.V2.radpie_DAI.Rewarder, + profitSharingCut10Percent, + ], + }, + ], + cmcRewardTokenSymbols: ['iFARM', 'RDNT'], + }, + radpie_WETH: { + chain: CHAIN_IDS.ARBITRUM_ONE, + apyIconUrls: ['./icons/rdnt.svg'], + apyTokenSymbols: ['RDNT'], + logoUrl: ['./icons/eth.svg'], + tokenNames: ['WETH'], + platform: ['Radpie'], + tags: ['Advanced'], + tokenAddress: addresses.ARBITRUM_ONE.V2.radpie_WETH.Underlying, + decimals: '18', + vaultAddress: addresses.ARBITRUM_ONE.V2.radpie_WETH.NewVault, + priceFunction: { + type: GET_PRICE_TYPES.COINGECKO_ID, + params: ['weth'], + }, + estimateApyFunctions: [ + { + type: ESTIMATED_APY_TYPES.RADPIE, + params: [ + addresses.ARBITRUM_ONE.V2.radpie_WETH.PoolId, + addresses.ARBITRUM_ONE.V2.radpie_WETH.Rewarder, + profitSharingCut10Percent, + ], + }, + ], + cmcRewardTokenSymbols: ['iFARM', 'RDNT'], + }, + radpie_USDCe: { + chain: CHAIN_IDS.ARBITRUM_ONE, + apyIconUrls: ['./icons/rdnt.svg', './icons/arb.svg'], + apyTokenSymbols: ['RDNT', 'ARB'], + logoUrl: ['./icons/usdc.svg'], + tokenNames: ['USDC.e'], + platform: ['Radpie'], + tags: ['Beginners', 'Stable'], + tokenAddress: addresses.ARBITRUM_ONE.V2.radpie_USDCe.Underlying, + decimals: '18', + vaultAddress: addresses.ARBITRUM_ONE.V2.radpie_USDCe.NewVault, + priceFunction: { + type: GET_PRICE_TYPES.COINGECKO_ID, + params: ['usd-coin'], + }, + estimateApyFunctions: [ + { + type: ESTIMATED_APY_TYPES.RADPIE, + params: [ + addresses.ARBITRUM_ONE.V2.radpie_USDCe.PoolId, + addresses.ARBITRUM_ONE.V2.radpie_USDCe.Rewarder, + profitSharingCut10Percent, + ], + }, + ], + cmcRewardTokenSymbols: ['iFARM', 'RDNT', 'ARB'], + }, + radpie_USDT: { + chain: CHAIN_IDS.ARBITRUM_ONE, + apyIconUrls: ['./icons/rdnt.svg', './icons/arb.svg'], + apyTokenSymbols: ['RDNT', 'ARB'], + logoUrl: ['./icons/usdt.svg'], + tokenNames: ['USDT'], + platform: ['Radpie'], + tags: ['Beginners', 'Stable'], + tokenAddress: addresses.ARBITRUM_ONE.V2.radpie_USDT.Underlying, + decimals: '18', + vaultAddress: addresses.ARBITRUM_ONE.V2.radpie_USDT.NewVault, + priceFunction: { type: GET_PRICE_TYPES.COINGECKO_CONTRACT, params: [addresses.USDT] }, + estimateApyFunctions: [ + { + type: ESTIMATED_APY_TYPES.RADPIE, + params: [ + addresses.ARBITRUM_ONE.V2.radpie_USDT.PoolId, + addresses.ARBITRUM_ONE.V2.radpie_USDT.Rewarder, + profitSharingCut10Percent, + ], + }, + ], + cmcRewardTokenSymbols: ['iFARM', 'RDNT', 'ARB'], + }, + radpie_WBTC: { + chain: CHAIN_IDS.ARBITRUM_ONE, + apyIconUrls: ['./icons/rdnt.svg'], + apyTokenSymbols: ['RDNT'], + logoUrl: ['./icons/wbtc.svg'], + tokenNames: ['WBTC'], + platform: ['Radpie'], + tags: ['Advanced'], + tokenAddress: addresses.ARBITRUM_ONE.V2.radpie_WBTC.Underlying, + decimals: '18', + vaultAddress: addresses.ARBITRUM_ONE.V2.radpie_WBTC.NewVault, + priceFunction: { + type: GET_PRICE_TYPES.COINGECKO_ID, + params: ['wrapped-bitcoin'], + }, + estimateApyFunctions: [ + { + type: ESTIMATED_APY_TYPES.RADPIE, + params: [ + addresses.ARBITRUM_ONE.V2.radpie_WBTC.PoolId, + addresses.ARBITRUM_ONE.V2.radpie_WBTC.Rewarder, + profitSharingCut10Percent, + ], + }, + ], + cmcRewardTokenSymbols: ['iFARM', 'RDNT'], + }, + radpie_wstETH: { + chain: CHAIN_IDS.ARBITRUM_ONE, + apyIconUrls: ['./icons/rdnt.svg'], + apyTokenSymbols: ['RDNT'], + logoUrl: ['./icons/steth.svg'], + tokenNames: ['wstETH'], + platform: ['Radpie'], + tags: ['Advanced'], + tokenAddress: addresses.ARBITRUM_ONE.V2.radpie_wstETH.Underlying, + decimals: '18', + vaultAddress: addresses.ARBITRUM_ONE.V2.radpie_wstETH.NewVault, + priceFunction: { + type: GET_PRICE_TYPES.COINGECKO_ID, + params: ['wrapped-steth'], + }, + estimateApyFunctions: [ + { + type: ESTIMATED_APY_TYPES.RADPIE, + params: [ + addresses.ARBITRUM_ONE.V2.radpie_wstETH.PoolId, + addresses.ARBITRUM_ONE.V2.radpie_wstETH.Rewarder, + profitSharingCut10Percent, + ], + }, + ], + cmcRewardTokenSymbols: ['iFARM', 'RDNT'], + }, SEAM: { chain: CHAIN_IDS.BASE, logoUrl: ['./icons/seam.svg'], diff --git a/src/lib/data/addresses.json b/src/lib/data/addresses.json index ad9fed10..94bc5130 100644 --- a/src/lib/data/addresses.json +++ b/src/lib/data/addresses.json @@ -33,5 +33,6 @@ "NotifyHelperIFARM": "0x8af7Eb5a93076F6A2316261aC8D42F97aDaab64E", "VERSE": "0x249cA82617eC3DfB2589c4c17ab7EC9765350a18", "xGRAIL": "0x3CAaE25Ee616f2C8E13C74dA0813402eae3F496b", - "iFARM_arbitrum": "0x9dCA587dc65AC0a043828B0acd946d71eb8D46c1" + "iFARM_arbitrum": "0x9dCA587dc65AC0a043828B0acd946d71eb8D46c1", + "ARB_arbitrum": "0x912CE59144191C1204E64559FE8253a0e49E6548" } diff --git a/src/lib/web3/contracts/index.js b/src/lib/web3/contracts/index.js index a4af6aec..662add40 100644 --- a/src/lib/web3/contracts/index.js +++ b/src/lib/web3/contracts/index.js @@ -139,6 +139,15 @@ const seamlessStrategyContract = require('../contracts/seamless-strategy/contrac const seamlessIncentivesMethods = require('../contracts/seamless-incentives/methods') const seamlessIncentivesContract = require('../contracts/seamless-incentives/contract.json') +const radpieReaderMethods = require('../contracts/rdp-reader/methods') +const radpieReaderContract = require('../contracts/rdp-reader/contract.json') + +const radpieRewarderMethods = require('../contracts/rdp-rewarder/methods') +const radpieRewarderContract = require('../contracts/rdp-rewarder/contract.json') + +const radpieMasterMethods = require('../contracts/rdp-master/methods') +const radpieMasterContract = require('../contracts/rdp-master/contract.json') + module.exports = { seamlessPool: { methods: seamlessPoolMethods, @@ -328,4 +337,16 @@ module.exports = { contract: wombatFeePoolContract, methods: wombatFeePoolMethods, }, + radpieReader: { + contract: radpieReaderContract, + methods: radpieReaderMethods, + }, + radpieRewarder: { + contract: radpieRewarderContract, + methods: radpieRewarderMethods, + }, + radpieMaster: { + contract: radpieMasterContract, + methods: radpieMasterMethods, + }, } diff --git a/src/lib/web3/contracts/rdp-master/contract.json b/src/lib/web3/contracts/rdp-master/contract.json new file mode 100644 index 00000000..3170682d --- /dev/null +++ b/src/lib/web3/contracts/rdp-master/contract.json @@ -0,0 +1,1523 @@ +{ + "address": { + "ropsten": "", + "mainnet": "0xc9Cb578d613d729C3c4C8EF7d46Cb814570F2baA" + }, + "abi": [ + { + "inputs": [], + "name": "InvalidStakingToken", + "type": "error" + }, + { + "inputs": [], + "name": "LengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "MustBeContract", + "type": "error" + }, + { + "inputs": [], + "name": "MustBeContractOrZero", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyActivePool", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyPoolManager", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyReceiptToken", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyStakingToken", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyVLRdp", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyWhiteListedAllocaUpdator", + "type": "error" + }, + { + "inputs": [], + "name": "PoolExisted", + "type": "error" + }, + { + "inputs": [], + "name": "RadpieSetAlready", + "type": "error" + }, + { + "inputs": [], + "name": "UnlockAmountExceedsLocked", + "type": "error" + }, + { + "inputs": [], + "name": "WithdrawAmountExceedsStaked", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_allocPoint", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_receiptToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IBaseRewardPool", + "name": "_rewarder", + "type": "address" + } + ], + "name": "Add", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_receiptToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "DepositNotAvailable", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "EmergencyWithdraw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLock", + "type": "bool" + } + ], + "name": "HarvestRadpie", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_isRewardRadpie", + "type": "bool" + } + ], + "name": "LockFreePoolUpdated", + "type": "event" + }, + { + "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": "address", + "name": "_account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_status", + "type": "bool" + } + ], + "name": "PoolManagerStatus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_radpie", + "type": "address" + } + ], + "name": "RadpieSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_allocPoint", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IBaseRewardPool", + "name": "_rewarder", + "type": "address" + } + ], + "name": "Set", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_oldRadpiePerSec", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_newRadpiePerSec", + "type": "uint256" + } + ], + "name": "UpdateEmissionRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_lastRewardTimestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_lpSupply", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_accRadpiePerShare", + "type": "uint256" + } + ], + "name": "UpdatePool", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_oldAllocPoint", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_newAllocPoint", + "type": "uint256" + } + ], + "name": "UpdatePoolAlloc", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_receiptToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_newvlRdp", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "_oldvlRdp", + "type": "address" + } + ], + "name": "vlRdpUpdated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "AllocationManagers", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "PoolManagers", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_radpie", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_radpiePerSec", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTimestamp", + "type": "uint256" + } + ], + "name": "__MasterRadpie_init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_allocPoint", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiptToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_rewarder", + "type": "address" + } + ], + "name": "add", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_users", + "type": "address[]" + } + ], + "name": "addClaimedLegacy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "afterReceiptTokenTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_user", + "type": "address" + } + ], + "name": "allPendingTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "pendingRadpie", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + }, + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "beforeReceiptTokenTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_allocPoint", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_rewarder", + "type": "address" + } + ], + "name": "createNoReceiptPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_allocPoint", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "internalType": "string", + "name": "_receiptName", + "type": "string" + }, + { + "internalType": "string", + "name": "_receiptSymbol", + "type": "string" + } + ], + "name": "createPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_for", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "depositFor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_for", + "type": "address" + } + ], + "name": "depositVlRadpieFor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_stakingToken", + "type": "address" + } + ], + "name": "getPoolInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "emission", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "allocpoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeOfPool", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalPoint", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "legacyRewarderClaimed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "legacyRewarders", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "massUpdatePools", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_stakingTokens", + "type": "address[]" + } + ], + "name": "multiclaim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_stakingTokens", + "type": "address[]" + }, + { + "internalType": "address[][]", + "name": "_rewardTokens", + "type": "address[][]" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "multiclaimFor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_stakingTokens", + "type": "address[]" + }, + { + "internalType": "address[][]", + "name": "_rewardTokens", + "type": "address[][]" + } + ], + "name": "multiclaimSpec", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_stakingTokens", + "type": "address[]" + }, + { + "internalType": "address[][]", + "name": "_rewardTokens", + "type": "address[][]" + }, + { + "internalType": "bool", + "name": "_withRDP", + "type": "bool" + } + ], + "name": "multiclaimSpecRDP", + "outputs": [], + "stateMutability": "nonpayable", + "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": [ + { + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_user", + "type": "address" + }, + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + } + ], + "name": "pendingTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "pendingRadpie", + "type": "uint256" + }, + { + "internalType": "address", + "name": "bonusTokenAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "bonusTokenSymbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "pendingBonusToken", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "radpie", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "radpiePerSec", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rdntRewardManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "receiptToStakeToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "registeredToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_allocPoint", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_rewarder", + "type": "address" + } + ], + "name": "set", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_legacyRewarder", + "type": "address" + } + ], + "name": "setLegacyRewarder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "bool", + "name": "_allowedManager", + "type": "bool" + } + ], + "name": "setPoolManagerStatus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_radpie", + "type": "address" + } + ], + "name": "setRadpie", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_rdntRewardManager", + "type": "address" + } + ], + "name": "setRdntRewardManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vlRadpie", + "type": "address" + } + ], + "name": "setVlRadpie", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_user", + "type": "address" + } + ], + "name": "stakingInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenToPoolInfo", + "outputs": [ + { + "internalType": "address", + "name": "stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiptToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allocPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastRewardTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRadpiePerShare", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalStaked", + "type": "uint256" + }, + { + "internalType": "address", + "name": "rewarder", + "type": "address" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalAllocPoint", + "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": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_radpiePerSec", + "type": "uint256" + } + ], + "name": "updateEmissionRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_stakingToken", + "type": "address" + } + ], + "name": "updatePool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_stakingTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_allocPoints", + "type": "uint256[]" + } + ], + "name": "updatePoolsAlloc", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_rewarder", + "type": "address" + }, + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "bool", + "name": "_allowed", + "type": "bool" + } + ], + "name": "updateRewarderQueuer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "bool", + "name": "_allowed", + "type": "bool" + } + ], + "name": "updateWhitelistedAllocManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "userInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rewardDebt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "available", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "unClaimedRadpie", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vlRadpie", + "outputs": [ + { + "internalType": "contract IVLRdp", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_stakingToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_for", + "type": "address" + } + ], + "name": "withdrawVlRadpieFor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/src/lib/web3/contracts/rdp-master/methods.js b/src/lib/web3/contracts/rdp-master/methods.js new file mode 100644 index 00000000..2784a446 --- /dev/null +++ b/src/lib/web3/contracts/rdp-master/methods.js @@ -0,0 +1,7 @@ +const { countFunctionCall } = require('../..') + +const getPoolData = (stakingToken, instance) => + countFunctionCall(instance.methods.getPoolInfo(stakingToken).call()) +const getRDPPerSec = instance => countFunctionCall(instance.methods.radpiePerSec().call()) + +module.exports = { getPoolData, getRDPPerSec } diff --git a/src/lib/web3/contracts/rdp-reader/contract.json b/src/lib/web3/contracts/rdp-reader/contract.json new file mode 100644 index 00000000..4e30b721 --- /dev/null +++ b/src/lib/web3/contracts/rdp-reader/contract.json @@ -0,0 +1,3891 @@ +{ + "address": { + "ropsten": "", + "mainnet": "0x143fC5927C4c95996EA8FC6c346Ed548f636EaC0" + }, + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "RDNT", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RDNTOracle", + "outputs": [ + { + "internalType": "contract AggregatorV3Interface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RDNT_LP", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "RDNTrevShare", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RDNTrevShareLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WETH", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "__RadpieReader_init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "addRDNTrevShare", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "chefIncentives", + "outputs": [ + { + "internalType": "contract IChefIncentivesController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_rdntRewardManager", + "type": "address" + }, + { + "internalType": "address", + "name": "_rewardDistributor", + "type": "address" + }, + { + "internalType": "address", + "name": "_radiantMFD", + "type": "address" + }, + { + "internalType": "address", + "name": "_lendingPool", + "type": "address" + }, + { + "internalType": "address", + "name": "_RDNTOracle", + "type": "address" + }, + { + "internalType": "address", + "name": "_chefIncentives", + "type": "address" + } + ], + "name": "config", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDlpPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "getERC20TokenInfo", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.ERC20TokenInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeOfPool", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tvl", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "debt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leveragedTVL", + "type": "uint256" + }, + { + "internalType": "address", + "name": "stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiptToken", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "rToken", + "type": "address" + }, + { + "internalType": "address", + "name": "vdToken", + "type": "address" + }, + { + "internalType": "address", + "name": "rewarder", + "type": "address" + }, + { + "internalType": "address", + "name": "helper", + "type": "address" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isNative", + "type": "bool" + }, + { + "internalType": "string", + "name": "poolType", + "type": "string" + }, + { + "internalType": "uint256", + "name": "assetPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quotaLeft", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDPEmission", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "healthFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDepositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTpersec", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieLendingInfo", + "name": "radpieLendingInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.ERC20TokenInfo", + "name": "stakedTokenInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakingAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mDLPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockRDPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntDlpBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tvl", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieAccountInfo", + "name": "accountInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "pendingRDP", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + }, + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "entitledRDNT", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieRewardInfo", + "name": "rewardInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + } + ], + "internalType": "struct ReaderDatatype.RadpieLegacyRewardInfo", + "name": "legacyRewardInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "userTotalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userAmountInCoolDown", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInCoolDown", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedPenaltyAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountToUser", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieUserUnlocking[]", + "name": "userUnlockingSchedule", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "totalPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nextAvailableUnlockSlot", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isFull", + "type": "bool" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieLockInfo", + "name": "vlRadpieLockInfo", + "type": "tuple" + } + ], + "internalType": "struct ReaderDatatype.RadpiePool", + "name": "pool", + "type": "tuple" + } + ], + "name": "getRDNTAPR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRDNTPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeOfPool", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tvl", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "debt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leveragedTVL", + "type": "uint256" + }, + { + "internalType": "address", + "name": "stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiptToken", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "rToken", + "type": "address" + }, + { + "internalType": "address", + "name": "vdToken", + "type": "address" + }, + { + "internalType": "address", + "name": "rewarder", + "type": "address" + }, + { + "internalType": "address", + "name": "helper", + "type": "address" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isNative", + "type": "bool" + }, + { + "internalType": "string", + "name": "poolType", + "type": "string" + }, + { + "internalType": "uint256", + "name": "assetPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quotaLeft", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDPEmission", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "healthFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDepositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTpersec", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieLendingInfo", + "name": "radpieLendingInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.ERC20TokenInfo", + "name": "stakedTokenInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakingAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mDLPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockRDPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntDlpBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tvl", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieAccountInfo", + "name": "accountInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "pendingRDP", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + }, + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "entitledRDNT", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieRewardInfo", + "name": "rewardInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + } + ], + "internalType": "struct ReaderDatatype.RadpieLegacyRewardInfo", + "name": "legacyRewardInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "userTotalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userAmountInCoolDown", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInCoolDown", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedPenaltyAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountToUser", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieUserUnlocking[]", + "name": "userUnlockingSchedule", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "totalPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nextAvailableUnlockSlot", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isFull", + "type": "bool" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieLockInfo", + "name": "vlRadpieLockInfo", + "type": "tuple" + } + ], + "internalType": "struct ReaderDatatype.RadpiePool", + "name": "pool", + "type": "tuple" + } + ], + "name": "getRDNTRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeOfPool", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tvl", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "debt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leveragedTVL", + "type": "uint256" + }, + { + "internalType": "address", + "name": "stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiptToken", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "rToken", + "type": "address" + }, + { + "internalType": "address", + "name": "vdToken", + "type": "address" + }, + { + "internalType": "address", + "name": "rewarder", + "type": "address" + }, + { + "internalType": "address", + "name": "helper", + "type": "address" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isNative", + "type": "bool" + }, + { + "internalType": "string", + "name": "poolType", + "type": "string" + }, + { + "internalType": "uint256", + "name": "assetPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quotaLeft", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDPEmission", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "healthFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDepositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTpersec", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieLendingInfo", + "name": "radpieLendingInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.ERC20TokenInfo", + "name": "stakedTokenInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakingAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mDLPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockRDPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntDlpBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tvl", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieAccountInfo", + "name": "accountInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "pendingRDP", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + }, + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "entitledRDNT", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieRewardInfo", + "name": "rewardInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + } + ], + "internalType": "struct ReaderDatatype.RadpieLegacyRewardInfo", + "name": "legacyRewardInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "userTotalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userAmountInCoolDown", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInCoolDown", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedPenaltyAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountToUser", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieUserUnlocking[]", + "name": "userUnlockingSchedule", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "totalPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nextAvailableUnlockSlot", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isFull", + "type": "bool" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieLockInfo", + "name": "vlRadpieLockInfo", + "type": "tuple" + } + ], + "internalType": "struct ReaderDatatype.RadpiePool", + "name": "pool", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "assetPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "assetPerShare", + "type": "uint256" + } + ], + "name": "getRadpieAccountInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakingAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mDLPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockRDPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntDlpBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tvl", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieAccountInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getRadpieEsRDNTInfo", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vestAllowance", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieEsRDNTInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getRadpieInfo", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "masterRadpie", + "type": "address" + }, + { + "internalType": "address", + "name": "radpieStaking", + "type": "address" + }, + { + "internalType": "address", + "name": "rdntRewardManager", + "type": "address" + }, + { + "internalType": "address", + "name": "rdntVestManager", + "type": "address" + }, + { + "internalType": "address", + "name": "vlRDP", + "type": "address" + }, + { + "internalType": "address", + "name": "radpieOFT", + "type": "address" + }, + { + "internalType": "address", + "name": "RDNT", + "type": "address" + }, + { + "internalType": "address", + "name": "WETH", + "type": "address" + }, + { + "internalType": "address", + "name": "RDNT_LP", + "type": "address" + }, + { + "internalType": "address", + "name": "mDLP", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minHealthFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "systemHealthFactor", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "lockedDLPUSD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredDLPUSD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCollateralUSD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nextStartVestTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastHarvestTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalEarnedRDNT", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "systemVestable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "systemVested", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "systemVesting", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalRDNTpersec", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "unlockTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "penalty", + "type": "uint256" + } + ], + "internalType": "struct EarnedBalance[]", + "name": "vestingInfos", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "userVestedRDNT", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userVestingRDNT", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "internalType": "struct VestingSchedule[]", + "name": "userVestingSchedules", + "type": "tuple[]" + } + ], + "internalType": "struct ReaderDatatype.RadpieRDNTInfo", + "name": "systemRDNTInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vestAllowance", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieEsRDNTInfo", + "name": "esRDNTInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeOfPool", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tvl", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "debt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leveragedTVL", + "type": "uint256" + }, + { + "internalType": "address", + "name": "stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiptToken", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "rToken", + "type": "address" + }, + { + "internalType": "address", + "name": "vdToken", + "type": "address" + }, + { + "internalType": "address", + "name": "rewarder", + "type": "address" + }, + { + "internalType": "address", + "name": "helper", + "type": "address" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isNative", + "type": "bool" + }, + { + "internalType": "string", + "name": "poolType", + "type": "string" + }, + { + "internalType": "uint256", + "name": "assetPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quotaLeft", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDPEmission", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "healthFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDepositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTpersec", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieLendingInfo", + "name": "radpieLendingInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.ERC20TokenInfo", + "name": "stakedTokenInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakingAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mDLPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockRDPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntDlpBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tvl", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieAccountInfo", + "name": "accountInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "pendingRDP", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + }, + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "entitledRDNT", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieRewardInfo", + "name": "rewardInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + } + ], + "internalType": "struct ReaderDatatype.RadpieLegacyRewardInfo", + "name": "legacyRewardInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "userTotalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userAmountInCoolDown", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInCoolDown", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedPenaltyAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountToUser", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieUserUnlocking[]", + "name": "userUnlockingSchedule", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "totalPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nextAvailableUnlockSlot", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isFull", + "type": "bool" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieLockInfo", + "name": "vlRadpieLockInfo", + "type": "tuple" + } + ], + "internalType": "struct ReaderDatatype.RadpiePool[]", + "name": "pools", + "type": "tuple[]" + } + ], + "internalType": "struct ReaderDatatype.RadpieInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getRadpieLegacyRewardInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + } + ], + "internalType": "struct ReaderDatatype.RadpieLegacyRewardInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeOfPool", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tvl", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "debt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leveragedTVL", + "type": "uint256" + }, + { + "internalType": "address", + "name": "stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiptToken", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "rToken", + "type": "address" + }, + { + "internalType": "address", + "name": "vdToken", + "type": "address" + }, + { + "internalType": "address", + "name": "rewarder", + "type": "address" + }, + { + "internalType": "address", + "name": "helper", + "type": "address" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isNative", + "type": "bool" + }, + { + "internalType": "string", + "name": "poolType", + "type": "string" + }, + { + "internalType": "uint256", + "name": "assetPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quotaLeft", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDPEmission", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "healthFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDepositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTpersec", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieLendingInfo", + "name": "radpieLendingInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.ERC20TokenInfo", + "name": "stakedTokenInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakingAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mDLPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockRDPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntDlpBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tvl", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieAccountInfo", + "name": "accountInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "pendingRDP", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + }, + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "entitledRDNT", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieRewardInfo", + "name": "rewardInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + } + ], + "internalType": "struct ReaderDatatype.RadpieLegacyRewardInfo", + "name": "legacyRewardInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "userTotalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userAmountInCoolDown", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInCoolDown", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedPenaltyAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountToUser", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieUserUnlocking[]", + "name": "userUnlockingSchedule", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "totalPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nextAvailableUnlockSlot", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isFull", + "type": "bool" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieLockInfo", + "name": "vlRadpieLockInfo", + "type": "tuple" + } + ], + "internalType": "struct ReaderDatatype.RadpiePool", + "name": "pool", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "rTokenBal", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vdTokenBal", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_RDNTrevShare", + "type": "uint256" + } + ], + "name": "getRadpieLendingInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "healthFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDepositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTpersec", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieLendingInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "masterRadpie", + "type": "address" + }, + { + "internalType": "address", + "name": "radpieStaking", + "type": "address" + }, + { + "internalType": "address", + "name": "rdntRewardManager", + "type": "address" + }, + { + "internalType": "address", + "name": "rdntVestManager", + "type": "address" + }, + { + "internalType": "address", + "name": "vlRDP", + "type": "address" + }, + { + "internalType": "address", + "name": "radpieOFT", + "type": "address" + }, + { + "internalType": "address", + "name": "RDNT", + "type": "address" + }, + { + "internalType": "address", + "name": "WETH", + "type": "address" + }, + { + "internalType": "address", + "name": "RDNT_LP", + "type": "address" + }, + { + "internalType": "address", + "name": "mDLP", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minHealthFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "systemHealthFactor", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "lockedDLPUSD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredDLPUSD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCollateralUSD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nextStartVestTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastHarvestTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalEarnedRDNT", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "systemVestable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "systemVested", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "systemVesting", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalRDNTpersec", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "unlockTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "penalty", + "type": "uint256" + } + ], + "internalType": "struct EarnedBalance[]", + "name": "vestingInfos", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "userVestedRDNT", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userVestingRDNT", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "internalType": "struct VestingSchedule[]", + "name": "userVestingSchedules", + "type": "tuple[]" + } + ], + "internalType": "struct ReaderDatatype.RadpieRDNTInfo", + "name": "systemRDNTInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vestAllowance", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieEsRDNTInfo", + "name": "esRDNTInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeOfPool", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tvl", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "debt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leveragedTVL", + "type": "uint256" + }, + { + "internalType": "address", + "name": "stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiptToken", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "rToken", + "type": "address" + }, + { + "internalType": "address", + "name": "vdToken", + "type": "address" + }, + { + "internalType": "address", + "name": "rewarder", + "type": "address" + }, + { + "internalType": "address", + "name": "helper", + "type": "address" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isNative", + "type": "bool" + }, + { + "internalType": "string", + "name": "poolType", + "type": "string" + }, + { + "internalType": "uint256", + "name": "assetPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quotaLeft", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDPEmission", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "healthFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDepositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTpersec", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieLendingInfo", + "name": "radpieLendingInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.ERC20TokenInfo", + "name": "stakedTokenInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakingAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mDLPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockRDPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntDlpBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tvl", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieAccountInfo", + "name": "accountInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "pendingRDP", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + }, + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "entitledRDNT", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieRewardInfo", + "name": "rewardInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + } + ], + "internalType": "struct ReaderDatatype.RadpieLegacyRewardInfo", + "name": "legacyRewardInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "userTotalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userAmountInCoolDown", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInCoolDown", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedPenaltyAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountToUser", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieUserUnlocking[]", + "name": "userUnlockingSchedule", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "totalPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nextAvailableUnlockSlot", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isFull", + "type": "bool" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieLockInfo", + "name": "vlRadpieLockInfo", + "type": "tuple" + } + ], + "internalType": "struct ReaderDatatype.RadpiePool[]", + "name": "pools", + "type": "tuple[]" + } + ], + "internalType": "struct ReaderDatatype.RadpieInfo", + "name": "systemInfo", + "type": "tuple" + } + ], + "name": "getRadpiePoolInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "poolId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sizeOfPool", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tvl", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "debt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leveragedTVL", + "type": "uint256" + }, + { + "internalType": "address", + "name": "stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiptToken", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "rToken", + "type": "address" + }, + { + "internalType": "address", + "name": "vdToken", + "type": "address" + }, + { + "internalType": "address", + "name": "rewarder", + "type": "address" + }, + { + "internalType": "address", + "name": "helper", + "type": "address" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isNative", + "type": "bool" + }, + { + "internalType": "string", + "name": "poolType", + "type": "string" + }, + { + "internalType": "uint256", + "name": "assetPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quotaLeft", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDPEmission", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "healthFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDepositRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTDBorrowRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTAPR", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "RDNTpersec", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieLendingInfo", + "name": "radpieLendingInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.ERC20TokenInfo", + "name": "stakedTokenInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakingAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mDLPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockRDPAllowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rdntDlpBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tvl", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieAccountInfo", + "name": "accountInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "pendingRDP", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + }, + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "entitledRDNT", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieRewardInfo", + "name": "rewardInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + } + ], + "internalType": "struct ReaderDatatype.RadpieLegacyRewardInfo", + "name": "legacyRewardInfo", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "userTotalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userAmountInCoolDown", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInCoolDown", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedPenaltyAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountToUser", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieUserUnlocking[]", + "name": "userUnlockingSchedule", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "totalPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nextAvailableUnlockSlot", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isFull", + "type": "bool" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieLockInfo", + "name": "vlRadpieLockInfo", + "type": "tuple" + } + ], + "internalType": "struct ReaderDatatype.RadpiePool", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getRadpieRDNTInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "lockedDLPUSD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredDLPUSD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCollateralUSD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nextStartVestTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastHarvestTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalEarnedRDNT", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "systemVestable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "systemVested", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "systemVesting", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalRDNTpersec", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "unlockTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "penalty", + "type": "uint256" + } + ], + "internalType": "struct EarnedBalance[]", + "name": "vestingInfos", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "userVestedRDNT", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userVestingRDNT", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "internalType": "struct VestingSchedule[]", + "name": "userVestingSchedules", + "type": "tuple[]" + } + ], + "internalType": "struct ReaderDatatype.RadpieRDNTInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "stakingToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receipt", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getRadpieRewardInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "pendingRDP", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + }, + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "entitledRDNT", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.RadpieRewardInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "locker", + "type": "address" + } + ], + "name": "getVlRadpieLockInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "userTotalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userAmountInCoolDown", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInCoolDown", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedPenaltyAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountToUser", + "type": "uint256" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieUserUnlocking[]", + "name": "userUnlockingSchedule", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "totalPenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nextAvailableUnlockSlot", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isFull", + "type": "bool" + } + ], + "internalType": "struct ReaderDatatype.VlRadpieLockInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_mDLP", + "type": "address" + }, + { + "internalType": "address", + "name": "_RDNT", + "type": "address" + }, + { + "internalType": "address", + "name": "_WETH", + "type": "address" + }, + { + "internalType": "address", + "name": "_RDNT_LP", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterRadpie", + "type": "address" + }, + { + "internalType": "address", + "name": "_radpieStaking", + "type": "address" + } + ], + "name": "init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lendingPool", + "outputs": [ + { + "internalType": "contract ILendingPool", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mDLP", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterRadpie", + "outputs": [ + { + "internalType": "contract IMasterRadpieReader", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "radiantMFD", + "outputs": [ + { + "internalType": "contract IMultiFeeDistribution", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "radpieOFT", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "radpieStaking", + "outputs": [ + { + "internalType": "contract IRadpieStakingReader", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rdntRewardManager", + "outputs": [ + { + "internalType": "contract IRDNTRewardManagerReader", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rdntVestManager", + "outputs": [ + { + "internalType": "contract IRDNTVestManagerReader", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rewardDistributor", + "outputs": [ + { + "internalType": "contract IRewardDistributor", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_radpieOFT", + "type": "address" + } + ], + "name": "setRadpieOFT", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vlRadpie", + "type": "address" + }, + { + "internalType": "uint256", + "name": "poolIndex", + "type": "uint256" + } + ], + "name": "setVLRadpie", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + } + ], + "name": "updateRDNTrevShare", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vlRDP", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vlRDPPoolIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/src/lib/web3/contracts/rdp-reader/methods.js b/src/lib/web3/contracts/rdp-reader/methods.js new file mode 100644 index 00000000..3f0ad841 --- /dev/null +++ b/src/lib/web3/contracts/rdp-reader/methods.js @@ -0,0 +1,9 @@ +const { countFunctionCall } = require('../..') + +const getRadpieInfo = (account, instance) => + countFunctionCall(instance.methods.getRadpieInfo(account).call()) +const getRadpiePoolInfo = (poolId, account, systemInfo, instance) => + countFunctionCall(instance.methods.getRadpiePoolInfo(poolId, account, systemInfo).call()) +const getRDNTAPR = (pool, instance) => countFunctionCall(instance.methods.getRDNTAPR(pool).call()) + +module.exports = { getRadpieInfo, getRadpiePoolInfo, getRDNTAPR } diff --git a/src/lib/web3/contracts/rdp-rewarder/contract.json b/src/lib/web3/contracts/rdp-rewarder/contract.json new file mode 100644 index 00000000..a101ca56 --- /dev/null +++ b/src/lib/web3/contracts/rdp-rewarder/contract.json @@ -0,0 +1,670 @@ +{ + "address": { + "ropsten": "", + "mainnet": "" + }, + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_receiptToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterRadpie", + "type": "address" + }, + { + "internalType": "address", + "name": "_rewardQueuer", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "MustBeRewardToken", + "type": "error" + }, + { + "inputs": [], + "name": "NotAllowZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyMasterRadpie", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyRewardQueuer", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "EmergencyWithdrawn", + "type": "event" + }, + { + "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": "_reward", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "RewardAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_reward", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "RewardPaid", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_allowed", + "type": "bool" + } + ], + "name": "RewardQueuerUpdated", + "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" + }, + { + "inputs": [], + "name": "DENOMINATOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "allEarned", + "outputs": [ + { + "internalType": "uint256[]", + "name": "pendingBonusRewards", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amountReward", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + } + ], + "name": "donateRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + } + ], + "name": "earned", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + } + ], + "name": "emergencyWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "getReward", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getRewardLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_rewardTokens", + "type": "address[]" + } + ], + "name": "getRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isRewardToken", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "operator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amountReward", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + } + ], + "name": "queueNewRewards", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "receiptToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "receiptTokenDecimals", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + } + ], + "name": "rewardPerToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardQueuers", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardTokenInfos", + "outputs": [ + { + "internalType": "address[]", + "name": "bonusTokenAddresses", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "bonusTokenSymbols", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "rewardTokens", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewards", + "outputs": [ + { + "internalType": "uint256", + "name": "rewardPerTokenStored", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "queuedRewards", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stakingDecimals", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalStaked", + "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": "_account", + "type": "address" + } + ], + "name": "updateFor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_rewardManager", + "type": "address" + }, + { + "internalType": "bool", + "name": "_allowed", + "type": "bool" + } + ], + "name": "updateRewardQueuer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "userInfos", + "outputs": [ + { + "internalType": "uint256", + "name": "userRewardPerTokenPaid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userRewards", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/src/lib/web3/contracts/rdp-rewarder/methods.js b/src/lib/web3/contracts/rdp-rewarder/methods.js new file mode 100644 index 00000000..2c50873a --- /dev/null +++ b/src/lib/web3/contracts/rdp-rewarder/methods.js @@ -0,0 +1,17 @@ +const { countFunctionCall } = require('../..') + +const isRewardToken = (address, instance) => + countFunctionCall(instance.methods.isRewardToken(address).call()) +const getStakingToken = instance => countFunctionCall(instance.methods.rewardTokens(0).call()) +const getRewardPerToken = (rewardToken, instance) => + countFunctionCall(instance.methods.RewardPerToken(rewardToken).call()) +const getStakingDecimals = instance => countFunctionCall(instance.methods.stakingDecimals().call()) +const getTotalStaked = instance => countFunctionCall(instance.methods.totalStaked().call()) + +module.exports = { + isRewardToken, + getStakingToken, + getRewardPerToken, + getStakingDecimals, + getTotalStaked, +} diff --git a/src/vaults/apys/implementations/radpie.js b/src/vaults/apys/implementations/radpie.js new file mode 100644 index 00000000..4bfd239b --- /dev/null +++ b/src/vaults/apys/implementations/radpie.js @@ -0,0 +1,91 @@ +const { web3ARBITRUM } = require('../../../lib/web3') +const { radpieReader, radpieRewarder, radpieMaster } = require('../../../lib/web3/contracts') +const addresses = require('../../../lib/data/addresses.json') +const { getTokenPrice } = require('../../../prices') +const { CHAIN_IDS } = require('../../../lib/constants') +const BigNumber = require('bignumber.js') + +const getApy = async (poolId, rewarder, reduction) => { + const web3 = web3ARBITRUM + const { + contract: { abi: radpieReaderAbi, address: radpieReaderAddress }, + methods: radpieReaderMethods, + } = radpieReader + + const { + contract: { abi: radpieRewarderAbi }, + methods: radpieRewarderMethods, + } = radpieRewarder + + const { + contract: { abi: radpieMasterAbi, address: radpieMasterAddress }, + methods: radpieMasterMethods, + } = radpieMaster + + let arbAPY = 0, + rdpAPY = 0 + + const radpieReaderInstance = new web3.eth.Contract(radpieReaderAbi, radpieReaderAddress.mainnet) + + const radpieRewarderInstance = new web3.eth.Contract(radpieRewarderAbi, rewarder) + + const radpieMasterInstance = new web3.eth.Contract(radpieMasterAbi, radpieMasterAddress.mainnet) + + const account = '0x0000000000000000000000000000000000000000' + + const radpieInfo = await radpieReaderMethods.getRadpieInfo( + account.toLowerCase(), + radpieReaderInstance, + ) + + const radpiePoolInfo = await radpieReaderMethods.getRadpiePoolInfo( + poolId, + account, + radpieInfo, + radpieReaderInstance, + ) + + const rdntAPR = await radpieReaderMethods.getRDNTAPR(radpiePoolInfo, radpieReaderInstance) + + const isARBRewardToken = await radpieRewarderMethods.isRewardToken( + addresses.ARB_arbitrum, + radpieRewarderInstance, + ) + + const stakingTokenDecimal = await radpieRewarderMethods.getStakingDecimals(radpieRewarderInstance) + const stakingToken = await radpieRewarderMethods.getStakingToken(radpieRewarderInstance) + const totalStaked = await radpieRewarderMethods.getTotalStaked(radpieRewarderInstance) + const arbPrice = await getTokenPrice('arbitrum') + const stakingTokenPrice = await getTokenPrice(stakingToken, CHAIN_IDS.ARBITRUM_ONE) + + const rdpPoolInfo = await radpieMasterMethods.getPoolData(stakingToken, radpieMasterInstance) + + const rdpRate = new BigNumber(rdpPoolInfo.emission) + const totalSupply = new BigNumber(totalStaked) + const poolSizeInUsd = totalSupply + .dividedBy(new BigNumber(10).exponentiatedBy(stakingTokenDecimal)) + .times(new BigNumber(stakingTokenPrice)) + const rdpPrice = await getTokenPrice('RDP') + const rdpUsdPerSecond = rdpRate.div(1e18).times(rdpPrice) + + rdpAPY = rdpUsdPerSecond.times(86400).times(365.25).div(poolSizeInUsd).times(100) + + if (isARBRewardToken) { + const arbPerDay = 1681.428571 // can be changed randomly depends on Radpie + const stakedBal = new BigNumber(totalStaked).dividedBy( + new BigNumber(10).exponentiatedBy(stakingTokenDecimal), + ) + arbAPY = + (arbPerDay * parseFloat(arbPrice) * 365.25 * 100) / (stakedBal.toFixed() * stakingTokenPrice) + } + + let apy = rdntAPR[1] / 100 + arbAPY + parseFloat(rdpAPY) + if (reduction) { + apy = apy * reduction + } + return apy.toFixed(2) +} + +module.exports = { + getApy, +} diff --git a/src/vaults/trading-apys/implementations/radpie.js b/src/vaults/trading-apys/implementations/radpie.js new file mode 100644 index 00000000..50e4a642 --- /dev/null +++ b/src/vaults/trading-apys/implementations/radpie.js @@ -0,0 +1,37 @@ +const { web3ARBITRUM } = require('../../../lib/web3') +const { radpieReader } = require('../../../lib/web3/contracts') + +const getTradingApy = async poolId => { + const web3 = web3ARBITRUM + const { + contract: { abi: radpieReaderAbi, address: radpieReaderAddress }, + methods: radpieReaderMethods, + } = radpieReader + + const radpieReaderInstance = new web3.eth.Contract(radpieReaderAbi, radpieReaderAddress.mainnet) + + const account = '0x0000000000000000000000000000000000000000' + + const radpieInfo = await radpieReaderMethods.getRadpieInfo( + account.toLowerCase(), + radpieReaderInstance, + ) + + const radpiePoolInfo = await radpieReaderMethods.getRadpiePoolInfo( + poolId, + account, + radpieInfo, + radpieReaderInstance, + ) + + const depositApr = radpiePoolInfo?.radpieLendingInfo?.depositAPR / 100 + const borrowApr = radpiePoolInfo?.radpieLendingInfo?.borrowAPR / 100 + + const apy = depositApr - borrowApr + + return apy.toFixed(2) +} + +module.exports = { + getTradingApy, +}