From 8b8c63f15482c99f4a649e6ea3b5dc65acf3e839 Mon Sep 17 00:00:00 2001 From: 0xRichter <0xRichter@protonmail.com> Date: Wed, 15 Oct 2025 14:51:07 +0100 Subject: [PATCH] aura adapter fix --- src/adaptors/aura/abis.js | 7951 ----------------- src/adaptors/aura/abis/balancerPool.json | 15 + src/adaptors/aura/abis/booster.json | 59 + src/adaptors/aura/abis/l2coordinator.json | 9 + src/adaptors/aura/config.js | 99 + src/adaptors/aura/constants.js | 15 + src/adaptors/aura/data/get-active-pools.js | 23 + src/adaptors/aura/data/get-balancer-data.js | 62 + src/adaptors/aura/data/get-pool-tvls.js | 43 + src/adaptors/aura/data/get-rewards-data.js | 111 + src/adaptors/aura/data/rpc/balancer-pool.js | 19 + src/adaptors/aura/data/rpc/booster.js | 36 + src/adaptors/aura/data/rpc/erc20.js | 35 + src/adaptors/aura/data/rpc/l2coordinator.js | 28 + .../aura/data/subgraph/balancer-pools.js | 55 + src/adaptors/aura/data/subgraph/globals.js | 38 + src/adaptors/aura/data/subgraph/rewards.js | 41 + src/adaptors/aura/index.js | 507 +- .../aura/utils/calculate-aura-mint.js | 41 + .../aura/utils/calculate-reward-apr.js | 17 + src/adaptors/aura/utils/is-reward-active.js | 19 + src/adaptors/aura/utils/setup-rpc.js | 23 + src/adaptors/aura/utils/token-prices.js | 37 + 23 files changed, 902 insertions(+), 8381 deletions(-) delete mode 100644 src/adaptors/aura/abis.js create mode 100644 src/adaptors/aura/abis/balancerPool.json create mode 100644 src/adaptors/aura/abis/booster.json create mode 100644 src/adaptors/aura/abis/l2coordinator.json create mode 100644 src/adaptors/aura/config.js create mode 100644 src/adaptors/aura/constants.js create mode 100644 src/adaptors/aura/data/get-active-pools.js create mode 100644 src/adaptors/aura/data/get-balancer-data.js create mode 100644 src/adaptors/aura/data/get-pool-tvls.js create mode 100644 src/adaptors/aura/data/get-rewards-data.js create mode 100644 src/adaptors/aura/data/rpc/balancer-pool.js create mode 100644 src/adaptors/aura/data/rpc/booster.js create mode 100644 src/adaptors/aura/data/rpc/erc20.js create mode 100644 src/adaptors/aura/data/rpc/l2coordinator.js create mode 100644 src/adaptors/aura/data/subgraph/balancer-pools.js create mode 100644 src/adaptors/aura/data/subgraph/globals.js create mode 100644 src/adaptors/aura/data/subgraph/rewards.js create mode 100644 src/adaptors/aura/utils/calculate-aura-mint.js create mode 100644 src/adaptors/aura/utils/calculate-reward-apr.js create mode 100644 src/adaptors/aura/utils/is-reward-active.js create mode 100644 src/adaptors/aura/utils/setup-rpc.js create mode 100644 src/adaptors/aura/utils/token-prices.js diff --git a/src/adaptors/aura/abis.js b/src/adaptors/aura/abis.js deleted file mode 100644 index 1b34779bf2..0000000000 --- a/src/adaptors/aura/abis.js +++ /dev/null @@ -1,7951 +0,0 @@ -module.exports = { - boosterABI: [ - { - "inputs":[ - { - "internalType":"address", - "name":"_staker", - "type":"address" - }, - { - "internalType":"address", - "name":"_minter", - "type":"address" - }, - { - "internalType":"address", - "name":"_crv", - "type":"address" - }, - { - "internalType":"address", - "name":"_voteOwnership", - "type":"address" - }, - { - "internalType":"address", - "name":"_voteParameter", - "type":"address" - } - ], - "stateMutability":"nonpayable", - "type":"constructor" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"address", - "name":"newArbitrator", - "type":"address" - } - ], - "name":"ArbitratorUpdated", - "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":"Deposited", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"address", - "name":"rewardFactory", - "type":"address" - }, - { - "indexed":false, - "internalType":"address", - "name":"stashFactory", - "type":"address" - }, - { - "indexed":false, - "internalType":"address", - "name":"tokenFactory", - "type":"address" - } - ], - "name":"FactoriesUpdated", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"address", - "name":"feeDistro", - "type":"address" - }, - { - "indexed":false, - "internalType":"bool", - "name":"active", - "type":"bool" - } - ], - "name":"FeeInfoChanged", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"address", - "name":"feeDistro", - "type":"address" - }, - { - "indexed":false, - "internalType":"address", - "name":"lockFees", - "type":"address" - }, - { - "indexed":false, - "internalType":"address", - "name":"feeToken", - "type":"address" - } - ], - "name":"FeeInfoUpdated", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"address", - "name":"newFeeManager", - "type":"address" - } - ], - "name":"FeeManagerUpdated", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"uint256", - "name":"lockIncentive", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"stakerIncentive", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"earmarkIncentive", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"platformFee", - "type":"uint256" - } - ], - "name":"FeesUpdated", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"address", - "name":"newOwner", - "type":"address" - } - ], - "name":"OwnerUpdated", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"address", - "name":"lpToken", - "type":"address" - }, - { - "indexed":false, - "internalType":"address", - "name":"gauge", - "type":"address" - }, - { - "indexed":false, - "internalType":"address", - "name":"token", - "type":"address" - }, - { - "indexed":false, - "internalType":"address", - "name":"rewardPool", - "type":"address" - }, - { - "indexed":false, - "internalType":"address", - "name":"stash", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"pid", - "type":"uint256" - } - ], - "name":"PoolAdded", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"address", - "name":"newPoolManager", - "type":"address" - } - ], - "name":"PoolManagerUpdated", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"uint256", - "name":"poolId", - "type":"uint256" - } - ], - "name":"PoolShutdown", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"address", - "name":"lockRewards", - "type":"address" - }, - { - "indexed":false, - "internalType":"address", - "name":"stakerRewards", - "type":"address" - } - ], - "name":"RewardContractsUpdated", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"address", - "name":"newTreasury", - "type":"address" - } - ], - "name":"TreasuryUpdated", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"address", - "name":"newVoteDelegate", - "type":"address" - } - ], - "name":"VoteDelegateUpdated", - "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":[ - - ], - "name":"REWARD_MULTIPLIER_DENOMINATOR", - "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":[ - - ], - "name":"bridgeDelegate", - "outputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "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":[ - { - "internalType":"uint256", - "name":"_amount", - "type":"uint256" - } - ], - "name":"distributeL2Fees", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"_feeToken", - "type":"address" - } - ], - "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":"feeManager", - "outputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "name":"feeTokens", - "outputs":[ - { - "internalType":"address", - "name":"distro", - "type":"address" - }, - { - "internalType":"address", - "name":"rewards", - "type":"address" - }, - { - "internalType":"bool", - "name":"active", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "name":"gaugeMap", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "name":"getRewardMultipliers", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"isShutdown", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "name":"l2FeesHistory", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "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":"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":"_bridgeDelegate", - "type":"address" - } - ], - "name":"setBridgeDelegate", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"_delegateContract", - "type":"address" - }, - { - "internalType":"address", - "name":"_delegate", - "type":"address" - }, - { - "internalType":"bytes32", - "name":"_space", - "type":"bytes32" - } - ], - "name":"setDelegate", - "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":[ - { - "internalType":"address", - "name":"_feeToken", - "type":"address" - }, - { - "internalType":"address", - "name":"_feeDistro", - "type":"address" - } - ], - "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":"rewardContract", - "type":"address" - }, - { - "internalType":"uint256", - "name":"multiplier", - "type":"uint256" - } - ], - "name":"setRewardMultiplier", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"_treasury", - "type":"address" - } - ], - "name":"setTreasury", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes32", - "name":"_hash", - "type":"bytes32" - } - ], - "name":"setVote", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "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":"address", - "name":"_feeToken", - "type":"address" - }, - { - "internalType":"bool", - "name":"_active", - "type":"bool" - } - ], - "name":"updateFeeInfo", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "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" - } - ], - stakingABI: [ - { - "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" - }, - { - "internalType":"address", - "name":"lptoken_", - "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":"caller", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"owner", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"assets", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"shares", - "type":"uint256" - } - ], - "name":"Deposit", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"uint256", - "name":"reward", - "type":"uint256" - } - ], - "name":"RewardAdded", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"user", - "type":"address" - }, - { - "indexed":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":"from", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"to", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"value", - "type":"uint256" - } - ], - "name":"Transfer", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"caller", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"receiver", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"owner", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"assets", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"shares", - "type":"uint256" - } - ], - "name":"Withdraw", - "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":"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":[ - - ], - "name":"asset", - "outputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "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":[ - { - "internalType":"uint256", - "name":"shares", - "type":"uint256" - } - ], - "name":"convertToAssets", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"assets", - "type":"uint256" - } - ], - "name":"convertToShares", - "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":"decimals", - "outputs":[ - { - "internalType":"uint8", - "name":"", - "type":"uint8" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"assets", - "type":"uint256" - }, - { - "internalType":"address", - "name":"receiver", - "type":"address" - } - ], - "name":"deposit", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "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":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "name":"maxDeposit", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"owner", - "type":"address" - } - ], - "name":"maxMint", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"owner", - "type":"address" - } - ], - "name":"maxRedeem", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"owner", - "type":"address" - } - ], - "name":"maxWithdraw", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"shares", - "type":"uint256" - }, - { - "internalType":"address", - "name":"receiver", - "type":"address" - } - ], - "name":"mint", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"name", - "outputs":[ - { - "internalType":"string", - "name":"", - "type":"string" - } - ], - "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":"assets", - "type":"uint256" - } - ], - "name":"previewDeposit", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"shares", - "type":"uint256" - } - ], - "name":"previewMint", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"shares", - "type":"uint256" - } - ], - "name":"previewRedeem", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"assets", - "type":"uint256" - } - ], - "name":"previewWithdraw", - "outputs":[ - { - "internalType":"uint256", - "name":"shares", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"processIdleRewards", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "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":[ - { - "internalType":"uint256", - "name":"shares", - "type":"uint256" - }, - { - "internalType":"address", - "name":"receiver", - "type":"address" - }, - { - "internalType":"address", - "name":"owner", - "type":"address" - } - ], - "name":"redeem", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"nonpayable", - "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":"symbol", - "outputs":[ - { - "internalType":"string", - "name":"", - "type":"string" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"totalAssets", - "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":"", - "type":"address" - }, - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "name":"transfer", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - }, - { - "internalType":"address", - "name":"", - "type":"address" - }, - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "name":"transferFrom", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"nonpayable", - "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":"uint256", - "name":"assets", - "type":"uint256" - }, - { - "internalType":"address", - "name":"receiver", - "type":"address" - }, - { - "internalType":"address", - "name":"owner", - "type":"address" - } - ], - "name":"withdraw", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "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" - } - ], - miningABI: [ - { - "inputs":[ - { - "internalType":"uint256", - "name":"_amount", - "type":"uint256" - } - ], - "name":"convertCrvToCvx", - "outputs":[ - { - "internalType":"uint256", - "name":"amount", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"cvx", - "outputs":[ - { - "internalType":"contract ICvx", - "name":"", - "type":"ICvx" - } - ], - "stateMutability":"view", - "type":"function" - } - ], - virtualBalanceRewardPoolABI: [ - { - "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" - } - ], - stashTokenABI: [ - { - "inputs":[ - { - "internalType":"address", - "name":"_stash", - "type":"address" - } - ], - "stateMutability":"nonpayable", - "type":"constructor" - }, - { - "inputs":[ - - ], - "name":"MAX_TOTAL_SUPPLY", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"baseToken", - "outputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"_operator", - "type":"address" - }, - { - "internalType":"address", - "name":"_rewardPool", - "type":"address" - }, - { - "internalType":"address", - "name":"_baseToken", - "type":"address" - } - ], - "name":"init", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"isImplementation", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"isValid", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "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":"rewardPool", - "outputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bool", - "name":"_isValid", - "type":"bool" - } - ], - "name":"setIsValid", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"stash", - "outputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"symbol", - "outputs":[ - { - "internalType":"string", - "name":"", - "type":"string" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"totalSupply", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"_to", - "type":"address" - }, - { - "internalType":"uint256", - "name":"_amount", - "type":"uint256" - } - ], - "name":"transfer", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"nonpayable", - "type":"function" - } - ], - lpTokenABI: [ - { - "inputs":[ - { - "components":[ - { - "internalType":"contract IVault", - "name":"vault", - "type":"address" - }, - { - "internalType":"contract IProtocolFeePercentagesProvider", - "name":"protocolFeeProvider", - "type":"address" - }, - { - "internalType":"string", - "name":"name", - "type":"string" - }, - { - "internalType":"string", - "name":"symbol", - "type":"string" - }, - { - "internalType":"contract IERC20[]", - "name":"tokens", - "type":"address[]" - }, - { - "internalType":"contract IRateProvider[]", - "name":"rateProviders", - "type":"address[]" - }, - { - "internalType":"uint256[]", - "name":"tokenRateCacheDurations", - "type":"uint256[]" - }, - { - "internalType":"bool[]", - "name":"exemptFromYieldProtocolFeeFlags", - "type":"bool[]" - }, - { - "internalType":"uint256", - "name":"amplificationParameter", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"swapFeePercentage", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"pauseWindowDuration", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"bufferPeriodDuration", - "type":"uint256" - }, - { - "internalType":"address", - "name":"owner", - "type":"address" - }, - { - "internalType":"string", - "name":"version", - "type":"string" - } - ], - "internalType":"struct ComposableStablePool.NewPoolParams", - "name":"params", - "type":"tuple" - } - ], - "stateMutability":"nonpayable", - "type":"constructor" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"uint256", - "name":"startValue", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"endValue", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"startTime", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"endTime", - "type":"uint256" - } - ], - "name":"AmpUpdateStarted", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"uint256", - "name":"currentValue", - "type":"uint256" - } - ], - "name":"AmpUpdateStopped", - "type":"event" - }, - { - "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":false, - "internalType":"bool", - "name":"paused", - "type":"bool" - } - ], - "name":"PausedStateChanged", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"uint256", - "name":"feeType", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"protocolFeePercentage", - "type":"uint256" - } - ], - "name":"ProtocolFeePercentageCacheUpdated", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"bool", - "name":"enabled", - "type":"bool" - } - ], - "name":"RecoveryModeStateChanged", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"uint256", - "name":"swapFeePercentage", - "type":"uint256" - } - ], - "name":"SwapFeePercentageChanged", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"uint256", - "name":"tokenIndex", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"rate", - "type":"uint256" - } - ], - "name":"TokenRateCacheUpdated", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"uint256", - "name":"tokenIndex", - "type":"uint256" - }, - { - "indexed":true, - "internalType":"contract IRateProvider", - "name":"provider", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"cacheDuration", - "type":"uint256" - } - ], - "name":"TokenRateProviderSet", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"from", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"to", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"value", - "type":"uint256" - } - ], - "name":"Transfer", - "type":"event" - }, - { - "inputs":[ - - ], - "name":"DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"DOMAIN_SEPARATOR", - "outputs":[ - { - "internalType":"bytes32", - "name":"", - "type":"bytes32" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"owner", - "type":"address" - }, - { - "internalType":"address", - "name":"spender", - "type":"address" - } - ], - "name":"allowance", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"spender", - "type":"address" - }, - { - "internalType":"uint256", - "name":"amount", - "type":"uint256" - } - ], - "name":"approve", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"account", - "type":"address" - } - ], - "name":"balanceOf", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"decimals", - "outputs":[ - { - "internalType":"uint8", - "name":"", - "type":"uint8" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"spender", - "type":"address" - }, - { - "internalType":"uint256", - "name":"amount", - "type":"uint256" - } - ], - "name":"decreaseAllowance", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"disableRecoveryMode", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"enableRecoveryMode", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes4", - "name":"selector", - "type":"bytes4" - } - ], - "name":"getActionId", - "outputs":[ - { - "internalType":"bytes32", - "name":"", - "type":"bytes32" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getActualSupply", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getAmplificationParameter", - "outputs":[ - { - "internalType":"uint256", - "name":"value", - "type":"uint256" - }, - { - "internalType":"bool", - "name":"isUpdating", - "type":"bool" - }, - { - "internalType":"uint256", - "name":"precision", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getAuthorizer", - "outputs":[ - { - "internalType":"contract IAuthorizer", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getBptIndex", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getDomainSeparator", - "outputs":[ - { - "internalType":"bytes32", - "name":"", - "type":"bytes32" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getLastJoinExitData", - "outputs":[ - { - "internalType":"uint256", - "name":"lastJoinExitAmplification", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"lastPostJoinExitInvariant", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getMinimumBpt", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"pure", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"account", - "type":"address" - } - ], - "name":"getNextNonce", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getOwner", - "outputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getPausedState", - "outputs":[ - { - "internalType":"bool", - "name":"paused", - "type":"bool" - }, - { - "internalType":"uint256", - "name":"pauseWindowEndTime", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"bufferPeriodEndTime", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getPoolId", - "outputs":[ - { - "internalType":"bytes32", - "name":"", - "type":"bytes32" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"feeType", - "type":"uint256" - } - ], - "name":"getProtocolFeePercentageCache", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getProtocolFeesCollector", - "outputs":[ - { - "internalType":"contract IProtocolFeesCollector", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getProtocolSwapFeeDelegation", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getRate", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getRateProviders", - "outputs":[ - { - "internalType":"contract IRateProvider[]", - "name":"", - "type":"address[]" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getScalingFactors", - "outputs":[ - { - "internalType":"uint256[]", - "name":"", - "type":"uint256[]" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getSwapFeePercentage", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"contract IERC20", - "name":"token", - "type":"address" - } - ], - "name":"getTokenRate", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"contract IERC20", - "name":"token", - "type":"address" - } - ], - "name":"getTokenRateCache", - "outputs":[ - { - "internalType":"uint256", - "name":"rate", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"oldRate", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"duration", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"expires", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getVault", - "outputs":[ - { - "internalType":"contract IVault", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"inRecoveryMode", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"spender", - "type":"address" - }, - { - "internalType":"uint256", - "name":"addedValue", - "type":"uint256" - } - ], - "name":"increaseAllowance", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"contract IERC20", - "name":"token", - "type":"address" - } - ], - "name":"isTokenExemptFromYieldProtocolFee", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"name", - "outputs":[ - { - "internalType":"string", - "name":"", - "type":"string" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"owner", - "type":"address" - } - ], - "name":"nonces", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "internalType":"address", - "name":"recipient", - "type":"address" - }, - { - "internalType":"uint256[]", - "name":"balances", - "type":"uint256[]" - }, - { - "internalType":"uint256", - "name":"lastChangeBlock", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"protocolSwapFeePercentage", - "type":"uint256" - }, - { - "internalType":"bytes", - "name":"userData", - "type":"bytes" - } - ], - "name":"onExitPool", - "outputs":[ - { - "internalType":"uint256[]", - "name":"", - "type":"uint256[]" - }, - { - "internalType":"uint256[]", - "name":"", - "type":"uint256[]" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "internalType":"address", - "name":"recipient", - "type":"address" - }, - { - "internalType":"uint256[]", - "name":"balances", - "type":"uint256[]" - }, - { - "internalType":"uint256", - "name":"lastChangeBlock", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"protocolSwapFeePercentage", - "type":"uint256" - }, - { - "internalType":"bytes", - "name":"userData", - "type":"bytes" - } - ], - "name":"onJoinPool", - "outputs":[ - { - "internalType":"uint256[]", - "name":"", - "type":"uint256[]" - }, - { - "internalType":"uint256[]", - "name":"", - "type":"uint256[]" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "components":[ - { - "internalType":"enum IVault.SwapKind", - "name":"kind", - "type":"uint8" - }, - { - "internalType":"contract IERC20", - "name":"tokenIn", - "type":"address" - }, - { - "internalType":"contract IERC20", - "name":"tokenOut", - "type":"address" - }, - { - "internalType":"uint256", - "name":"amount", - "type":"uint256" - }, - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "internalType":"uint256", - "name":"lastChangeBlock", - "type":"uint256" - }, - { - "internalType":"address", - "name":"from", - "type":"address" - }, - { - "internalType":"address", - "name":"to", - "type":"address" - }, - { - "internalType":"bytes", - "name":"userData", - "type":"bytes" - } - ], - "internalType":"struct IPoolSwapStructs.SwapRequest", - "name":"swapRequest", - "type":"tuple" - }, - { - "internalType":"uint256[]", - "name":"balances", - "type":"uint256[]" - }, - { - "internalType":"uint256", - "name":"indexIn", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"indexOut", - "type":"uint256" - } - ], - "name":"onSwap", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"pause", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"owner", - "type":"address" - }, - { - "internalType":"address", - "name":"spender", - "type":"address" - }, - { - "internalType":"uint256", - "name":"value", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"deadline", - "type":"uint256" - }, - { - "internalType":"uint8", - "name":"v", - "type":"uint8" - }, - { - "internalType":"bytes32", - "name":"r", - "type":"bytes32" - }, - { - "internalType":"bytes32", - "name":"s", - "type":"bytes32" - } - ], - "name":"permit", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "internalType":"address", - "name":"recipient", - "type":"address" - }, - { - "internalType":"uint256[]", - "name":"balances", - "type":"uint256[]" - }, - { - "internalType":"uint256", - "name":"lastChangeBlock", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"protocolSwapFeePercentage", - "type":"uint256" - }, - { - "internalType":"bytes", - "name":"userData", - "type":"bytes" - } - ], - "name":"queryExit", - "outputs":[ - { - "internalType":"uint256", - "name":"bptIn", - "type":"uint256" - }, - { - "internalType":"uint256[]", - "name":"amountsOut", - "type":"uint256[]" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "internalType":"address", - "name":"recipient", - "type":"address" - }, - { - "internalType":"uint256[]", - "name":"balances", - "type":"uint256[]" - }, - { - "internalType":"uint256", - "name":"lastChangeBlock", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"protocolSwapFeePercentage", - "type":"uint256" - }, - { - "internalType":"bytes", - "name":"userData", - "type":"bytes" - } - ], - "name":"queryJoin", - "outputs":[ - { - "internalType":"uint256", - "name":"bptOut", - "type":"uint256" - }, - { - "internalType":"uint256[]", - "name":"amountsIn", - "type":"uint256[]" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"contract IERC20", - "name":"token", - "type":"address" - }, - { - "internalType":"bytes", - "name":"poolConfig", - "type":"bytes" - } - ], - "name":"setAssetManagerPoolConfig", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"swapFeePercentage", - "type":"uint256" - } - ], - "name":"setSwapFeePercentage", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"contract IERC20", - "name":"token", - "type":"address" - }, - { - "internalType":"uint256", - "name":"duration", - "type":"uint256" - } - ], - "name":"setTokenRateCacheDuration", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"rawEndValue", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"endTime", - "type":"uint256" - } - ], - "name":"startAmplificationParameterUpdate", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"stopAmplificationParameterUpdate", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"symbol", - "outputs":[ - { - "internalType":"string", - "name":"", - "type":"string" - } - ], - "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":"unpause", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"updateProtocolFeePercentageCache", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"contract IERC20", - "name":"token", - "type":"address" - } - ], - "name":"updateTokenRateCache", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"version", - "outputs":[ - { - "internalType":"string", - "name":"", - "type":"string" - } - ], - "stateMutability":"view", - "type":"function" - } - ], - lpTokenABI2: [ - { - "inputs":[ - { - "internalType":"contract IERC20", - "name":"_token0Inst", - "type":"address" - }, - { - "internalType":"contract IERC20", - "name":"_token1Inst", - "type":"address" - }, - { - "internalType":"contract IVault", - "name":"_vaultInst", - "type":"address" - }, - { - "internalType":"string", - "name":"_poolName", - "type":"string" - }, - { - "internalType":"string", - "name":"_poolSymbol", - "type":"string" - }, - { - "internalType":"enum ICronV1PoolEnums.PoolType", - "name":"_poolType", - "type":"uint8" - } - ], - "stateMutability":"nonpayable", - "type":"constructor" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"admin", - "type":"address" - }, - { - "indexed":false, - "internalType":"bool", - "name":"status", - "type":"bool" - } - ], - "name":"AdministratorStatusChange", - "type":"event" - }, - { - "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":"sender", - "type":"address" - }, - { - "indexed":false, - "internalType":"enum ICronV1PoolEnums.BoolParamType", - "name":"boolParam", - "type":"uint8" - }, - { - "indexed":false, - "internalType":"bool", - "name":"value", - "type":"bool" - } - ], - "name":"BoolParameterChange", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"block", - "type":"uint256" - } - ], - "name":"ExecuteVirtualOrdersEvent", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"feeAddress", - "type":"address" - } - ], - "name":"FeeAddressChange", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"feeShift", - "type":"uint256" - } - ], - "name":"FeeShiftChange", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"token0Out", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"token1Out", - "type":"uint256" - } - ], - "name":"FeeWithdraw", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"delegate", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"tokenIn", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"amountIn", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"intervals", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"orderId", - "type":"uint256" - } - ], - "name":"LongTermSwap", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "indexed":false, - "internalType":"enum ICronV1PoolEnums.ParamType", - "name":"paramType", - "type":"uint8" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"value", - "type":"uint256" - } - ], - "name":"ParameterChange", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"poolTokenAmt", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"token0Out", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"token1Out", - "type":"uint256" - } - ], - "name":"PoolExit", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"recipient", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"token0In", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"token1In", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"poolTokenAmt", - "type":"uint256" - } - ], - "name":"PoolJoin", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"uint256", - "name":"suggestedProtocolFee", - "type":"uint256" - } - ], - "name":"ProtocolFeeTooLarge", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"tokenIn", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"amountIn", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"amountOut", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"swapType", - "type":"uint256" - } - ], - "name":"ShortTermSwap", - "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" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"partner", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"oldList", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"newList", - "type":"address" - } - ], - "name":"UpdatedArbitrageList", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "indexed":false, - "internalType":"address", - "name":"partner", - "type":"address" - }, - { - "indexed":false, - "internalType":"address", - "name":"list", - "type":"address" - } - ], - "name":"UpdatedArbitragePartner", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"owner", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"refundToken", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"refundOut", - "type":"uint256" - }, - { - "indexed":true, - "internalType":"address", - "name":"proceedsToken", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"proceedsOut", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"orderId", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"address", - "name":"sender", - "type":"address" - } - ], - "name":"WithdrawLongTermSwap", - "type":"event" - }, - { - "inputs":[ - - ], - "name":"DOMAIN_SEPARATOR", - "outputs":[ - { - "internalType":"bytes32", - "name":"", - "type":"bytes32" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"POOL_ID", - "outputs":[ - { - "internalType":"bytes32", - "name":"", - "type":"bytes32" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"POOL_TYPE", - "outputs":[ - { - "internalType":"enum ICronV1PoolEnums.PoolType", - "name":"", - "type":"uint8" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"owner", - "type":"address" - }, - { - "internalType":"address", - "name":"spender", - "type":"address" - } - ], - "name":"allowance", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"spender", - "type":"address" - }, - { - "internalType":"uint256", - "name":"amount", - "type":"uint256" - } - ], - "name":"approve", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"account", - "type":"address" - } - ], - "name":"balanceOf", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"decimals", - "outputs":[ - { - "internalType":"uint8", - "name":"", - "type":"uint8" - } - ], - "stateMutability":"pure", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"spender", - "type":"address" - }, - { - "internalType":"uint256", - "name":"amount", - "type":"uint256" - } - ], - "name":"decreaseApproval", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"_maxBlock", - "type":"uint256" - } - ], - "name":"executeVirtualOrdersToBlock", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getBalancerFee", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getBalancerFeeAmounts", - "outputs":[ - { - "internalType":"uint256", - "name":"balFee0U96", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"balFee1U96", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getCronFeeAmounts", - "outputs":[ - { - "internalType":"uint256", - "name":"cronFee0U96", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"cronFee1U96", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getFeeShift", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getLastVirtualOrderBlock", - "outputs":[ - { - "internalType":"uint256", - "name":"lastVirtualOrderBlock", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getLongTermFeePoints", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"_orderId", - "type":"uint256" - } - ], - "name":"getOrder", - "outputs":[ - { - "components":[ - { - "internalType":"bool", - "name":"token0To1", - "type":"bool" - }, - { - "internalType":"uint112", - "name":"salesRate", - "type":"uint112" - }, - { - "internalType":"uint128", - "name":"scaledProceedsAtSubmissionU128", - "type":"uint128" - }, - { - "internalType":"address", - "name":"owner", - "type":"address" - }, - { - "internalType":"address", - "name":"delegate", - "type":"address" - }, - { - "internalType":"uint256", - "name":"orderExpiry", - "type":"uint256" - } - ], - "internalType":"struct Order", - "name":"order", - "type":"tuple" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getOrderAmounts", - "outputs":[ - { - "internalType":"uint256", - "name":"orders0U112", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"orders1U112", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getOrderIdCount", - "outputs":[ - { - "internalType":"uint256", - "name":"nextOrderId", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"_owner", - "type":"address" - }, - { - "internalType":"uint256", - "name":"_offset", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"_maxResults", - "type":"uint256" - } - ], - "name":"getOrderIds", - "outputs":[ - { - "internalType":"uint256[]", - "name":"orderIds", - "type":"uint256[]" - }, - { - "internalType":"uint256", - "name":"numResults", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"totalResults", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getPartnerFeePoints", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getPriceOracle", - "outputs":[ - { - "internalType":"uint256", - "name":"timestamp", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"token0U256F112", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"token1U256F112", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getProceedAmounts", - "outputs":[ - { - "internalType":"uint256", - "name":"proceeds0U112", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"proceeds1U112", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getSalesRates", - "outputs":[ - { - "internalType":"uint256", - "name":"salesRate0U112", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"salesRate1U112", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"_blockNumber", - "type":"uint256" - } - ], - "name":"getSalesRatesEndingPerBlock", - "outputs":[ - { - "internalType":"uint256", - "name":"salesRateEndingPerBlock0U112", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"salesRateEndingPerBlock1U112", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getShortTermFeePoints", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"_maxBlock", - "type":"uint256" - } - ], - "name":"getVirtualPriceOracle", - "outputs":[ - { - "internalType":"uint256", - "name":"timestamp", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"token0U256F112", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"token1U256F112", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"blockNumber", - "type":"uint256" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"_maxBlock", - "type":"uint256" - }, - { - "internalType":"bool", - "name":"_paused", - "type":"bool" - } - ], - "name":"getVirtualReserves", - "outputs":[ - { - "internalType":"uint256", - "name":"blockNumber", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"token0ReserveU112", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"token1ReserveU112", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"token0OrdersU112", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"token1OrdersU112", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"token0ProceedsU112", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"token1ProceedsU112", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"token0BalancerFeesU96", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"token1BalancerFeesU96", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"token0CronFiFeesU96", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"token1CronFiFeesU96", - "type":"uint256" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"spender", - "type":"address" - }, - { - "internalType":"uint256", - "name":"amount", - "type":"uint256" - } - ], - "name":"increaseApproval", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"isCollectingBalancerFees", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"isCollectingCronFees", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"isPaused", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"name", - "outputs":[ - { - "internalType":"string", - "name":"", - "type":"string" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"owner", - "type":"address" - } - ], - "name":"nonces", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes32", - "name":"_poolId", - "type":"bytes32" - }, - { - "internalType":"address", - "name":"_sender", - "type":"address" - }, - { - "internalType":"address", - "name":"_recipient", - "type":"address" - }, - { - "internalType":"uint256[]", - "name":"_currentBalancesU112", - "type":"uint256[]" - }, - { - "internalType":"uint256", - "name":"", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"_protocolFeeDU1F18", - "type":"uint256" - }, - { - "internalType":"bytes", - "name":"_userData", - "type":"bytes" - } - ], - "name":"onExitPool", - "outputs":[ - { - "internalType":"uint256[]", - "name":"amountsOutU112", - "type":"uint256[]" - }, - { - "internalType":"uint256[]", - "name":"dueProtocolFeeAmountsU96", - "type":"uint256[]" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes32", - "name":"_poolId", - "type":"bytes32" - }, - { - "internalType":"address", - "name":"_sender", - "type":"address" - }, - { - "internalType":"address", - "name":"_recipient", - "type":"address" - }, - { - "internalType":"uint256[]", - "name":"_currentBalancesU112", - "type":"uint256[]" - }, - { - "internalType":"uint256", - "name":"", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"_protocolFeeDU1F18", - "type":"uint256" - }, - { - "internalType":"bytes", - "name":"_userData", - "type":"bytes" - } - ], - "name":"onJoinPool", - "outputs":[ - { - "internalType":"uint256[]", - "name":"amountsInU112", - "type":"uint256[]" - }, - { - "internalType":"uint256[]", - "name":"dueProtocolFeeAmountsU96", - "type":"uint256[]" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "components":[ - { - "internalType":"enum IVault.SwapKind", - "name":"kind", - "type":"uint8" - }, - { - "internalType":"contract IERC20", - "name":"tokenIn", - "type":"address" - }, - { - "internalType":"contract IERC20", - "name":"tokenOut", - "type":"address" - }, - { - "internalType":"uint256", - "name":"amount", - "type":"uint256" - }, - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "internalType":"uint256", - "name":"lastChangeBlock", - "type":"uint256" - }, - { - "internalType":"address", - "name":"from", - "type":"address" - }, - { - "internalType":"address", - "name":"to", - "type":"address" - }, - { - "internalType":"bytes", - "name":"userData", - "type":"bytes" - } - ], - "internalType":"struct IPoolSwapStructs.SwapRequest", - "name":"_swapRequest", - "type":"tuple" - }, - { - "internalType":"uint256", - "name":"_currentBalanceTokenInU112", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"_currentBalanceTokenOutU112", - "type":"uint256" - } - ], - "name":"onSwap", - "outputs":[ - { - "internalType":"uint256", - "name":"amountOutU112", - "type":"uint256" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"owner", - "type":"address" - }, - { - "internalType":"address", - "name":"spender", - "type":"address" - }, - { - "internalType":"uint256", - "name":"value", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"deadline", - "type":"uint256" - }, - { - "internalType":"uint8", - "name":"v", - "type":"uint8" - }, - { - "internalType":"bytes32", - "name":"r", - "type":"bytes32" - }, - { - "internalType":"bytes32", - "name":"s", - "type":"bytes32" - } - ], - "name":"permit", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"_admin", - "type":"address" - }, - { - "internalType":"bool", - "name":"_status", - "type":"bool" - } - ], - "name":"setAdminStatus", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"_arbPartner", - "type":"address" - }, - { - "internalType":"address", - "name":"_arbitrageList", - "type":"address" - } - ], - "name":"setArbitragePartner", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bool", - "name":"_collectBalancerFee", - "type":"bool" - } - ], - "name":"setCollectBalancerFees", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"_feeDestination", - "type":"address" - } - ], - "name":"setFeeAddress", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"_feeShift", - "type":"uint256" - } - ], - "name":"setFeeShift", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"_paramTypeU", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"_value", - "type":"uint256" - } - ], - "name":"setParameter", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bool", - "name":"_pauseValue", - "type":"bool" - } - ], - "name":"setPause", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"symbol", - "outputs":[ - { - "internalType":"string", - "name":"", - "type":"string" - } - ], - "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":"updateArbitrageList", - "outputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "stateMutability":"nonpayable", - "type":"function" - } - ], - vaultABI: [ - { - "inputs":[ - { - "internalType":"contract IAuthorizer", - "name":"authorizer", - "type":"address" - }, - { - "internalType":"contract IWETH", - "name":"weth", - "type":"address" - }, - { - "internalType":"uint256", - "name":"pauseWindowDuration", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"bufferPeriodDuration", - "type":"uint256" - } - ], - "stateMutability":"nonpayable", - "type":"constructor" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"contract IAuthorizer", - "name":"newAuthorizer", - "type":"address" - } - ], - "name":"AuthorizerChanged", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"contract IERC20", - "name":"token", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "indexed":false, - "internalType":"address", - "name":"recipient", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"amount", - "type":"uint256" - } - ], - "name":"ExternalBalanceTransfer", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"contract IFlashLoanRecipient", - "name":"recipient", - "type":"address" - }, - { - "indexed":true, - "internalType":"contract IERC20", - "name":"token", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"amount", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"feeAmount", - "type":"uint256" - } - ], - "name":"FlashLoan", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"user", - "type":"address" - }, - { - "indexed":true, - "internalType":"contract IERC20", - "name":"token", - "type":"address" - }, - { - "indexed":false, - "internalType":"int256", - "name":"delta", - "type":"int256" - } - ], - "name":"InternalBalanceChanged", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"bool", - "name":"paused", - "type":"bool" - } - ], - "name":"PausedStateChanged", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "indexed":true, - "internalType":"address", - "name":"liquidityProvider", - "type":"address" - }, - { - "indexed":false, - "internalType":"contract IERC20[]", - "name":"tokens", - "type":"address[]" - }, - { - "indexed":false, - "internalType":"int256[]", - "name":"deltas", - "type":"int256[]" - }, - { - "indexed":false, - "internalType":"uint256[]", - "name":"protocolFeeAmounts", - "type":"uint256[]" - } - ], - "name":"PoolBalanceChanged", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "indexed":true, - "internalType":"address", - "name":"assetManager", - "type":"address" - }, - { - "indexed":true, - "internalType":"contract IERC20", - "name":"token", - "type":"address" - }, - { - "indexed":false, - "internalType":"int256", - "name":"cashDelta", - "type":"int256" - }, - { - "indexed":false, - "internalType":"int256", - "name":"managedDelta", - "type":"int256" - } - ], - "name":"PoolBalanceManaged", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "indexed":true, - "internalType":"address", - "name":"poolAddress", - "type":"address" - }, - { - "indexed":false, - "internalType":"enum IVault.PoolSpecialization", - "name":"specialization", - "type":"uint8" - } - ], - "name":"PoolRegistered", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"relayer", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "indexed":false, - "internalType":"bool", - "name":"approved", - "type":"bool" - } - ], - "name":"RelayerApprovalChanged", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "indexed":true, - "internalType":"contract IERC20", - "name":"tokenIn", - "type":"address" - }, - { - "indexed":true, - "internalType":"contract IERC20", - "name":"tokenOut", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"amountIn", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"amountOut", - "type":"uint256" - } - ], - "name":"Swap", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "indexed":false, - "internalType":"contract IERC20[]", - "name":"tokens", - "type":"address[]" - } - ], - "name":"TokensDeregistered", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "indexed":false, - "internalType":"contract IERC20[]", - "name":"tokens", - "type":"address[]" - }, - { - "indexed":false, - "internalType":"address[]", - "name":"assetManagers", - "type":"address[]" - } - ], - "name":"TokensRegistered", - "type":"event" - }, - { - "inputs":[ - - ], - "name":"WETH", - "outputs":[ - { - "internalType":"contract IWETH", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"enum IVault.SwapKind", - "name":"kind", - "type":"uint8" - }, - { - "components":[ - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "internalType":"uint256", - "name":"assetInIndex", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"assetOutIndex", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"amount", - "type":"uint256" - }, - { - "internalType":"bytes", - "name":"userData", - "type":"bytes" - } - ], - "internalType":"struct IVault.BatchSwapStep[]", - "name":"swaps", - "type":"tuple[]" - }, - { - "internalType":"contract IAsset[]", - "name":"assets", - "type":"address[]" - }, - { - "components":[ - { - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "internalType":"bool", - "name":"fromInternalBalance", - "type":"bool" - }, - { - "internalType":"address payable", - "name":"recipient", - "type":"address" - }, - { - "internalType":"bool", - "name":"toInternalBalance", - "type":"bool" - } - ], - "internalType":"struct IVault.FundManagement", - "name":"funds", - "type":"tuple" - }, - { - "internalType":"int256[]", - "name":"limits", - "type":"int256[]" - }, - { - "internalType":"uint256", - "name":"deadline", - "type":"uint256" - } - ], - "name":"batchSwap", - "outputs":[ - { - "internalType":"int256[]", - "name":"assetDeltas", - "type":"int256[]" - } - ], - "stateMutability":"payable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "internalType":"contract IERC20[]", - "name":"tokens", - "type":"address[]" - } - ], - "name":"deregisterTokens", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "internalType":"address payable", - "name":"recipient", - "type":"address" - }, - { - "components":[ - { - "internalType":"contract IAsset[]", - "name":"assets", - "type":"address[]" - }, - { - "internalType":"uint256[]", - "name":"minAmountsOut", - "type":"uint256[]" - }, - { - "internalType":"bytes", - "name":"userData", - "type":"bytes" - }, - { - "internalType":"bool", - "name":"toInternalBalance", - "type":"bool" - } - ], - "internalType":"struct IVault.ExitPoolRequest", - "name":"request", - "type":"tuple" - } - ], - "name":"exitPool", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"contract IFlashLoanRecipient", - "name":"recipient", - "type":"address" - }, - { - "internalType":"contract IERC20[]", - "name":"tokens", - "type":"address[]" - }, - { - "internalType":"uint256[]", - "name":"amounts", - "type":"uint256[]" - }, - { - "internalType":"bytes", - "name":"userData", - "type":"bytes" - } - ], - "name":"flashLoan", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes4", - "name":"selector", - "type":"bytes4" - } - ], - "name":"getActionId", - "outputs":[ - { - "internalType":"bytes32", - "name":"", - "type":"bytes32" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getAuthorizer", - "outputs":[ - { - "internalType":"contract IAuthorizer", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getDomainSeparator", - "outputs":[ - { - "internalType":"bytes32", - "name":"", - "type":"bytes32" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"user", - "type":"address" - }, - { - "internalType":"contract IERC20[]", - "name":"tokens", - "type":"address[]" - } - ], - "name":"getInternalBalance", - "outputs":[ - { - "internalType":"uint256[]", - "name":"balances", - "type":"uint256[]" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"user", - "type":"address" - } - ], - "name":"getNextNonce", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getPausedState", - "outputs":[ - { - "internalType":"bool", - "name":"paused", - "type":"bool" - }, - { - "internalType":"uint256", - "name":"pauseWindowEndTime", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"bufferPeriodEndTime", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - } - ], - "name":"getPool", - "outputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - }, - { - "internalType":"enum IVault.PoolSpecialization", - "name":"", - "type":"uint8" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "internalType":"contract IERC20", - "name":"token", - "type":"address" - } - ], - "name":"getPoolTokenInfo", - "outputs":[ - { - "internalType":"uint256", - "name":"cash", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"managed", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"lastChangeBlock", - "type":"uint256" - }, - { - "internalType":"address", - "name":"assetManager", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - } - ], - "name":"getPoolTokens", - "outputs":[ - { - "internalType":"contract IERC20[]", - "name":"tokens", - "type":"address[]" - }, - { - "internalType":"uint256[]", - "name":"balances", - "type":"uint256[]" - }, - { - "internalType":"uint256", - "name":"lastChangeBlock", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"getProtocolFeesCollector", - "outputs":[ - { - "internalType":"contract ProtocolFeesCollector", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"user", - "type":"address" - }, - { - "internalType":"address", - "name":"relayer", - "type":"address" - } - ], - "name":"hasApprovedRelayer", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "internalType":"address", - "name":"recipient", - "type":"address" - }, - { - "components":[ - { - "internalType":"contract IAsset[]", - "name":"assets", - "type":"address[]" - }, - { - "internalType":"uint256[]", - "name":"maxAmountsIn", - "type":"uint256[]" - }, - { - "internalType":"bytes", - "name":"userData", - "type":"bytes" - }, - { - "internalType":"bool", - "name":"fromInternalBalance", - "type":"bool" - } - ], - "internalType":"struct IVault.JoinPoolRequest", - "name":"request", - "type":"tuple" - } - ], - "name":"joinPool", - "outputs":[ - - ], - "stateMutability":"payable", - "type":"function" - }, - { - "inputs":[ - { - "components":[ - { - "internalType":"enum IVault.PoolBalanceOpKind", - "name":"kind", - "type":"uint8" - }, - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "internalType":"contract IERC20", - "name":"token", - "type":"address" - }, - { - "internalType":"uint256", - "name":"amount", - "type":"uint256" - } - ], - "internalType":"struct IVault.PoolBalanceOp[]", - "name":"ops", - "type":"tuple[]" - } - ], - "name":"managePoolBalance", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "components":[ - { - "internalType":"enum IVault.UserBalanceOpKind", - "name":"kind", - "type":"uint8" - }, - { - "internalType":"contract IAsset", - "name":"asset", - "type":"address" - }, - { - "internalType":"uint256", - "name":"amount", - "type":"uint256" - }, - { - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "internalType":"address payable", - "name":"recipient", - "type":"address" - } - ], - "internalType":"struct IVault.UserBalanceOp[]", - "name":"ops", - "type":"tuple[]" - } - ], - "name":"manageUserBalance", - "outputs":[ - - ], - "stateMutability":"payable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"enum IVault.SwapKind", - "name":"kind", - "type":"uint8" - }, - { - "components":[ - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "internalType":"uint256", - "name":"assetInIndex", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"assetOutIndex", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"amount", - "type":"uint256" - }, - { - "internalType":"bytes", - "name":"userData", - "type":"bytes" - } - ], - "internalType":"struct IVault.BatchSwapStep[]", - "name":"swaps", - "type":"tuple[]" - }, - { - "internalType":"contract IAsset[]", - "name":"assets", - "type":"address[]" - }, - { - "components":[ - { - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "internalType":"bool", - "name":"fromInternalBalance", - "type":"bool" - }, - { - "internalType":"address payable", - "name":"recipient", - "type":"address" - }, - { - "internalType":"bool", - "name":"toInternalBalance", - "type":"bool" - } - ], - "internalType":"struct IVault.FundManagement", - "name":"funds", - "type":"tuple" - } - ], - "name":"queryBatchSwap", - "outputs":[ - { - "internalType":"int256[]", - "name":"", - "type":"int256[]" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"enum IVault.PoolSpecialization", - "name":"specialization", - "type":"uint8" - } - ], - "name":"registerPool", - "outputs":[ - { - "internalType":"bytes32", - "name":"", - "type":"bytes32" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "internalType":"contract IERC20[]", - "name":"tokens", - "type":"address[]" - }, - { - "internalType":"address[]", - "name":"assetManagers", - "type":"address[]" - } - ], - "name":"registerTokens", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"contract IAuthorizer", - "name":"newAuthorizer", - "type":"address" - } - ], - "name":"setAuthorizer", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bool", - "name":"paused", - "type":"bool" - } - ], - "name":"setPaused", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "internalType":"address", - "name":"relayer", - "type":"address" - }, - { - "internalType":"bool", - "name":"approved", - "type":"bool" - } - ], - "name":"setRelayerApproval", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "components":[ - { - "internalType":"bytes32", - "name":"poolId", - "type":"bytes32" - }, - { - "internalType":"enum IVault.SwapKind", - "name":"kind", - "type":"uint8" - }, - { - "internalType":"contract IAsset", - "name":"assetIn", - "type":"address" - }, - { - "internalType":"contract IAsset", - "name":"assetOut", - "type":"address" - }, - { - "internalType":"uint256", - "name":"amount", - "type":"uint256" - }, - { - "internalType":"bytes", - "name":"userData", - "type":"bytes" - } - ], - "internalType":"struct IVault.SingleSwap", - "name":"singleSwap", - "type":"tuple" - }, - { - "components":[ - { - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "internalType":"bool", - "name":"fromInternalBalance", - "type":"bool" - }, - { - "internalType":"address payable", - "name":"recipient", - "type":"address" - }, - { - "internalType":"bool", - "name":"toInternalBalance", - "type":"bool" - } - ], - "internalType":"struct IVault.FundManagement", - "name":"funds", - "type":"tuple" - }, - { - "internalType":"uint256", - "name":"limit", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"deadline", - "type":"uint256" - } - ], - "name":"swap", - "outputs":[ - { - "internalType":"uint256", - "name":"amountCalculated", - "type":"uint256" - } - ], - "stateMutability":"payable", - "type":"function" - }, - { - "stateMutability":"payable", - "type":"receive" - } - ] -} \ No newline at end of file diff --git a/src/adaptors/aura/abis/balancerPool.json b/src/adaptors/aura/abis/balancerPool.json new file mode 100644 index 0000000000..a83ceb2f43 --- /dev/null +++ b/src/adaptors/aura/abis/balancerPool.json @@ -0,0 +1,15 @@ +[ + { + "inputs": [], + "name": "getPoolId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/src/adaptors/aura/abis/booster.json b/src/adaptors/aura/abis/booster.json new file mode 100644 index 0000000000..d976c4518c --- /dev/null +++ b/src/adaptors/aura/abis/booster.json @@ -0,0 +1,59 @@ +[ + { + "inputs": [], + "name": "poolLength", + "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" + } +] diff --git a/src/adaptors/aura/abis/l2coordinator.json b/src/adaptors/aura/abis/l2coordinator.json new file mode 100644 index 0000000000..25a9caeb07 --- /dev/null +++ b/src/adaptors/aura/abis/l2coordinator.json @@ -0,0 +1,9 @@ +[ + { + "inputs": [], + "name": "mintRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + } +] diff --git a/src/adaptors/aura/config.js b/src/adaptors/aura/config.js new file mode 100644 index 0000000000..b86f6d1146 --- /dev/null +++ b/src/adaptors/aura/config.js @@ -0,0 +1,99 @@ +// Chain-specific configuration +const CHAIN_CONFIG = { + ethereum: { + llamaChainName: 'Ethereum', + balancerChainName: 'MAINNET', + booster: '0xA57b8d98dAE62B26Ec3bcC4a365338157060B234', + chainId: 1, + tokens: { + AURA: '0xc0c293ce456ff0ed870add98a0828dd4d2903dbf', + BAL: '0xba100000625a3754423978a60c9317c58a424e3d', + }, + subgraph: + 'https://subgraph.satsuma-prod.com/65b10f149401/1xhub-ltd/aura-finance-mainnet/api', + }, + arbitrum: { + llamaChainName: 'Arbitrum', + balancerChainName: 'ARBITRUM', + booster: '0x98Ef32edd24e2c92525E59afc4475C1242a30184', + chainId: 42161, + l2Coordinator: '0xeC1c780A275438916E7CEb174D80878f29580606', + tokens: { + AURA: '0x1509706a6c66ca549ff0cb464de88231ddbe213b', + BAL: '0x040d1edc9569d4bab2d15287dc5a4f10f56a56b8', + }, + subgraph: + 'https://subgraph.satsuma-prod.com/65b10f149401/1xhub-ltd/aura-finance-arbitrum/api', + }, + base: { + llamaChainName: 'Base', + balancerChainName: 'BASE', + booster: '0x98Ef32edd24e2c92525E59afc4475C1242a30184', + chainId: 8453, + l2Coordinator: '0x8b2970c237656d3895588B99a8bFe977D5618201', + tokens: { + AURA: '0x1509706a6c66ca549ff0cb464de88231ddbe213b', + BAL: '0x4158734d47fc9692176b5085e0f52ee0da5d47f1', + }, + subgraph: + 'https://subgraph.satsuma-prod.com/65b10f149401/1xhub-ltd/aura-finance-base/api', + }, + avalanche: { + llamaChainName: 'Avalanche', + balancerChainName: 'AVALANCHE', + sdkChainName: 'avax', + booster: '0x98Ef32edd24e2c92525E59afc4475C1242a30184', + chainId: 43114, + l2Coordinator: '0x8b2970c237656d3895588B99a8bFe977D5618201', + tokens: { + AURA: '0x1509706a6c66ca549ff0cb464de88231ddbe213b', + BAL: '0xe15bcb9e0ea69e6ab9fa080c4c4a5632896298c3', + }, + subgraph: + 'https://subgraph.satsuma-prod.com/65b10f149401/1xhub-ltd/aura-finance-avalanche/api', + }, + gnosis: { + llamaChainName: 'xDai', + balancerChainName: 'GNOSIS', + sdkChainName: 'xdai', + booster: '0x98Ef32edd24e2c92525E59afc4475C1242a30184', + chainId: 100, + l2Coordinator: '0x8b2970c237656d3895588B99a8bFe977D5618201', + tokens: { + AURA: '0x1509706a6c66ca549ff0cb464de88231ddbe213b', + BAL: '0x7ef541e2a22058048904fe5744f9c7e4c57af717', + }, + subgraph: + 'https://subgraph.satsuma-prod.com/65b10f149401/1xhub-ltd/aura-finance-gnosis/api', + }, + optimism: { + llamaChainName: 'Optimism', + balancerChainName: 'OPTIMISM', + booster: '0x98Ef32edd24e2c92525E59afc4475C1242a30184', + chainId: 10, + l2Coordinator: '0xeC1c780A275438916E7CEb174D80878f29580606', + tokens: { + AURA: '0x1509706a6c66ca549ff0cb464de88231ddbe213b', + BAL: '0xfe8b128ba8c78aabc59d4c64cee7ff28e9379921', + }, + subgraph: + 'https://subgraph.satsuma-prod.com/65b10f149401/1xhub-ltd/aura-finance-optimism/api', + }, + polygon: { + llamaChainName: 'Polygon', + balancerChainName: 'POLYGON', + booster: '0x98Ef32edd24e2c92525E59afc4475C1242a30184', + chainId: 137, + l2Coordinator: '0x8b2970c237656d3895588B99a8bFe977D5618201', + tokens: { + AURA: '0x1509706a6c66ca549ff0cb464de88231ddbe213b', + BAL: '0x9a71012b13ca4d3d0cdc72a177df3ef03b0e76a3', + }, + subgraph: + 'https://subgraph.satsuma-prod.com/65b10f149401/1xhub-ltd/aura-finance-polygon/api', + }, +}; + +module.exports = { + CHAIN_CONFIG, +}; diff --git a/src/adaptors/aura/constants.js b/src/adaptors/aura/constants.js new file mode 100644 index 0000000000..db9792f527 --- /dev/null +++ b/src/adaptors/aura/constants.js @@ -0,0 +1,15 @@ +// Common time and calculation constants +const COMMON_CONFIG = { + SECONDS_PER_YEAR: 365 * 24 * 60 * 60, + QUEUED_REWARDS_EXTENSION: 7 * 24 * 60 * 60, + DEFAULT_TOKEN_DECIMALS: 18, + AIP_42_ENABLED: true, // 40% reduction applied to most pools (AIP-42) +}; + +// Balancer V3 API endpoint +const BALANCER_API_ENDPOINT = 'https://api-v3.balancer.fi/graphql'; + +module.exports = { + COMMON_CONFIG, + BALANCER_API_ENDPOINT, +}; diff --git a/src/adaptors/aura/data/get-active-pools.js b/src/adaptors/aura/data/get-active-pools.js new file mode 100644 index 0000000000..432894abd1 --- /dev/null +++ b/src/adaptors/aura/data/get-active-pools.js @@ -0,0 +1,23 @@ +const { getPoolCount, fetchPoolInfo } = require('./rpc/booster'); + +/** + * Get all active (non-shutdown) pools from the booster contract + */ +async function getActivePools(chainName, chainConfig) { + if (!chainConfig?.booster) return []; + + const poolLength = await getPoolCount(chainConfig.booster, chainName); + const allPoolsRaw = await fetchPoolInfo( + chainConfig.booster, + poolLength, + chainName + ); + + return allPoolsRaw.flatMap(({ output }, index) => + output && !output.shutdown ? [{ ...output, poolIndex: index }] : [] + ); +} + +module.exports = { + getActivePools, +}; diff --git a/src/adaptors/aura/data/get-balancer-data.js b/src/adaptors/aura/data/get-balancer-data.js new file mode 100644 index 0000000000..bec08be8bc --- /dev/null +++ b/src/adaptors/aura/data/get-balancer-data.js @@ -0,0 +1,62 @@ +const { getPoolIds } = require('./rpc/balancer-pool'); +const { getBalancerPoolsData } = require('./subgraph/balancer-pools'); + +/** + * Get Balancer pool data with processed APRs, staking rewards, and underlying tokens + */ +async function getBalancerData(activePools, sdkChainName, chainConfig) { + const poolIdResults = await getPoolIds( + activePools.map((pool) => pool.lptoken), + sdkChainName + ); + + const balancerPoolsDataMap = await getBalancerPoolsData( + activePools.map((pool, i) => + poolIdResults[i]?.success && poolIdResults[i]?.output + ? poolIdResults[i].output + : pool.lptoken + ), + chainConfig.balancerChainName + ); + + return activePools.reduce((acc, pool, i) => { + const balancerPoolId = + poolIdResults[i]?.success && poolIdResults[i]?.output + ? poolIdResults[i].output + : pool.lptoken; + const poolData = balancerPoolsDataMap[balancerPoolId.toLowerCase()]; + if (!poolData) return acc; + + const apyBase = poolData.dynamicData?.aprItems + ? poolData.dynamicData.aprItems.reduce((aprAcc, item) => { + const aprValue = item.apr * 100 || 0; + + if ( + item.type === 'SWAP_FEE' || + item.type === 'SWAP_FEE_24H' || + item.type === 'IB_YIELD' + ) { + aprAcc += aprValue; + } + + return aprAcc; + }, 0) + : 0; + + acc[pool.poolIndex] = { + apyBase, + underlyingTokens: + poolData.poolTokens?.flatMap((token) => + token.underlyingToken && token.useUnderlyingForAddRemove + ? [token.address, token.underlyingToken.address] + : [token.address] + ) || [], + }; + + return acc; + }, {}); +} + +module.exports = { + getBalancerData, +}; diff --git a/src/adaptors/aura/data/get-pool-tvls.js b/src/adaptors/aura/data/get-pool-tvls.js new file mode 100644 index 0000000000..31502a88fb --- /dev/null +++ b/src/adaptors/aura/data/get-pool-tvls.js @@ -0,0 +1,43 @@ +const { getTotalSupplies } = require('./rpc/erc20'); +const utils = require('../../utils'); + +/** + * Get TVL for Aura pools + */ +async function getPoolTvls(pools, chainName) { + if (!pools?.length) return {}; + + try { + const [totalSupplyResults, tokenPrices] = await Promise.all([ + getTotalSupplies( + pools.map((pool) => pool.token), + chainName + ), + utils + .getData( + `https://coins.llama.fi/prices/current/${pools + .map((pool) => `${chainName}:${pool.lptoken}`) + .join(',') + .toLowerCase()}` + ) + .then((data) => data.coins), + ]); + + return pools.reduce((acc, pool, index) => { + const priceKey = `${chainName}:${pool.lptoken.toLowerCase()}`; + const price = tokenPrices[priceKey]?.price; + const totalSupply = totalSupplyResults[index]?.output; + + acc[pool.poolIndex] = + price && totalSupply ? (Number(totalSupply) / 1e18) * price : 0; + + return acc; + }, {}); + } catch { + return {}; + } +} + +module.exports = { + getPoolTvls, +}; diff --git a/src/adaptors/aura/data/get-rewards-data.js b/src/adaptors/aura/data/get-rewards-data.js new file mode 100644 index 0000000000..75a53329cd --- /dev/null +++ b/src/adaptors/aura/data/get-rewards-data.js @@ -0,0 +1,111 @@ +const { getAuraPoolRewards } = require('./subgraph/rewards'); +const { calculateRewardApr } = require('../utils/calculate-reward-apr'); +const { calculateAuraMintAmount } = require('../utils/calculate-aura-mint'); +const { isRewardActive } = require('../utils/is-reward-active'); +const { fetchTokenPrices } = require('../utils/token-prices'); +const { getMintRate } = require('./rpc/l2coordinator'); +const { COMMON_CONFIG } = require('../constants'); + +/** + * Get rewards data for all pools + */ +async function getRewardsData( + activePools, + chainName, + chainConfig, + tvlsData, + auraGlobals, + sdkChainName +) { + const subgraphData = await getAuraPoolRewards(chainName); + if (!subgraphData?.pools) return {}; + + // Collect all reward tokens for pricing + const rewardTokens = new Set(); + rewardTokens.add(chainConfig.tokens.AURA); + rewardTokens.add(chainConfig.tokens.BAL); + + subgraphData.pools.forEach((pool) => { + pool.rewardData?.forEach((r) => { + if (r.token?.id) rewardTokens.add(r.token.id); + }); + }); + + const [tokenPrices, mintRate] = await Promise.all([ + fetchTokenPrices(rewardTokens, sdkChainName), + getMintRate(chainConfig.l2Coordinator, sdkChainName), + ]); + + const auraTokenAddress = chainConfig.tokens.AURA.toLowerCase(); + const balTokenAddress = chainConfig.tokens.BAL.toLowerCase(); + + return subgraphData.pools.reduce((acc, subgraphPool) => { + const poolIndex = parseInt(subgraphPool.id); + const tvl = tvlsData[poolIndex]; + + if (isNaN(poolIndex) || !subgraphPool.rewardData?.length || !tvl) { + return acc; + } + + acc[poolIndex] = subgraphPool.rewardData.reduce((rewards, r) => { + const rewardToken = r.token?.id?.toLowerCase(); + + const tokenPrice = tokenPrices[rewardToken]; + const isActive = isRewardActive(r.periodFinish, r.queuedRewards); + + // Skip inactive rewards + if (!isActive) return rewards; + if (!tokenPrice) return rewards; + + const apr = calculateRewardApr( + r.rewardRate || '0', + tokenPrice, + tvl, + r.token?.decimals + ); + + if (apr > 0) { + rewards.push({ rewardToken, apr }); + } + + // Calculate minted AURA for BAL rewards + if (rewardToken === balTokenAddress) { + const balPerYear = + BigInt(r.rewardRate || '0') * BigInt(COMMON_CONFIG.SECONDS_PER_YEAR); + const mintedAuraPerYear = calculateAuraMintAmount( + balPerYear.toString(), + auraGlobals + ); + const auraPrice = tokenPrices[auraTokenAddress]; + + if (auraPrice && BigInt(mintedAuraPerYear) > 0n) { + // Apply mintRate multiplier for L2 chains + const adjustedMintedAura = + (BigInt(mintedAuraPerYear) * mintRate) / 1000000000000000000n; + const auraApr = + (((Number(adjustedMintedAura) / 1e18) * auraPrice) / tvl) * 100; + + if (auraApr > 0) { + // Find existing AURA reward and add to it, or create new entry + const existingAuraReward = rewards.find( + (reward) => reward.rewardToken === auraTokenAddress + ); + if (existingAuraReward) { + existingAuraReward.apr += auraApr; + } else { + rewards.push({ rewardToken: auraTokenAddress, apr: auraApr }); + } + } + } + } + + return rewards; + }, []); + + return acc; + }, {}); +} + +module.exports = { + getRewardsData, +}; diff --git a/src/adaptors/aura/data/rpc/balancer-pool.js b/src/adaptors/aura/data/rpc/balancer-pool.js new file mode 100644 index 0000000000..5121ba9a2c --- /dev/null +++ b/src/adaptors/aura/data/rpc/balancer-pool.js @@ -0,0 +1,19 @@ +const sdk = require('@defillama/sdk'); +const balancerPoolABI = require('../../abis/balancerPool.json'); + +/** + * Get pool IDs for multiple Balancer pools + */ +async function getPoolIds(lpTokens, chain) { + const result = await sdk.api.abi.multiCall({ + abi: balancerPoolABI.find(({ name }) => name === 'getPoolId'), + calls: lpTokens.map((token) => ({ target: token })), + chain, + permitFailure: true, + }); + return result.output; +} + +module.exports = { + getPoolIds, +}; diff --git a/src/adaptors/aura/data/rpc/booster.js b/src/adaptors/aura/data/rpc/booster.js new file mode 100644 index 0000000000..d0ed291beb --- /dev/null +++ b/src/adaptors/aura/data/rpc/booster.js @@ -0,0 +1,36 @@ +const sdk = require('@defillama/sdk'); +const boosterABI = require('../../abis/booster.json'); + +/** + * Get the total number of pools from booster contract + */ +async function getPoolCount(booster, chain) { + const result = await sdk.api.abi.call({ + abi: boosterABI.find(({ name }) => name === 'poolLength'), + target: booster, + chain, + permitFailure: true, + }); + return parseInt(result.output ?? 0); +} + +/** + * Fetch pool information for multiple pools + */ +async function fetchPoolInfo(booster, poolCount, chain) { + const result = await sdk.api.abi.multiCall({ + abi: boosterABI.find(({ name }) => name === 'poolInfo'), + calls: Array.from({ length: poolCount }, (_, i) => i).map((index) => ({ + target: booster, + params: [index], + })), + chain, + permitFailure: true, + }); + return result.output; +} + +module.exports = { + getPoolCount, + fetchPoolInfo, +}; diff --git a/src/adaptors/aura/data/rpc/erc20.js b/src/adaptors/aura/data/rpc/erc20.js new file mode 100644 index 0000000000..bdb3fe648e --- /dev/null +++ b/src/adaptors/aura/data/rpc/erc20.js @@ -0,0 +1,35 @@ +const sdk = require('@defillama/sdk'); + +/** + * Get symbols for multiple ERC20 tokens + */ +async function getSymbols(tokenAddresses, chain) { + const result = await sdk.api.abi.multiCall({ + abi: 'erc20:symbol', + calls: tokenAddresses.map((address) => ({ target: address })), + chain, + permitFailure: true, + }); + return result.output.reduce((acc, { output }, idx) => { + acc[idx] = output; + return acc; + }, {}); +} + +/** + * Get total supplies for multiple ERC20 tokens + */ +async function getTotalSupplies(tokenAddresses, chain) { + const result = await sdk.api.abi.multiCall({ + abi: 'erc20:totalSupply', + calls: tokenAddresses.map((address) => ({ target: address })), + chain, + permitFailure: true, + }); + return result.output; +} + +module.exports = { + getSymbols, + getTotalSupplies, +}; diff --git a/src/adaptors/aura/data/rpc/l2coordinator.js b/src/adaptors/aura/data/rpc/l2coordinator.js new file mode 100644 index 0000000000..4755aefbab --- /dev/null +++ b/src/adaptors/aura/data/rpc/l2coordinator.js @@ -0,0 +1,28 @@ +const sdk = require('@defillama/sdk'); +const l2CoordinatorABI = require('../../abis/l2coordinator.json'); + +/** + * Get mintRate from L2Coordinator contract + * Returns 1e18 (100% multiplier) as fallback + */ +async function getMintRate(l2Coordinator, chain) { + if (!l2Coordinator) return 1000000000000000000n; + + try { + const result = await sdk.api.abi.call({ + abi: l2CoordinatorABI.find(({ name }) => name === 'mintRate'), + target: l2Coordinator, + chain, + permitFailure: true, + }); + return result.success && result.output + ? BigInt(result.output) + : 1000000000000000000n; + } catch { + return 1000000000000000000n; + } +} + +module.exports = { + getMintRate, +}; diff --git a/src/adaptors/aura/data/subgraph/balancer-pools.js b/src/adaptors/aura/data/subgraph/balancer-pools.js new file mode 100644 index 0000000000..6859702916 --- /dev/null +++ b/src/adaptors/aura/data/subgraph/balancer-pools.js @@ -0,0 +1,55 @@ +const axios = require('axios'); +const { BALANCER_API_ENDPOINT } = require('../../constants'); + +/** + * Get pool data from Balancer V3 API + */ +async function getBalancerPoolsData(poolIdentifiers, balancerChainName) { + if (!balancerChainName) return {}; + + const query = ` + query Pools($chains: [GqlChain!]!, $ids: [String!] ) { + poolGetPools( + where: { chainIn: $chains, idIn: $ids } + first: 1000 + ) { + id + address + poolTokens { + address + underlyingToken { + address + } + useUnderlyingForAddRemove + } + dynamicData { + aprItems { + apr + type + } + } + } + } + `; + + try { + const data = await axios + .post(BALANCER_API_ENDPOINT, { + query, + variables: { chains: [balancerChainName], ids: poolIdentifiers }, + }) + .then((res) => res.data.data.poolGetPools); + + return data.reduce((acc, pool) => { + if (pool.id) acc[pool.id.toLowerCase()] = pool; + if (pool.address) acc[pool.address.toLowerCase()] = pool; + return acc; + }, {}); + } catch { + return {}; + } +} + +module.exports = { + getBalancerPoolsData, +}; diff --git a/src/adaptors/aura/data/subgraph/globals.js b/src/adaptors/aura/data/subgraph/globals.js new file mode 100644 index 0000000000..3805b356df --- /dev/null +++ b/src/adaptors/aura/data/subgraph/globals.js @@ -0,0 +1,38 @@ +const axios = require('axios'); +const { CHAIN_CONFIG } = require('../../config'); + +let globalsCache = null; + +/** + * Get Aura globals data from mainnet subgraph + */ +async function getAuraGlobals() { + if (globalsCache) return globalsCache; + + const query = ` + query { + global(id: "global") { + auraTotalSupply + auraMaxSupply + auraReductionPerCliff + auraTotalCliffs + } + } + `; + + try { + const response = await axios.post(CHAIN_CONFIG.ethereum.subgraph, { + query, + }); + if (response.data.errors) return null; + + globalsCache = response.data.data.global; + return globalsCache; + } catch { + return null; + } +} + +module.exports = { + getAuraGlobals, +}; diff --git a/src/adaptors/aura/data/subgraph/rewards.js b/src/adaptors/aura/data/subgraph/rewards.js new file mode 100644 index 0000000000..92649422dd --- /dev/null +++ b/src/adaptors/aura/data/subgraph/rewards.js @@ -0,0 +1,41 @@ +const axios = require('axios'); +const { CHAIN_CONFIG } = require('../../config'); + +/** + * Get pool rewards data from Aura subgraph + */ +async function getAuraPoolRewards(chainName) { + const chainConfig = CHAIN_CONFIG[chainName]; + if (!chainConfig?.subgraph) return null; + + const query = ` + query Dynamics { + pools(first: 1000, skip: 0) { + id + lpToken { + id + } + rewardData { + token { + id + decimals + } + rewardRate + periodFinish + queuedRewards + } + } + } + `; + + try { + const response = await axios.post(chainConfig.subgraph, { query }); + return response.data.errors ? null : response.data.data; + } catch { + return null; + } +} + +module.exports = { + getAuraPoolRewards, +}; diff --git a/src/adaptors/aura/index.js b/src/adaptors/aura/index.js index 22e4ba558e..7e17c18c30 100644 --- a/src/adaptors/aura/index.js +++ b/src/adaptors/aura/index.js @@ -1,448 +1,95 @@ const sdk = require('@defillama/sdk'); +const { ethers } = require('ethers'); +const { CHAIN_CONFIG } = require('./config'); +const { getAuraGlobals } = require('./data/subgraph/globals'); +const { getSymbols } = require('./data/rpc/erc20'); +const { getActivePools } = require('./data/get-active-pools'); +const { getPoolTvls } = require('./data/get-pool-tvls'); +const { getBalancerData } = require('./data/get-balancer-data'); +const { getRewardsData } = require('./data/get-rewards-data'); +const { setupRpcProvider } = require('./utils/setup-rpc'); const utils = require('../utils'); -const { - boosterABI, - stakingABI, - miningABI, - virtualBalanceRewardPoolABI, - stashTokenABI, - lpTokenABI, - lpTokenABI2, - vaultABI, -} = require('./abis'); -const _ = require('lodash'); -const ethers = require('ethers'); -const now = Math.floor(Date.now() / 1000); - -const RewardAssetConfig = { - auraAddress: '0xC0c293ce456fF0ED870ADd98a0828Dd4d2903DBF', - balAddress: '0xba100000625a3754423978a60c9317c58a424e3D', -}; - -const ChainConfig = { - ethereum: { - booster: '0xA57b8d98dAE62B26Ec3bcC4a365338157060B234', - balancerVault: '0xBA12222222228d8Ba445958a75a0704d566BF2C8', - auraRewardsCalculator: '0x744Be650cea753de1e69BF6BAd3c98490A855f52', - auraAddress: RewardAssetConfig.auraAddress, - balAddress: RewardAssetConfig.balAddress, - ldoAddress: '0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32', - chainId: 1, - }, - arbitrum: { - booster: '0x98Ef32edd24e2c92525E59afc4475C1242a30184', - balancerVault: '0xBA12222222228d8Ba445958a75a0704d566BF2C8', - auraRewardsCalculator: '0x52A7239eDa381264b8c24cB11d7dF343236007Aa', - auraAddress: '0x1509706a6c66CA549ff0cB464de88231DDBe213B', - balAddress: '0xFE8B128bA8C78aabC59d4c64cEE7fF28e9379921', - ldoAddress: '0x13Ad51ed4F1B7e9Dc168d8a00cB3f4dDD85EfA60', - chainTokens: ['0x912ce59144191c1204e64559fe8253a0e49e6548'], // ARB - chainId: 42161, - }, - optimism: { - booster: '0x98Ef32edd24e2c92525E59afc4475C1242a30184', - balancerVault: '0xBA12222222228d8Ba445958a75a0704d566BF2C8', - auraRewardsCalculator: '0x6306B10E032f9f81D3279D52FAaf6b0cdb53292a', - auraAddress: '0x1509706a6c66CA549ff0cB464de88231DDBe213B', - balAddress: '0xFE8B128bA8C78aabC59d4c64cEE7fF28e9379921', - ldoAddress: '0xFdb794692724153d1488CcdBE0C56c252596735F', - chainTokens: [ - '0x4200000000000000000000000000000000000042', - '0x39FdE572a18448F8139b7788099F0a0740f51205', - ], // OP, OATH - chainId: 10, - }, - xdai: { - booster: '0x98Ef32edd24e2c92525E59afc4475C1242a30184', - balancerVault: '0xBA12222222228d8Ba445958a75a0704d566BF2C8', - auraRewardsCalculator: '0x7deBB37D0b199F5a365Be63C228A85A22Aaa72DE', - auraAddress: '0x1509706a6c66CA549ff0cB464de88231DDBe213B', - balAddress: '0x7eF541E2a22058048904fE5744f9c7E4C57AF717', - ldoAddress: '0x96e334926454CD4B7b4efb8a8fcb650a738aD244', - chainTokens: ['0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb'], // GNO - chainId: 100, - }, - polygon: { - booster: '0x98Ef32edd24e2c92525E59afc4475C1242a30184', - balancerVault: '0xBA12222222228d8Ba445958a75a0704d566BF2C8', - auraRewardsCalculator: '0x9e4CBe2EaFf2FA727bC805E6CbBf2ff01DdB812b', - auraAddress: '0x1509706a6c66CA549ff0cB464de88231DDBe213B', - balAddress: '0x9a71012b13ca4d3d0cdc72a177df3ef03b0e76a3', - ldoAddress: '0xC3C7d422809852031b44ab29EEC9F1EfF2A58756', - chainTokens: ['0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270'], // MATIC - chainId: 137, - }, -}; - -const SECONDS_PER_YEAR = 60 * 60 * 24 * 365; -const SWAP_APR_API = 'https://cache.aura.finance/aura/aprs-deprecated'; - -const main = async () => { - const { pools: swapAprs } = await utils.getData(SWAP_APR_API); - - const rewardAssetKeys = [ - RewardAssetConfig.auraAddress, - RewardAssetConfig.balAddress, - ] - .map((i) => `ethereum:${i}`) - .join(',') - .toLowerCase(); - const rewardTokenPrices = ( - await utils.getData( - `https://coins.llama.fi/prices/current/${rewardAssetKeys}` - ) - ).coins; - const auraPrice = - rewardTokenPrices[`ethereum:${RewardAssetConfig.auraAddress.toLowerCase()}`] - ?.price; - const balPrice = - rewardTokenPrices[`ethereum:${RewardAssetConfig.balAddress.toLowerCase()}`] - ?.price; +async function poolsFunction() { const allPools = []; - for (let chain in ChainConfig) { - const { - booster, - balancerVault, - auraRewardsCalculator, - auraAddress, - balAddress, - ldoAddress, - chainTokens, - } = ChainConfig[chain]; - - const poolLength = parseInt( - ( - await sdk.api.abi.call({ - abi: boosterABI.filter(({ name }) => name === 'poolLength')[0], - target: booster, - chain: chain, - permitFailure: true, - }) - ).output - ); - - const allAuraPools = ( - await sdk.api.abi.multiCall({ - abi: boosterABI.filter(({ name }) => name === 'poolInfo')[0], - calls: _.range(poolLength).map((index) => ({ - chain, - target: booster, - params: [index], - })), - chain, - permitFailure: true, - }) - ).output.map(({ output }) => output); - const validPools = allAuraPools.filter( - (poolInfo) => poolInfo.shutdown == false - ); - - const lastTimeRewardApplicable = ( - await sdk.api.abi.multiCall({ - calls: validPools.map((i) => ({ target: i.crvRewards })), - chain, - abi: stakingABI.find(({ name }) => name === 'lastTimeRewardApplicable'), - permitFailure: true, - }) - ).output.map((o) => o.output); - - const validPoolIds = validPools.map((poolInfo) => - allAuraPools.indexOf(poolInfo) - ); - const validPoolsLength = validPools.length; - - const gaugeContracts = validPools.map((poolInfo) => poolInfo.gauge); - const lpTokens = validPools.map((poolInfo) => poolInfo.lptoken); - const stakingContracts = validPools.map((poolInfo) => poolInfo.crvRewards); - - const totalSupply = ( - await sdk.api.abi.multiCall({ - chain, - calls: validPools.map((p) => ({ target: p.token })), - abi: 'erc20:totalSupply', - permitFailure: true, - }) - ).output.map((o) => o.output); - - const allTokenKeys = [ - ...lpTokens, - auraAddress, - balAddress, - ldoAddress, - ...(chainTokens !== undefined ? chainTokens : []), - ] - .map((i) => `${chain}:${i}`) - .join(',') - .toLowerCase(); + const auraGlobals = await getAuraGlobals(); + if (!auraGlobals) { + return allPools; + } - const tokenPrices = ( - await utils.getData( - `https://coins.llama.fi/prices/current/${allTokenKeys}` - ) - ).coins; + for (const [chainName, chainConfig] of Object.entries(CHAIN_CONFIG)) { + try { + // Setup custom RPC provider for this chain if config is present + setupRpcProvider(chainName, chainConfig); + + const sdkChainName = chainConfig.sdkChainName || chainName; + const activePools = await getActivePools(sdkChainName, chainConfig); + if (activePools.length === 0) continue; + + const lpTokens = activePools.map((pool) => pool.lptoken); + const [symbolsData, tvlsData, balancerData] = await Promise.all([ + getSymbols(lpTokens, sdkChainName), + getPoolTvls(activePools, sdkChainName), + getBalancerData(activePools, sdkChainName, chainConfig), + ]); + + const rewardsData = await getRewardsData( + activePools, + chainName, + chainConfig, + tvlsData, + auraGlobals, + sdkChainName + ); + + const chainPools = activePools.map((pool, idx) => { + const poolIndex = pool.poolIndex; + const poolBalancerData = balancerData[poolIndex] || { + apyBase: 0, + underlyingTokens: [], + }; - const poolTVLs = _.range(validPoolsLength).map((i) => { - if (`${chain}:${lpTokens[i].toLowerCase()}` in tokenPrices) { - return ( - (totalSupply[i] / 1e18) * - tokenPrices[`${chain}:${lpTokens[i].toLowerCase()}`]?.price + // Calculate reward APR and collect reward tokens from Aura subgraph only + const { apyReward, rewardTokens } = ( + rewardsData[poolIndex] || [] + ).reduce( + (acc, reward) => { + acc.apyReward += reward.apr; + if (reward.apr > 0 && reward.rewardToken) { + acc.rewardTokens.push(reward.rewardToken); + } + return acc; + }, + { apyReward: 0, rewardTokens: [] } ); - } else { - return 0; - } - }); - - const balRewardPerSecondRates = ( - await sdk.api.abi.multiCall({ - abi: stakingABI.filter(({ name }) => name === 'rewardRate')[0], - calls: _.range(validPoolsLength).map((i) => ({ - target: stakingContracts[i], - })), - chain, - permitFailure: true, - }) - ).output.map(({ output }) => output); - const balRewardPerYearRates = balRewardPerSecondRates.map( - (i) => i * SECONDS_PER_YEAR - ); - const auraRewardPerYearRates = ( - await sdk.api.abi.multiCall({ - abi: miningABI.filter(({ name }) => name === 'convertCrvToCvx')[0], - calls: _.range(validPoolsLength).map((i) => ({ - target: auraRewardsCalculator, - params: [BigInt(balRewardPerYearRates[i])], - })), - chain, - permitFailure: true, - }) - ).output.map(({ output }) => output); - - const balAPYs = _.range(validPoolsLength).map((i) => { - if (poolTVLs[i] === 0) { - return 0; - } - return ((balRewardPerYearRates[i] / 1e18) * balPrice * 100) / poolTVLs[i]; - }); - - const auraAPYs = _.range(validPoolsLength).map( - (i) => - ((auraRewardPerYearRates[i] / 1e18) * auraPrice * 100) / poolTVLs[i] - ); - const extraRewardLengths = ( - await sdk.api.abi.multiCall({ - abi: stakingABI.filter(({ name }) => name === 'extraRewardsLength')[0], - calls: _.range(validPoolsLength).map((i) => ({ - target: stakingContracts[i], - })), - chain, - permitFailure: true, - }) - ).output.map(({ output }) => output); - - const balancerPoolIds = ( - await sdk.api.abi.multiCall({ - abi: lpTokenABI.filter(({ name }) => name === 'getPoolId')[0], - calls: _.range(validPoolsLength).map((i) => ({ - target: lpTokens[i], - })), - chain, - permitFailure: true, - }) - ).output.map(({ output }) => output); - // only make calls for non-null pool IDs (otherwise it breaks) - const balancerPoolTokenInfos = ( - await sdk.api.abi.multiCall({ - abi: vaultABI.filter(({ name }) => name === 'getPoolTokens')[0], - calls: _.range(validPoolsLength) - .filter((i) => balancerPoolIds[i] !== null) - .map((i) => ({ - target: balancerVault, - params: [balancerPoolIds[i]], - })), - chain, - permitFailure: true, - }) - ).output; - - // create mapping to restore the original array structure with null values - const tokenInfoMapping = {}; - _.range(validPoolsLength) - .filter((i) => balancerPoolIds[i] !== null) - .forEach((i, index) => { - tokenInfoMapping[i] = balancerPoolTokenInfos[index].output; - }); - - // reconstruct array with null values in place - const fullBalancerPoolTokenInfos = _.range(validPoolsLength).map( - (i) => tokenInfoMapping[i] || null - ); - - const underlyingTokens = _.range(validPoolsLength).map( - (i) => - fullBalancerPoolTokenInfos[i]?.tokens?.filter( - (token) => token !== lpTokens[i] - ) || [] - ); - - const uniqueTokens = Array.from(new Set(_.flatten(underlyingTokens))); - const uniqueTokenSymbols = ( - await sdk.api.abi.multiCall({ - abi: 'erc20:symbol', - calls: uniqueTokens.map((target) => ({ - target, - })), - chain, - permitFailure: true, - }) - ).output.map(({ output }) => output); - - const tokenToSymbolMap = uniqueTokens.reduce((obj, token, index) => { - obj[token] = uniqueTokenSymbols[index]; - return obj; - }, {}); - const chainPools = await Promise.all( - _.range(validPoolsLength).map(async (i) => { - const data = { - pool: `${lpTokens[i].toLowerCase()}-aura`, - chain, + return { + pool: `${pool.lptoken}-${chainName}`, + chain: chainConfig.llamaChainName, project: 'aura', - symbol: underlyingTokens[i] - .map((token) => tokenToSymbolMap[token]) - .join('-'), - tvlUsd: poolTVLs[i], - apyReward: auraAPYs[i] + balAPYs[i], - underlyingTokens: underlyingTokens[i], - rewardTokens: [ - ethers.utils.getAddress(auraAddress), - ethers.utils.getAddress(balAddress), - ], - url: `https://app.aura.finance/#/${ChainConfig[chain].chainId}/pool/${validPoolIds[i]}`, + symbol: utils.formatSymbol(symbolsData[idx] ?? 'Unknown'), + tvlUsd: tvlsData[poolIndex] ?? 0, + apyBase: poolBalancerData.apyBase, + apyReward, + rewardTokens: Array.from(new Set(rewardTokens || [])), + underlyingTokens: poolBalancerData.underlyingTokens, + poolMeta: null, + url: `https://app.aura.finance/#/${chainConfig.chainId}/pool/${poolIndex}`, }; + }); - // There are not too many extra reward pools so we do individual calls to simplify - for (let x = 0; x < extraRewardLengths[i]; x++) { - const virtualBalanceRewardPool = ( - await sdk.api.abi.call({ - abi: stakingABI.filter(({ name }) => name === 'extraRewards')[0], - target: stakingContracts[i], - chain, - params: [x], - permitFailure: true, - }) - ).output; - - const periodFinish = ( - await sdk.api.abi.call({ - abi: virtualBalanceRewardPoolABI.filter( - ({ name }) => name === 'periodFinish' - )[0], - target: virtualBalanceRewardPool, - chain, - permitFailure: true, - }) - ).output; - - if (periodFinish < Math.floor(Date.now() / 1000)) continue; - - const extraRewardRate = ( - await sdk.api.abi.call({ - abi: virtualBalanceRewardPoolABI.filter( - ({ name }) => name === 'rewardRate' - )[0], - target: virtualBalanceRewardPool, - chain, - permitFailure: true, - }) - ).output; - - const stashToken = ( - await sdk.api.abi.call({ - abi: virtualBalanceRewardPoolABI.filter( - ({ name }) => name === 'rewardToken' - )[0], - target: virtualBalanceRewardPool, - chain, - permitFailure: true, - }) - ).output; - - const baseToken = ( - await sdk.api.abi.call({ - abi: stashTokenABI.filter(({ name }) => name === 'baseToken')[0], - target: stashToken, - chain, - permitFailure: true, - }) - ).output; - - let tokenPrice; - if (auraAddress === baseToken) { - tokenPrice = auraPrice; - } else if ( - (chain === 'ethereum' && - ![ldoAddress, auraAddress].includes(baseToken)) || - !(`${chain}:${baseToken.toLowerCase()}` in tokenPrices) - ) { - console.log( - validPoolIds[i], - 'new reward token. please add support for', - baseToken - ); - const newTokenPrices = ( - await utils.getData( - `https://coins.llama.fi/prices/current/${chain}:${baseToken.toLowerCase()}` - ) - ).coins; - tokenPrices[`${chain}:${baseToken.toLowerCase()}`] = - newTokenPrices[`${chain}:${baseToken.toLowerCase()}`]; - tokenPrice = - newTokenPrices[`${chain}:${baseToken.toLowerCase()}`]?.price; - } else { - tokenPrice = - tokenPrices[`${chain}:${baseToken.toLowerCase()}`]?.price; - } - - const rewardAPY = - (((extraRewardRate / 1e18) * 86400 * 365 * tokenPrice) / - data.tvlUsd) * - 100; - data.rewardTokens.push(baseToken); - data.apyReward += rewardAPY; - } - - const swapApr = swapAprs.find(({ id }) => id === balancerPoolIds[i]); - if (swapApr?.poolAprs) { - data.apyBase = Number(swapApr.poolAprs.swap); - } - - if (lastTimeRewardApplicable[i] < now) { - data.apyReward = 0; - data.rewardTokens = []; - } - - return data; - }) - ); - - allPools.push(...chainPools.filter((p) => utils.keepFinite(p))); + allPools.push(...chainPools); + } catch (_err) { + console.error(`Error processing ${chainName}:`, _err.message); + // Skip chain on error + } } - return allPools.filter( - (i) => - ![ - '0xc4ce391d82d164c166df9c8336ddf84206b2f812', - '0xc1d48bb722a22cc6abf19facbe27470f08b3db8c', - '0x89bb794097234e5e930446c0cec0ea66b35d7570', - '0x272d6be442e30d7c87390edeb9b96f1e84cecd8d', - '0x6e6bb18449fcf15b79efa2cfa70acf7593088029', - ].includes(i.pool) - ); -}; + return allPools; +} module.exports = { timetravel: false, - apy: main, + apy: poolsFunction, url: 'https://app.aura.finance/', }; diff --git a/src/adaptors/aura/utils/calculate-aura-mint.js b/src/adaptors/aura/utils/calculate-aura-mint.js new file mode 100644 index 0000000000..f035037851 --- /dev/null +++ b/src/adaptors/aura/utils/calculate-aura-mint.js @@ -0,0 +1,41 @@ +const { COMMON_CONFIG } = require('../constants'); + +/** + * Calculate AURA mint amount for a given BAL amount + */ +function calculateAuraMintAmount( + balEarned, + globals, + applyAip42 = COMMON_CONFIG.AIP_42_ENABLED +) { + if (!globals?.auraTotalSupply) return '0'; + + const balEarnedBN = BigInt(balEarned); + if (balEarnedBN < 500000000000000n) return '0'; + + const auraTotalSupply = BigInt(globals.auraTotalSupply); + const auraMaxSupply = BigInt(globals.auraMaxSupply); + const auraReductionPerCliff = BigInt(globals.auraReductionPerCliff); + const auraTotalCliffs = BigInt(globals.auraTotalCliffs); + + const emissionsMinted = auraTotalSupply - auraMaxSupply; + const cliff = emissionsMinted / auraReductionPerCliff; + + if (cliff >= auraTotalCliffs) return '0'; + + const reduction = ((auraTotalCliffs - cliff) * 25n) / 10n + 700n; + let amount = (balEarnedBN * reduction) / auraTotalCliffs; + + // Apply max supply limit + const amtTillMax = auraMaxSupply - emissionsMinted; + if (amount > amtTillMax) amount = amtTillMax; + + // Apply AIP-42 reduction (40% of original) + if (applyAip42) amount = (amount * 4n) / 10n; + + return amount.toString(); +} + +module.exports = { + calculateAuraMintAmount, +}; diff --git a/src/adaptors/aura/utils/calculate-reward-apr.js b/src/adaptors/aura/utils/calculate-reward-apr.js new file mode 100644 index 0000000000..27bc680e63 --- /dev/null +++ b/src/adaptors/aura/utils/calculate-reward-apr.js @@ -0,0 +1,17 @@ +const { COMMON_CONFIG } = require('../constants'); + +/** + * Calculate APR from reward rate + */ +function calculateRewardApr(rewardRate, tokenPrice, tvl, decimals = 18) { + if (!rewardRate || !tokenPrice || !tvl) return 0; + + const rewardPerYear = Number(rewardRate) * COMMON_CONFIG.SECONDS_PER_YEAR; + const rewardPerYearScaled = rewardPerYear / Math.pow(10, decimals); + + return ((rewardPerYearScaled * tokenPrice) / tvl) * 100; +} + +module.exports = { + calculateRewardApr, +}; diff --git a/src/adaptors/aura/utils/is-reward-active.js b/src/adaptors/aura/utils/is-reward-active.js new file mode 100644 index 0000000000..53c752f20e --- /dev/null +++ b/src/adaptors/aura/utils/is-reward-active.js @@ -0,0 +1,19 @@ +const { COMMON_CONFIG } = require('../constants'); + +/** + * Check if rewards are currently active + */ +function isRewardActive(periodFinish, queuedRewards) { + const now = Math.floor(Date.now() / 1000); + let finish = parseInt(periodFinish || '0', 10); + + if (queuedRewards && BigInt(queuedRewards) > 0n) { + finish += COMMON_CONFIG.QUEUED_REWARDS_EXTENSION; + } + + return finish > now; +} + +module.exports = { + isRewardActive, +}; diff --git a/src/adaptors/aura/utils/setup-rpc.js b/src/adaptors/aura/utils/setup-rpc.js new file mode 100644 index 0000000000..777a8796f6 --- /dev/null +++ b/src/adaptors/aura/utils/setup-rpc.js @@ -0,0 +1,23 @@ +const sdk = require('@defillama/sdk'); +const { ethers } = require('ethers'); + +/** + * Configure SDK to use custom RPC provider for a chain + */ +function setupRpcProvider(chainName, chainConfig) { + if (chainConfig.rpc && chainConfig.chainId) { + const sdkChainName = chainConfig.sdkChainName || chainName; + const network = { + name: sdkChainName, + chainId: chainConfig.chainId, + }; + sdk.api.config.setProvider( + sdkChainName, + new ethers.providers.JsonRpcProvider(chainConfig.rpc, network) + ); + } +} + +module.exports = { + setupRpcProvider, +}; diff --git a/src/adaptors/aura/utils/token-prices.js b/src/adaptors/aura/utils/token-prices.js new file mode 100644 index 0000000000..aef64ecc3d --- /dev/null +++ b/src/adaptors/aura/utils/token-prices.js @@ -0,0 +1,37 @@ +const utils = require('../../utils'); + +/** + * Fetch token prices from DefiLlama + */ +async function fetchTokenPrices(tokenAddresses, chainName) { + const tokenPrices = {}; + + const priceKeys = Array.from(tokenAddresses) + .filter((addr) => addr) + .map((addr) => `${chainName}:${addr}`); + + if (priceKeys.length === 0) { + return tokenPrices; + } + + try { + const prices = await utils.getData( + `https://coins.llama.fi/prices/current/${priceKeys.join(',')}` + ); + + Object.entries(prices.coins || {}).forEach(([key, data]) => { + const address = key.split(':')[1]?.toLowerCase(); + if (address) { + tokenPrices[address] = data.price || 0; + } + }); + } catch (error) { + console.error('Error fetching token prices:', error); + } + + return tokenPrices; +} + +module.exports = { + fetchTokenPrices, +};