From 55b58ced62bc468a329faeb932763afbeda7f7e9 Mon Sep 17 00:00:00 2001 From: 0xSzeth <80861276+0xSzeth@users.noreply.github.com> Date: Tue, 31 Oct 2023 23:43:44 -0600 Subject: [PATCH] fix: correct Bunni rewardAPY on L2 (and other minor bugfixes) (#1060) * feat: add Bunni protocol * fix: use minimum of fee0 or fee1 to compute baseFee of a bunni pool * fix: correct Bunni rewardAPY on L2 --------- Co-authored-by: 0xtekgrinder <72015889+0xtekgrinder@users.noreply.github.com> --- src/adaptors/bunni/abis/ChildGauge.json | 1266 +++++++++++++++++++++++ src/adaptors/bunni/index.js | 55 +- 2 files changed, 1302 insertions(+), 19 deletions(-) create mode 100644 src/adaptors/bunni/abis/ChildGauge.json diff --git a/src/adaptors/bunni/abis/ChildGauge.json b/src/adaptors/bunni/abis/ChildGauge.json new file mode 100644 index 0000000000..893387caa0 --- /dev/null +++ b/src/adaptors/bunni/abis/ChildGauge.json @@ -0,0 +1,1266 @@ +[ + { + "name": "Approval", + "inputs": [ + { + "name": "_owner", + "type": "address", + "indexed": true + }, + { + "name": "_spender", + "type": "address", + "indexed": true + }, + { + "name": "_value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Transfer", + "inputs": [ + { + "name": "_from", + "type": "address", + "indexed": true + }, + { + "name": "_to", + "type": "address", + "indexed": true + }, + { + "name": "_value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Deposit", + "inputs": [ + { + "name": "_user", + "type": "address", + "indexed": true + }, + { + "name": "_value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Withdraw", + "inputs": [ + { + "name": "_user", + "type": "address", + "indexed": true + }, + { + "name": "_value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "UpdateLiquidityLimit", + "inputs": [ + { + "name": "_user", + "type": "address", + "indexed": true + }, + { + "name": "_original_balance", + "type": "uint256", + "indexed": false + }, + { + "name": "_original_supply", + "type": "uint256", + "indexed": false + }, + { + "name": "_working_balance", + "type": "uint256", + "indexed": false + }, + { + "name": "_working_supply", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "NewTokenlessProduction", + "inputs": [ + { + "name": "new_tokenless_production", + "type": "uint8", + "indexed": true + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "NewGaugeState", + "inputs": [ + { + "name": "new_gauge_state", + "type": "uint8", + "indexed": true + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "NewManager", + "inputs": [ + { + "name": "new_manager", + "type": "address", + "indexed": true + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "DepositRewardToken", + "inputs": [ + { + "name": "reward_token", + "type": "address", + "indexed": true + }, + { + "name": "amount", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Kick", + "inputs": [ + { + "name": "user", + "type": "address", + "indexed": true + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "SetRewardDistributor", + "inputs": [ + { + "name": "reward_token", + "type": "address", + "indexed": true + }, + { + "name": "distributor", + "type": "address", + "indexed": true + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "AddReward", + "inputs": [ + { + "name": "reward_token", + "type": "address", + "indexed": true + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "ClaimRewards", + "inputs": [ + { + "name": "user", + "type": "address", + "indexed": true + }, + { + "name": "receiver", + "type": "address", + "indexed": true + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "SetRewardsReceiver", + "inputs": [ + { + "name": "user", + "type": "address", + "indexed": true + }, + { + "name": "receiver", + "type": "address", + "indexed": true + } + ], + "anonymous": false, + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "constructor", + "inputs": [ + { + "name": "_factory", + "type": "address" + }, + { + "name": "_uniswap_poor_oracle", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [ + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_user", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [ + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_user", + "type": "address" + }, + { + "name": "_claim_rewards", + "type": "bool" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "withdraw", + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "withdraw", + "inputs": [ + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_user", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "withdraw", + "inputs": [ + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_user", + "type": "address" + }, + { + "name": "_claim_rewards", + "type": "bool" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "transferFrom", + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "approve", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "permit", + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_deadline", + "type": "uint256" + }, + { + "name": "_v", + "type": "uint8" + }, + { + "name": "_r", + "type": "bytes32" + }, + { + "name": "_s", + "type": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "transfer", + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "increaseAllowance", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_added_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "decreaseAllowance", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_subtracted_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "user_checkpoint", + "inputs": [ + { + "name": "addr", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claimable_tokens", + "inputs": [ + { + "name": "addr", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimed_reward", + "inputs": [ + { + "name": "_addr", + "type": "address" + }, + { + "name": "_token", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimable_reward", + "inputs": [ + { + "name": "_user", + "type": "address" + }, + { + "name": "_reward_token", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_rewards_receiver", + "inputs": [ + { + "name": "_receiver", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [ + { + "name": "_addr", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [ + { + "name": "_addr", + "type": "address" + }, + { + "name": "_receiver", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "add_reward", + "inputs": [ + { + "name": "_reward_token", + "type": "address" + }, + { + "name": "_distributor", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_reward_distributor", + "inputs": [ + { + "name": "_reward_token", + "type": "address" + }, + { + "name": "_distributor", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "kick", + "inputs": [ + { + "name": "addr", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit_reward_token", + "inputs": [ + { + "name": "_reward_token", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_manager", + "inputs": [ + { + "name": "_manager", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "makeGaugePermissionless", + "inputs": [], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "killGauge", + "inputs": [], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "unkillGauge", + "inputs": [], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_tokenless_production", + "inputs": [ + { + "name": "new_tokenless_production", + "type": "uint8" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "rescue_token", + "inputs": [ + { + "name": "_token", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "rescue_token", + "inputs": [ + { + "name": "_token", + "type": "address" + }, + { + "name": "_recipient", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "view", + "type": "function", + "name": "decimals", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_checkpoint", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "factory", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "is_killed", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bool" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "_lp_token", + "type": "address" + }, + { + "name": "_manager", + "type": "address" + }, + { + "name": "_position_key", + "type": "bytes32" + } + ], + "outputs": [] + }, + { + "stateMutability": "view", + "type": "function", + "name": "DOMAIN_SEPARATOR", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "nonces", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "tokenless_production", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "gauge_state", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "lp_token", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "manager", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "position_key", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "symbol", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "allowance", + "inputs": [ + { + "name": "arg0", + "type": "address" + }, + { + "name": "arg1", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "balanceOf", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "totalSupply", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "working_balances", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "working_supply", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "period", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "period_timestamp", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_checkpoint_of", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_fraction", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_inv_supply", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_inv_supply_of", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "last_tokenless_production_of", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint8" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_count", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_tokens", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "address" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_data", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "tuple", + "components": [ + { + "name": "distributor", + "type": "address" + }, + { + "name": "period_finish", + "type": "uint256" + }, + { + "name": "rate", + "type": "uint256" + }, + { + "name": "last_update", + "type": "uint256" + }, + { + "name": "integral", + "type": "uint256" + } + ] + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "rewards_receiver", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "address" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_integral_for", + "inputs": [ + { + "name": "arg0", + "type": "address" + }, + { + "name": "arg1", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "inflation_rate", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + } +] \ No newline at end of file diff --git a/src/adaptors/bunni/index.js b/src/adaptors/bunni/index.js index 423c3ce65d..4abd243e3b 100644 --- a/src/adaptors/bunni/index.js +++ b/src/adaptors/bunni/index.js @@ -31,7 +31,7 @@ const lit = { const olit = { ethereum: '0x627fee87d0d9d2c55098a06ac805db8f98b158aa', polygon: '', - arbitrum: '', + arbitrum: '0x0ffB33812FA5cd8bCE181Db3FD76E11935105B12', optimism: '', }; @@ -46,6 +46,7 @@ const hubABI = require('./abis/BunniHub.json'); const lensABI = require('./abis/BunniLens.json'); const adminABI = require('./abis/TokenAdmin.json'); const gaugeABI = require('./abis/LiquidityGauge.json'); +const childGaugeABI = require('./abis/ChildGauge.json'); const controllerABI = require('./abis/GaugeController.json'); const oracleABI = require('./abis/OptionsOracle.json'); @@ -119,17 +120,17 @@ const topLvl = async (chainString, url, query, queryPrior, timestamp) => { chain: chainString, }), - admin[chainString] && + admin['ethereum'] && sdk.api.abi.call({ - target: admin[chainString], + target: admin['ethereum'], abi: adminABI.find((n) => n.name === 'rate'), - chain: chainString, + chain: 'ethereum', }), - oracle[chainString] && + oracle['ethereum'] && sdk.api.abi.call({ - target: oracle[chainString], + target: oracle['ethereum'], abi: oracleABI.find((n) => n.name === 'multiplier'), - chain: chainString, + chain: 'ethereum', }), ]); @@ -169,6 +170,7 @@ const topLvl = async (chainString, url, query, queryPrior, timestamp) => { { output: gaugesIsKilled }, { output: gaugesRelativeWeight }, { output: gaugesExists }, + { output: gaugesInflationRate }, ] = await Promise.all([ sdk.api.abi.multiCall({ abi: 'erc20:symbol', @@ -218,7 +220,7 @@ const topLvl = async (chainString, url, query, queryPrior, timestamp) => { calls: gauges.map((gauge) => ({ target: gauge })), chain: chainString, }), - gauges.length && + chainString == 'ethereum' && gauges.length && sdk.api.abi.multiCall({ abi: gaugeABI.find((n) => n.name === 'getCappedRelativeWeight'), calls: gauges.map((gauge) => ({ @@ -230,23 +232,33 @@ const topLvl = async (chainString, url, query, queryPrior, timestamp) => { gauges.length && sdk.api.abi.multiCall({ abi: controllerABI.find((n) => n.name === 'gauge_exists'), - target: controller[chainString], + target: controller['ethereum'], calls: gauges.map((gauge) => ({ params: [gauge] })), + chain: 'ethereum', + }), + chainString != 'ethereum' && gauges.length && + sdk.api.abi.multiCall({ + abi: childGaugeABI.find((n) => n.name === 'inflation_rate'), + calls: gauges.map((gauge) => ({ + target: gauge, + params: [Math.floor(this_period_timestamp / 604800)], + })), chain: chainString, }), ]); // fetch token prices - const keys = tokens.map((token) => `${chainString}:${token}`).join(','); + let keys = tokens.map((token) => `${chainString}:${token}`).join(','); + if (chainString != 'ethereum') keys = keys.concat(`,ethereum:${lit['ethereum']}`); const prices = ( await superagent.get(`https://coins.llama.fi/prices/current/${keys}`) ).body.coins; // calculate the price of oLIT let optionPrice = 0; - if (lit[chainString]) { - const litPrice = prices[`${chainString}:${lit[chainString]}`] - ? prices[`${chainString}:${lit[chainString]}`].price + if (lit['ethereum']) { + const litPrice = prices[`ethereum:${lit['ethereum']}`] + ? prices[`ethereum:${lit['ethereum']}`].price : 0; optionPrice = litPrice * multiplier; } @@ -319,7 +331,7 @@ const topLvl = async (chainString, url, query, queryPrior, timestamp) => { ((b.pool.totalFeesToken1 - prior.totalFeesToken1) / Math.pow(10, token1Decimals)) * token1Price; - const fee = (fee0 + fee1) * 365; + const fee = Math.min(fee0, fee1) * 365; baseApr = ((fee * parseInt(b.liquidity)) / parseInt(b.pool.liquidity) / tvl) * (1 - protocolFee) * @@ -341,16 +353,21 @@ const topLvl = async (chainString, url, query, queryPrior, timestamp) => { // we only care about gauges that have been whitelisted and have not been killed if (exists && !killed) { - const relativeWeight = - gaugesRelativeWeight.find((g) => g.input.target == b.gauge?.address) - .output / 1e18; + const relativeWeight = gaugesRelativeWeight + ? gaugesRelativeWeight.find((g) => g.input.target == b.gauge?.address) + .output / 1e18 + : 0; const tokenlessProduction = gaugesTokenlessProduction.find( (g) => g.input.target == b.gauge?.address )?.output; const workingSupply = gaugesWorkingSupply.find((g) => g.input.target == b.gauge?.address) ?.output / 1e18; - const relativeInflation = inflationRate * relativeWeight; + + const gaugeInflationRate = gaugesInflationRate && + gaugesInflationRate.find((g) => g.input.target == b.gauge?.address) + ?.output / 1e18; + const relativeInflation = gaugeInflationRate ? gaugeInflationRate : inflationRate * relativeWeight; // we only care about gauges that receive rewards (ie those that receive votes) if (relativeInflation > 0) { @@ -385,7 +402,7 @@ const topLvl = async (chainString, url, query, queryPrior, timestamp) => { poolMeta: `${parseInt(b.pool.fee) / 10000}%, tickLower: ${ b.tickLower }, tickUpper: ${b.tickUpper}`, - url: `https://bunni.pro/pool/${b.pool.id}?bunniToken=${b.address}`, + url: `https://bunni.pro/pools/${chainString}/${b.pool.id}/${b.address}`, }; });