Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: base balancer vault's trading apy #35

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions data/mainnet/pools.js
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,8 @@ module.exports = [
id: 'balancer_axlUSDC_USDC',
type: POOL_TYPES.INCENTIVE,
tradingApyFunction: {
type: TRADING_APY_TYPES.LP,
params: [addresses.BASE.V2.balancer_axlUSDC_USDC.Underlying, 'balancerv2_base'],
type: TRADING_APY_TYPES.BALANCER,
params: [addresses.BASE.V2.balancer_axlUSDC_USDC.PoolId, CHAIN_IDS.BASE],
},
contractAddress: addresses.BASE.V2.balancer_axlUSDC_USDC.NewPool,
collateralAddress: addresses.BASE.V2.balancer_axlUSDC_USDC.NewVault,
Expand Down Expand Up @@ -832,8 +832,8 @@ module.exports = [
id: 'balancer_cbETH_WETH',
type: POOL_TYPES.INCENTIVE,
tradingApyFunction: {
type: TRADING_APY_TYPES.LP,
params: [addresses.BASE.V2.balancer_cbETH_WETH.Underlying, 'balancerv2_base'],
type: TRADING_APY_TYPES.BALANCER,
params: [addresses.BASE.V2.balancer_cbETH_WETH.PoolId, CHAIN_IDS.BASE],
},
contractAddress: addresses.BASE.V2.balancer_cbETH_WETH.NewPool,
collateralAddress: addresses.BASE.V2.balancer_cbETH_WETH.NewVault,
Expand Down Expand Up @@ -862,8 +862,8 @@ module.exports = [
id: 'balancer_GOLD_WETH',
type: POOL_TYPES.INCENTIVE,
tradingApyFunction: {
type: TRADING_APY_TYPES.LP,
params: [addresses.BASE.V2.balancer_GOLD_WETH.Underlying, 'balancerv2_base'],
type: TRADING_APY_TYPES.BALANCER,
params: [addresses.BASE.V2.balancer_GOLD_WETH.PoolId, CHAIN_IDS.BASE],
},
contractAddress: addresses.BASE.V2.balancer_GOLD_WETH.NewPool,
collateralAddress: addresses.BASE.V2.balancer_GOLD_WETH.NewVault,
Expand Down Expand Up @@ -1042,8 +1042,8 @@ module.exports = [
id: 'balancer_BALD_WETH',
type: POOL_TYPES.INCENTIVE,
tradingApyFunction: {
type: TRADING_APY_TYPES.LP,
params: [addresses.BASE.V2.balancer_BALD_WETH.Underlying, 'balancerv2_base'],
type: TRADING_APY_TYPES.BALANCER,
params: [addresses.BASE.V2.balancer_BALD_WETH.PoolId, CHAIN_IDS.BASE],
},
contractAddress: addresses.BASE.V2.balancer_BALD_WETH.NewPool,
collateralAddress: addresses.BASE.V2.balancer_BALD_WETH.NewVault,
Expand Down Expand Up @@ -1072,8 +1072,8 @@ module.exports = [
id: 'balancer_DAI_USDC_WETH',
type: POOL_TYPES.INCENTIVE,
tradingApyFunction: {
type: TRADING_APY_TYPES.LP,
params: [addresses.BASE.V2.balancer_DAI_USDC_WETH.Underlying, 'balancerv2_base'],
type: TRADING_APY_TYPES.BALANCER,
params: [addresses.BASE.V2.balancer_DAI_USDC_WETH.PoolId, CHAIN_IDS.BASE],
},
contractAddress: addresses.BASE.V2.balancer_DAI_USDC_WETH.NewPool,
collateralAddress: addresses.BASE.V2.balancer_DAI_USDC_WETH.NewVault,
Expand Down Expand Up @@ -1102,8 +1102,8 @@ module.exports = [
id: 'balancer_DAI_USDC',
type: POOL_TYPES.INCENTIVE,
tradingApyFunction: {
type: TRADING_APY_TYPES.LP,
params: [addresses.BASE.V2.balancer_DAI_USDC.Underlying, 'balancerv2_base'],
type: TRADING_APY_TYPES.BALANCER,
params: [addresses.BASE.V2.balancer_DAI_USDC.PoolId, CHAIN_IDS.BASE],
},
contractAddress: addresses.BASE.V2.balancer_DAI_USDC.NewPool,
collateralAddress: addresses.BASE.V2.balancer_DAI_USDC.NewVault,
Expand Down
1 change: 1 addition & 0 deletions data/mainnet/tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,7 @@ module.exports = {
cmcRewardTokenSymbols: ['iFARM', 'BAL', 'USDC'],
},
balancer_DAI_USDC: {
inactive: true,
chain: CHAIN_IDS.BASE,
apyIconUrls: ['./icons/balancer.svg', './icons/usdc.svg'],
apyTokenSymbols: ['BAL', 'USDC'],
Expand Down
1 change: 1 addition & 0 deletions src/lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ const APE_API_URL = 'https://ape-swap-api.herokuapp.com'
const BALANCER_SUBGRAPH_URLS = {
ETH: 'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-v2',
MATIC: 'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-polygon-v2',
BASE: 'https://api.studio.thegraph.com/query/24660/balancer-base-v2/version/latest',
}

const LIDO_API_URLS = { ETH: 'https://eth-api.lido.fi/v1/protocol/steth/apr/sma' }
Expand Down
2 changes: 2 additions & 0 deletions src/lib/third-party/balancer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const executeBalancerCall = (type, query, networkId) => {
subgraphURL = BALANCER_SUBGRAPH_URLS.ETH
} else if (networkId == CHAIN_IDS.POLYGON) {
subgraphURL = BALANCER_SUBGRAPH_URLS.MATIC
} else if (networkId == CHAIN_IDS.BASE) {
subgraphURL = BALANCER_SUBGRAPH_URLS.BASE
}
return cachedAxios
.post(subgraphURL, JSON.stringify({ query }))
Expand Down
Loading