From 09b5b9de57529c6b83cc411314a5e4ce5e823459 Mon Sep 17 00:00:00 2001 From: antonnell Date: Sat, 27 Nov 2021 09:31:27 +0200 Subject: [PATCH] Convex data collected. Signed-off-by: antonnell --- .../ffDashboardOverview.js | 3 +- components/ffOverview/ffOverview.js | 3 +- components/lendAllAssetRow/lendAllAssetRow.js | 2 +- components/navigation/navigation.js | 4 +- stores/abis/abis.js | 11 +- stores/abis/convexBaseRewardPoolABI.js | 1 + stores/abis/convexBoosterABI.js | 1 + stores/abis/convexCVXABI.js | 1 + stores/abis/convexClaimZapABI.js | 1 + .../abis/convexVirtualBalanceRewardPoolABI.js | 1 + stores/constants/constants.js | 16 ++ stores/fixedForexStore.js | 149 ++++++++++++++---- 12 files changed, 155 insertions(+), 38 deletions(-) create mode 100644 stores/abis/convexBaseRewardPoolABI.js create mode 100644 stores/abis/convexBoosterABI.js create mode 100644 stores/abis/convexCVXABI.js create mode 100644 stores/abis/convexClaimZapABI.js create mode 100644 stores/abis/convexVirtualBalanceRewardPoolABI.js diff --git a/components/ffDashboardOverview/ffDashboardOverview.js b/components/ffDashboardOverview/ffDashboardOverview.js index eee0648..dc344aa 100644 --- a/components/ffDashboardOverview/ffDashboardOverview.js +++ b/components/ffDashboardOverview/ffDashboardOverview.js @@ -82,7 +82,8 @@ export default function ffOverview() { if(asset && asset.gauge) { let pooledBalance = BigNumber(asset.gauge.userPoolBalance).times(asset.gauge.virtualPrice) let stakedBalance = BigNumber(asset.gauge.userGaugeBalance).times(asset.gauge.virtualPrice) - let tot = BigNumber(asset.balance).plus(pooledBalance).plus(stakedBalance).times(asset.price) + let convexBalance = BigNumber(asset.convex.balance).times(asset.gauge.virtualPrice) + let tot = BigNumber(asset.balance).plus(pooledBalance).plus(stakedBalance).plus(convexBalance).times(asset.price) balance = BigNumber(balance).plus(tot) } } diff --git a/components/ffOverview/ffOverview.js b/components/ffOverview/ffOverview.js index ffc483f..5cba01f 100644 --- a/components/ffOverview/ffOverview.js +++ b/components/ffOverview/ffOverview.js @@ -82,7 +82,8 @@ export default function ffOverview() { if(asset && asset.gauge) { let pooledBalance = BigNumber(asset.gauge.userPoolBalance).times(asset.gauge.virtualPrice) let stakedBalance = BigNumber(asset.gauge.userGaugeBalance).times(asset.gauge.virtualPrice) - let tot = BigNumber(asset.balance).plus(pooledBalance).plus(stakedBalance).times(asset.price) + let convexBalance = BigNumber(asset.convex.balance).times(asset.gauge.virtualPrice) + let tot = BigNumber(asset.balance).plus(pooledBalance).plus(stakedBalance).plus(convexBalance).times(asset.price) balance = BigNumber(balance).plus(tot) } } diff --git a/components/lendAllAssetRow/lendAllAssetRow.js b/components/lendAllAssetRow/lendAllAssetRow.js index 32fbdf6..b9b416c 100644 --- a/components/lendAllAssetRow/lendAllAssetRow.js +++ b/components/lendAllAssetRow/lendAllAssetRow.js @@ -488,7 +488,7 @@ export default function LendAllAssetRow({ lendingAsset, lendingBorrow, lendingBo return ( - setOpen(!open)} class={classes.lendindAssetTableRow}> + setOpen(!open)} className={classes.lendindAssetTableRow}>
diff --git a/components/navigation/navigation.js b/components/navigation/navigation.js index 45f887e..bf9addf 100644 --- a/components/navigation/navigation.js +++ b/components/navigation/navigation.js @@ -154,11 +154,11 @@ function Navigation(props) { )}
{renderSubNav( - 'CRV LP', + 'Curve + Convex', 'home', )} {renderSubNav( - 'Uniswap LP', + 'Uniswap', 'staking', )} {renderSubNav( diff --git a/stores/abis/abis.js b/stores/abis/abis.js index 058c1e7..c74ca60 100644 --- a/stores/abis/abis.js +++ b/stores/abis/abis.js @@ -24,6 +24,11 @@ import { uniswapV3PoolABI } from './uniswapV3PoolABI' import { comptrollerABI } from './comptrollerABI' import { cERC20DelegatorABI } from './cERC20DelegatorABI' import { ironBankRegistryAdapterABI } from './ironBankRegistryAdapterABI' +import { convexBaseRewardPoolABI } from './convexBaseRewardPoolABI' +import { convexBoosterABI } from './convexBoosterABI' +import { convexVirtualBalanceRewardPoolABI } from './convexVirtualBalanceRewardPoolABI' +import { convexClaimZapABI } from './convexClaimZapABI' +import { convexCVXABI } from './convexCVXABI' export default { erc20ABI: erc20ABI, @@ -52,5 +57,9 @@ export default { comptrollerABI: comptrollerABI, cERC20DelegatorABI: cERC20DelegatorABI, ironBankRegistryAdapterABI: ironBankRegistryAdapterABI, - + convexBaseRewardPoolABI: convexBaseRewardPoolABI, + convexBoosterABI: convexBoosterABI, + convexVirtualBalanceRewardPoolABI: convexVirtualBalanceRewardPoolABI, + convexClaimZapABI: convexClaimZapABI, + convexCVXABI: convexCVXABI }; diff --git a/stores/abis/convexBaseRewardPoolABI.js b/stores/abis/convexBaseRewardPoolABI.js new file mode 100644 index 0000000..04377e1 --- /dev/null +++ b/stores/abis/convexBaseRewardPoolABI.js @@ -0,0 +1 @@ +export const convexBaseRewardPoolABI = [{"inputs":[{"internalType":"uint256","name":"pid_","type":"uint256"},{"internalType":"address","name":"stakingToken_","type":"address"},{"internalType":"address","name":"rewardToken_","type":"address"},{"internalType":"address","name":"operator_","type":"address"},{"internalType":"address","name":"rewardManager_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","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":[{"internalType":"address","name":"_reward","type":"address"}],"name":"addExtraReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"clearExtraRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"donate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"duration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"extraRewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"extraRewardsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bool","name":"_claimExtras","type":"bool"}],"name":"getReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"historicalRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"newRewardRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewards","type":"uint256"}],"name":"queueNewRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"queuedRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakeAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_for","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stakeFor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"claim","type":"bool"}],"name":"withdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"claim","type":"bool"}],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"claim","type":"bool"}],"name":"withdrawAllAndUnwrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"claim","type":"bool"}],"name":"withdrawAndUnwrap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}] diff --git a/stores/abis/convexBoosterABI.js b/stores/abis/convexBoosterABI.js new file mode 100644 index 0000000..f2c91cf --- /dev/null +++ b/stores/abis/convexBoosterABI.js @@ -0,0 +1 @@ +export const convexBoosterABI = [{"inputs":[{"internalType":"address","name":"_staker","type":"address"},{"internalType":"address","name":"_minter","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"poolid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"poolid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MaxFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_lptoken","type":"address"},{"internalType":"address","name":"_gauge","type":"address"},{"internalType":"uint256","name":"_stashVersion","type":"uint256"}],"name":"addPool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_gauge","type":"address"}],"name":"claimRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"crv","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_stake","type":"bool"}],"name":"deposit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"bool","name":"_stake","type":"bool"}],"name":"depositAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distributionAddressId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"earmarkFees","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"earmarkIncentive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"earmarkRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeDistro","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"gaugeMap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isShutdown","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockFees","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockIncentive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockRewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"address","name":"lptoken","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"gauge","type":"address"},{"internalType":"address","name":"crvRewards","type":"address"},{"internalType":"address","name":"stash","type":"address"},{"internalType":"bool","name":"shutdown","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardArbitrator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"rewardClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_arb","type":"address"}],"name":"setArbitrator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rfactory","type":"address"},{"internalType":"address","name":"_sfactory","type":"address"},{"internalType":"address","name":"_tfactory","type":"address"}],"name":"setFactories","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setFeeInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeM","type":"address"}],"name":"setFeeManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lockFees","type":"uint256"},{"internalType":"uint256","name":"_stakerFees","type":"uint256"},{"internalType":"uint256","name":"_callerFees","type":"uint256"},{"internalType":"uint256","name":"_platform","type":"uint256"}],"name":"setFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"setGaugeRedirect","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_poolM","type":"address"}],"name":"setPoolManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewards","type":"address"},{"internalType":"address","name":"_stakerRewards","type":"address"}],"name":"setRewardContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_voteDelegate","type":"address"}],"name":"setVoteDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"shutdownPool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shutdownSystem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"staker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakerIncentive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakerRewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stashFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_voteId","type":"uint256"},{"internalType":"address","name":"_votingAddress","type":"address"},{"internalType":"bool","name":"_support","type":"bool"}],"name":"vote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"voteDelegate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_gauge","type":"address[]"},{"internalType":"uint256[]","name":"_weight","type":"uint256[]"}],"name":"voteGaugeWeight","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"voteOwnership","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voteParameter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"withdrawAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"withdrawTo","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}] diff --git a/stores/abis/convexCVXABI.js b/stores/abis/convexCVXABI.js new file mode 100644 index 0000000..08c2614 --- /dev/null +++ b/stores/abis/convexCVXABI.js @@ -0,0 +1 @@ +export const convexCVXABI = [{"inputs":[{"internalType":"address","name":"_proxy","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reductionPerCliff","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalCliffs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vecrvProxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}] diff --git a/stores/abis/convexClaimZapABI.js b/stores/abis/convexClaimZapABI.js new file mode 100644 index 0000000..22a3e62 --- /dev/null +++ b/stores/abis/convexClaimZapABI.js @@ -0,0 +1 @@ +export const convexClaimZapABI = [{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address[]","name":"rewardContracts","type":"address[]"},{"internalType":"address[]","name":"extraRewardContracts","type":"address[]"},{"internalType":"address[]","name":"tokenRewardContracts","type":"address[]"},{"internalType":"address[]","name":"tokenRewardTokens","type":"address[]"},{"internalType":"uint256","name":"depositCrvMaxAmount","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"uint256","name":"depositCvxMaxAmount","type":"uint256"},{"internalType":"uint256","name":"spendCvxAmount","type":"uint256"},{"internalType":"uint256","name":"options","type":"uint256"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"crv","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"crvDeposit","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cvx","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cvxCrv","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cvxCrvRewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cvxRewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchange","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"locker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"setApprovals","outputs":[],"stateMutability":"nonpayable","type":"function"}] diff --git a/stores/abis/convexVirtualBalanceRewardPoolABI.js b/stores/abis/convexVirtualBalanceRewardPoolABI.js new file mode 100644 index 0000000..3e6fd0a --- /dev/null +++ b/stores/abis/convexVirtualBalanceRewardPoolABI.js @@ -0,0 +1 @@ +export const convexVirtualBalanceRewardPoolABI = [{"inputs":[{"internalType":"address","name":"deposit_","type":"address"},{"internalType":"address","name":"reward_","type":"address"},{"internalType":"address","name":"op_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","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":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deposits","outputs":[{"internalType":"contract IDeposit","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"donate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"duration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"historicalRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"newRewardRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewards","type":"uint256"}],"name":"queueNewRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"queuedRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}] diff --git a/stores/constants/constants.js b/stores/constants/constants.js index d859d5d..15f44ae 100644 --- a/stores/constants/constants.js +++ b/stores/constants/constants.js @@ -18,6 +18,7 @@ export const GAUGE_PROXY_ADDRESS = '0x81a8CAb6bb568fC94bCa70C9AdbFCF05592dEd7b' export const FF_VEIBFF_DISTRIBUTION_ADDRESS = '0x15E61581AFa2707bca42Bae529387eEa11f68E6e' // -> some other distribution contract ???? export const FF_BOOST_DELEGATE_ADDRESS = '0x0ea89fb2E5b8FA8F14b741ffe1A4617A32611DfC' export const FF_CRV_ADDRESS = '0xd533a949740bb3306d119cc777fa900ba034cd52' +export const FF_CVX_ADDRESS = '0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B' export const FF_IBEUR_CLAIMABLE_ADDRESS = '0xB9d18ab94cf61bB2Bcebe6aC8Ba8c19fF0CDB0cA' export const FF_KP3R_CLAIMABLE_ADDRESS = '0xd4260B2781e2460f49dB746112BB592ba3fb6382' @@ -27,6 +28,9 @@ export const FF_OKP3R_ADDRESS = '0xba15ab4c5b27917e19f772c9718095e248feff35' export const FF_STAKING_REWARDS_V3_ADDRESS = '0x68924dbd6eb82bFe666B2E0403f4cd1Cd6790C3f' export const FF_UNSIWAP_POSITIONS_MANAGER_ADDRESS = '0xC36442b4a4522E871399CD717aBDD847Ab11FE88' +export const FF_CONVEX_POOL_MANAGEMENT_ADDRESS = '0xF403C135812408BFbE8713b5A23a04b3D48AAE31' +export const FF_CONVEX_CLAIM_ZAP = '0x92Cf9E5e4D1Dfbf7dA0d2BB3e884a68416a65070' + export const FF_KP3R_ADDRESS = '0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44' export const FF_VEKP3R_ADDRESS = '0x2FC52C61fB0C03489649311989CE2689D93dC1a2' export const FF_VECLAIM_ADDRESS = '0x076BBBD5384acd0550D8D58Bc758Dd9E0287CCCF' @@ -34,26 +38,38 @@ export const FF_VECLAIM_ADDRESS = '0x076BBBD5384acd0550D8D58Bc758Dd9E0287CCCF' export const IBKRW_ADDRESS = '0x95dFDC8161832e4fF7816aC4B6367CE201538253' // -> KRW export const IBKRW_GAUGE_ADDRESS = '0x1750a3a3d80A3F5333BBe9c4695B0fAd41061ab1' // -> KRW Gauge export const IBKRW_POOL_ADDRESS = '0x8461A004b50d321CB22B7d034969cE6803911899' // -> KRW Pool +export const IBKRW_CONVEX_GAUGE_ADDRESS = '0x8F18C0AF0d7d511E8Bdc6B3c64926B04EDfE4892' +//47 export const IBEUR_ADDRESS = '0x96E61422b6A9bA0e068B6c5ADd4fFaBC6a4aae27' // -> EUR export const IBEUR_GAUGE_ADDRESS = '0x99fb76F75501039089AAC8f20f487bf84E51d76F' // -> EUR Gauge export const IBEUR_POOL_ADDRESS = '0x19b080FE1ffA0553469D20Ca36219F17Fcf03859' // -> EUR Pool +export const IBEUR_CONVEX_GAUGE_ADDRESS = '0xCd0559ADb6fAa2fc83aB21Cf4497c3b9b45bB29f' +//45 export const IBAUD_ADDRESS = '0xFAFdF0C4c1CB09d430Bf88c75D88BB46DAe09967' // -> AUD export const IBAUD_GAUGE_ADDRESS = '0x05ca5c01629a8E5845f12ea3A03fF7331932233A' // -> AUD Gauge export const IBAUD_POOL_ADDRESS = '0x3F1B0278A9ee595635B61817630cC19DE792f506' // -> AUD Pool +export const IBAUD_CONVEX_GAUGE_ADDRESS = '0xb1Fae59F23CaCe4949Ae734E63E42168aDb0CcB3' +//44 export const IBCHF_ADDRESS = '0x1CC481cE2BD2EC7Bf67d1Be64d4878b16078F309' // -> CHF export const IBCHF_GAUGE_ADDRESS = '0x2fA53e8fa5fAdb81f4332C8EcE39Fe62eA2f919E' // -> CHF Gauge export const IBCHF_POOL_ADDRESS = '0x9c2C8910F113181783c249d8F6Aa41b51Cde0f0c' // -> CHF Pool +export const IBCHF_CONVEX_GAUGE_ADDRESS = '0xa5A5905efc55B05059eE247d5CaC6DD6791Cfc33' +//46 export const IBGBP_ADDRESS = '0x69681f8fde45345C3870BCD5eaf4A05a60E7D227' // -> GBP export const IBGBP_GAUGE_ADDRESS = '0x63d9f3aB7d0c528797A12a0684E50C397E9e79dC' // -> GBP Gauge export const IBGBP_POOL_ADDRESS = '0xD6Ac1CB9019137a896343Da59dDE6d097F710538' // -> GBP Pool +export const IBGBP_CONVEX_GAUGE_ADDRESS = '0x51a16DA36c79E28dD3C8c0c19214D8aF413984Aa' +//43 export const IBJPY_ADDRESS = '0x5555f75e3d5278082200Fb451D1b6bA946D8e13b' // -> JPY export const IBJPY_GAUGE_ADDRESS = '0xeFF437A56A22D7dD86C1202A308536ED8C7da7c1' // -> JPY Gauge export const IBJPY_POOL_ADDRESS = '0x8818a9bb44Fbf33502bE7c15c500d0C783B73067' // -> JPY Pool +export const IBJPY_CONVEX_GAUGE_ADDRESS = '0xbA8fE590498ed24D330Bb925E69913b1Ac35a81E' +//42 export const USDC_ADDRESS = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' diff --git a/stores/fixedForexStore.js b/stores/fixedForexStore.js index 9d73083..117d0a4 100644 --- a/stores/fixedForexStore.js +++ b/stores/fixedForexStore.js @@ -7,21 +7,27 @@ import { IBKRW_ADDRESS, IBKRW_GAUGE_ADDRESS, IBKRW_POOL_ADDRESS, + IBKRW_CONVEX_GAUGE_ADDRESS, IBEUR_ADDRESS, IBEUR_GAUGE_ADDRESS, IBEUR_POOL_ADDRESS, + IBEUR_CONVEX_GAUGE_ADDRESS, IBCHF_ADDRESS, IBCHF_GAUGE_ADDRESS, IBCHF_POOL_ADDRESS, + IBCHF_CONVEX_GAUGE_ADDRESS, IBAUD_ADDRESS, IBAUD_GAUGE_ADDRESS, IBAUD_POOL_ADDRESS, + IBAUD_CONVEX_GAUGE_ADDRESS, IBJPY_ADDRESS, IBJPY_GAUGE_ADDRESS, IBJPY_POOL_ADDRESS, + IBJPY_CONVEX_GAUGE_ADDRESS, IBGBP_ADDRESS, IBGBP_GAUGE_ADDRESS, IBGBP_POOL_ADDRESS, + IBGBP_CONVEX_GAUGE_ADDRESS, IBEUR_ETH_ADDRESS, IBFF_ADDRESS, VEIBFF_ADDRESS, @@ -40,10 +46,12 @@ import { FF_CURVE_TOKEN_MINTER_ADDRESS, FF_RKP3R_ADDRESS, FF_OKP3R_ADDRESS, + FF_CVX_ADDRESS, USDC_ADDRESS, CREAM_PRICE_ORACLE_ADDRESS, FF_STAKING_REWARDS_V3_ADDRESS, FF_UNSIWAP_POSITIONS_MANAGER_ADDRESS, + FF_CONVEX_CLAIM_ZAP, IBEUR_ETH_ADDRESS_OLD, IBEUR_GAUGE_ADDRESS_OLD, @@ -389,6 +397,18 @@ class Store { gauge: { address: IBEUR_GAUGE_ADDRESS, poolAddress: IBEUR_POOL_ADDRESS + }, + convex: { + address: IBEUR_CONVEX_GAUGE_ADDRESS, + rewards: [ + { + poolAddress: '0x21034ccc4f8D07d0cF8998Fdd4c45e426540dEc1', //rKP3R Reward Pool + address: FF_RKP3R_ADDRESS, + decimals: 18, + symbol: 'rKP3R', + name: 'Redeemable Keep3r' + } + ] } }, { @@ -400,6 +420,18 @@ class Store { gauge: { address: IBKRW_GAUGE_ADDRESS, poolAddress: IBKRW_POOL_ADDRESS + }, + convex: { + address: IBKRW_CONVEX_GAUGE_ADDRESS, + rewards: [ + { + poolAddress: '0xE3A64E08EEbf38b19a3d9fec51d8cD5A8898Dd5e', //rKP3R Reward Pool + address: FF_RKP3R_ADDRESS, + decimals: 18, + symbol: 'rKP3R', + name: 'Redeemable Keep3r' + } + ] } }, { @@ -411,6 +443,18 @@ class Store { gauge: { address: IBGBP_GAUGE_ADDRESS, poolAddress: IBGBP_POOL_ADDRESS + }, + convex: { + address: IBGBP_CONVEX_GAUGE_ADDRESS, + rewards: [ + { + poolAddress: '0xE689DB5D753abc411ACB8a3fEf226C08ACDAE13f', //rKP3R Reward Pool + address: FF_RKP3R_ADDRESS, + decimals: 18, + symbol: 'rKP3R', + name: 'Redeemable Keep3r' + } + ] } }, { @@ -422,6 +466,18 @@ class Store { gauge: { address: IBCHF_GAUGE_ADDRESS, poolAddress: IBCHF_POOL_ADDRESS + }, + convex: { + address: IBCHF_CONVEX_GAUGE_ADDRESS, + rewards: [ + { + poolAddress: '0x9D9EBCc8E7B4eF061C0F7Bab532d1710b874f789', //rKP3R Reward Pool + address: FF_RKP3R_ADDRESS, + decimals: 18, + symbol: 'rKP3R', + name: 'Redeemable Keep3r' + } + ] } }, { @@ -433,6 +489,18 @@ class Store { gauge: { address: IBAUD_GAUGE_ADDRESS, poolAddress: IBAUD_POOL_ADDRESS + }, + convex: { + address: IBAUD_CONVEX_GAUGE_ADDRESS, + rewards: [ + { + poolAddress: '0x91ad51F0897552ce77f76B44e9a86B4Ad2B28c25', //rKP3R Reward Pool + address: FF_RKP3R_ADDRESS, + decimals: 18, + symbol: 'rKP3R', + name: 'Redeemable Keep3r' + } + ] } }, { @@ -444,6 +512,18 @@ class Store { gauge: { address: IBJPY_GAUGE_ADDRESS, poolAddress: IBJPY_POOL_ADDRESS + }, + convex: { + address: IBJPY_CONVEX_GAUGE_ADDRESS, + rewards: [ + { + poolAddress: '0x771bc5c888d1B318D0c5b177e4F996d3D5fd3d18', //rKP3R Reward Pool + address: FF_RKP3R_ADDRESS, + decimals: 18, + symbol: 'rKP3R', + name: 'Redeemable Keep3r' + } + ] } } ] @@ -463,35 +543,6 @@ class Store { } } - // _getAssetInfo = async (web3, asset, account) => { - // try { - // const assetContract = new web3.eth.Contract(abis.ibEURABI, asset.address) - // - // const symbol = await assetContract.methods.symbol().call() - // const name = await assetContract.methods.name().call() - // const decimals = parseInt(await assetContract.methods.decimals().call()) - // - // let balance = asset.balance ? asset.balance : 0 - // - // if(account) { - // const balanceOf = await assetContract.methods.balanceOf(account.address).call() - // balance = BigNumber(balanceOf).div(10**decimals).toFixed(decimals) - // } - // - // return { - // address: web3.utils.toChecksumAddress(asset.address), - // symbol, - // name, - // decimals, - // balance, - // gauge: asset.gauge - // } - // } catch(ex) { - // console.log(ex) - // return null - // } - // } - getFFBalances = async (payload) => { try { const assets = this.getStore('assets'); @@ -651,13 +702,27 @@ class Store { gaugeProxyContract.methods.totalWeight().call(), ]); + const convexCVXContract = new web3.eth.Contract(abis.convexCVXABI, FF_CVX_ADDRESS) + const [ convexReductionPerCliff, convexTotalSupply, convexMaxSupply, convexTotalCliffs ] = await Promise.all([ + convexCVXContract.methods.reductionPerCliff().call(), + convexCVXContract.methods.totalSupply().call(), + convexCVXContract.methods.maxSupply().call(), + convexCVXContract.methods.totalCliffs().call(), + ]); + + console.log(convexReductionPerCliff) + console.log(convexTotalSupply) + console.log(convexMaxSupply) + console.log(convexTotalCliffs) const assetsBalances = await Promise.all(assets.map(async (asset) => { const assetContract = new web3.eth.Contract(abis.erc20ABI, asset.address) const gaugeContract = new web3.eth.Contract(abis.gaugeABI, asset.gauge.address) const poolContract = new web3.eth.Contract(abis.poolABI, asset.gauge.poolAddress) + const convexGaugeContract = new web3.eth.Contract(abis.convexBaseRewardPoolABI, asset.convex.address) - const [balanceOf, userGaugeBalance, userGaugeEarned, userRKP3REarned, poolBalances, userPoolBalance, poolSymbol, virtualPrice, poolGaugeAllowance, coins0, coins1, gaugeVotes, userGaugeVotes, price] = await Promise.all([ + const [balanceOf, userGaugeBalance, userGaugeEarned, userRKP3REarned, poolBalances, userPoolBalance, poolSymbol, + virtualPrice, poolGaugeAllowance, coins0, coins1, gaugeVotes, userGaugeVotes, price, convexBalanceOf, convexEarned ] = await Promise.all([ assetContract.methods.balanceOf(account.address).call(), gaugeContract.methods.balanceOf(account.address).call(), gaugeContract.methods.claimable_tokens(account.address).call(), @@ -671,7 +736,9 @@ class Store { poolContract.methods.coins(1).call(), gaugeProxyContract.methods.weights(asset.gauge.poolAddress).call(), gaugeProxyContract.methods.votes(account.address, asset.gauge.poolAddress).call(), - priceOracleContract.methods.getUnderlyingPrice(asset.oracleAddress).call() + priceOracleContract.methods.getUnderlyingPrice(asset.oracleAddress).call(), + convexGaugeContract.methods.balanceOf(account.address).call(), + convexGaugeContract.methods.earned(account.address).call(), ]); // get coin asset info @@ -714,6 +781,10 @@ class Store { gaugeAllowance: BigNumber(coin1GaugeAllowance).div(10**intCoin1Decimasls).toFixed(intCoin1Decimasls), } + const convexRewardContract = new web3.eth.Contract(abis.convexVirtualBalanceRewardPoolABI, asset.convex.rewards[0].poolAddress) + const convexRewardCallsResponse = await convexRewardContract.methods.earned(account.address).call() + + return { balanceOf, poolBalances, @@ -729,6 +800,13 @@ class Store { userGaugeVotes, userRKP3REarned, price, + convexEarned, + convexBalanceOf, + convexRewardCallsResponse, + convexReductionPerCliff, + convexTotalSupply, + convexMaxSupply, + convexTotalCliffs } })) @@ -761,6 +839,14 @@ class Store { assets[i].gauge.rKP3REarned = BigNumber(assetsBalances[i].userRKP3REarned).div(10**18).toFixed(18) assets[i].price = BigNumber(assetsBalances[i].price).div(10 ** (36 - assets[i].decimals)).toFixed(18) + assets[i].convex.balance = BigNumber(assetsBalances[i].convexBalanceOf).div(10**18).toFixed(18) + assets[i].convex.earnedCRV = BigNumber(assetsBalances[i].convexEarned).div(10**18).toFixed(18) // this is crv + + const cliff = BigNumber(assetsBalances[i].convexTotalSupply).div(assetsBalances[i].reductionPerCliff) + const reduction = BigNumber(assetsBalances[i].convexTotalCliffs).minus(cliff) + assets[i].convex.earnedCVX = BigNumber(assetsBalances[i].convexEarned).times(reduction).div(assetsBalances[i].convexTotalCliffs).toFixed(18) // this is crv + assets[i].convex.earnedRKP3R = BigNumber(assetsBalances[i].convexRewardCallsResponse).div(10**18).toFixed(18) + } this.setStore({ assets }) @@ -2716,7 +2802,6 @@ class Store { }); }) .catch((ex) => { - console.log(ex) callback(ex); }) };