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

Add BaseSwap #1193

Merged
merged 1 commit into from
Aug 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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"zksync:velocore:add": "ts-node scripts/add-solidly.ts --network zksync --project velocore --newFee true --lp",
"zksync:vesync:add": "ts-node scripts/add-solidly.ts --network zksync --project vesync --newFee true --lp",
"zkevm:quick:add": "ts-node scripts/add-sushi.ts --network zkevm --project quickZkevm --newFee true --pool",
"base:baseSwap:add": "ts-node scripts/add-farm.ts --network base --project baseSwap --newFee true",
"gen-abi-types": "abi-types-generator ./src/abis/StableSwap.json --output='./src/abis/StableSwap/types'"
},
"dependencies": {
Expand Down
2 changes: 2 additions & 0 deletions packages/address-book/address-book/base/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { beefyfinance } from './platforms/beefyfinance';
import { balancer } from './platforms/balancer';
import { baseSwap } from './platforms/baseSwap';
import { tokens } from './tokens/tokens';
import { convertSymbolTokenMapToAddressTokenMap } from '../../util/convertSymbolTokenMapToAddressTokenMap';
import Chain from '../../types/chain';
Expand All @@ -9,6 +10,7 @@ const _base = {
platforms: {
beefyfinance,
balancer,
baseSwap,
},
tokens,
tokenAddressMap: convertSymbolTokenMapToAddressTokenMap(tokens),
Expand Down
4 changes: 4 additions & 0 deletions packages/address-book/address-book/base/platforms/baseSwap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const baseSwap = {
router: '0x8DFAf055e21B16302DBf00815e5b4d9b6042a4Df',
chef: '0x2B0A43DCcBD7d42c18F6A83F86D1a19fA58d541A',
} as const;
42 changes: 42 additions & 0 deletions packages/address-book/address-book/base/tokens/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,48 @@ const _tokens = {
ETH,
WETH: ETH,
WNATIVE: ETH,
cbETH: {
name: 'Coinbase Wrapped Staked ETH',
symbol: 'cbETH',
address: '0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22',
chainId: 8453,
decimals: 18,
logoURI:
'https://tokens.pancakeswap.finance/images/0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22.svg',
website: '',
description:
"Coinbase Wrapped Staked ETH (“cbETH”) is a utility token that represents Ethereum 2 (ETH2), which is ETH staked through Coinbase. Over time, the price of cbETH will likely deviate from ETH because cbETH represents 1 staked ETH plus all of its accrued staking interest starting from when cbETH's conversion rate and balance were initialized (June 16, 2022 19:34 UTC). cbETH is minted exclusively by Coinbase.",
documentation:
'https://help.coinbase.com/en/coinbase/trading-and-funding/staking-rewards/cbeth',
bridge: 'native',
},
axlUSDC: {
name: 'Axelar Wrapped USDC',
symbol: 'axlUSDC',
address: '0xEB466342C4d449BC9f53A865D5Cb90586f405215',
chainId: 8453,
decimals: 6,
logoURI:
'https://tokens.pancakeswap.finance/images/0xEB466342C4d449BC9f53A865D5Cb90586f405215.svg',
website: '',
description:
'USDC is a fully collateralized US dollar stablecoin. USDC is issued by regulated financial institutions, backed by fully reserved assets, redeemable on a 1:1 basis for US dollars.',
documentation: 'https://www.circle.com/en/usdc-multichain/arbitrum',
bridge: 'axelar',
},
OGRE: {
name: 'SHREKT',
symbol: 'OGRE',
address: '0xAB8a1c03b8E4e1D21c8Ddd6eDf9e07f26E843492',
chainId: 8453,
decimals: 18,
logoURI:
'https://tokens.pancakeswap.finance/images/0xAB8a1c03b8E4e1D21c8Ddd6eDf9e07f26E843492.svg',
website: '',
description: 'Meme coin on Base.',
documentation: '',
bridge: 'native',
},
USDbC: {
name: 'USD Base Coin',
address: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA',
Expand Down
8 changes: 8 additions & 0 deletions scripts/add-farm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ const {
ethereum: {
platforms: { sushi },
},
base: {
platforms: { baseSwap },
},
} = addressBook;

const projects = {
Expand Down Expand Up @@ -154,6 +157,11 @@ const projects = {
file: '../src/data/arbitrum/arbidexLpPools.json',
masterchef: arbidex.chef,
},
baseSwap: {
prefix: 'baseswap',
file: '../src/data/base/baseSwapLpPools.json',
masterchef: baseSwap.chef,
},
};

const args = yargs.options({
Expand Down
19 changes: 19 additions & 0 deletions src/api/stats/base/getBaseSwapApys.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { BASE_CHAIN_ID: chainId } = require('../../../constants');
const { getMasterChefApys } = require('../common/getMasterChefApys');
const pools = require('../../../data/base/baseSwapLpPools.json');

const getBaseSwapApys = async () =>
await getMasterChefApys({
chainId: chainId,
masterchef: '0x2B0A43DCcBD7d42c18F6A83F86D1a19fA58d541A',
tokenPerBlock: 'bswapPerSec',
hasMultiplier: false,
pools: pools,
oracleId: 'BSWAP',
oracle: 'tokens',
decimals: '1e18',
secondsPerBlock: 1,
// log: true,
});

module.exports = getBaseSwapApys;
3 changes: 2 additions & 1 deletion src/api/stats/base/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const getBalancerBaseApys = require('./getBalancerApys');
const getBaseSwapApys = require('./getBaseSwapApys');

const getApys = [getBalancerBaseApys];
const getApys = [getBalancerBaseApys, getBaseSwapApys];

const getBaseApys = async () => {
const start = Date.now();
Expand Down
2 changes: 2 additions & 0 deletions src/api/stats/getAmmPrices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ import velocorePools from '../../data/zksync/velocoreLpPools.json';
import soliSnekPools from '../../data/avax/soliSnekLpPools.json';
import veSyncPools from '../../data/zksync/veSyncLpPools.json';
import fvmPools from '../../data/fantom/fvmLpPools.json';
import baseSwapPools from '../../data/base/baseSwapLpPools.json';
import { fetchVaultPrices } from '../../utils/fetchVaultPrices';
import { addressBookByChainId } from '../../../packages/address-book/address-book';
import { sleep } from '../../utils/time';
Expand All @@ -287,6 +288,7 @@ const REFRESH_INTERVAL = 5 * 60 * 1000;
// FIXME: if this list grows too big we might hit the ratelimit on initialization everytime
// Implement in case of emergency -> https://github.com/beefyfinance/beefy-api/issues/103
const pools = normalizePoolOracleIds([
...baseSwapPools,
...fvmPools,
...veSyncPools,
...soliSnekPools,
Expand Down
142 changes: 142 additions & 0 deletions src/data/base/baseSwapLpPools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
[
{
"name": "baseswap-cbeth-weth",
"address": "0x07CFA5Df24fB17486AF0CBf6C910F24253a674D3",
"decimals": "1e18",
"beefyFee": 0.095,
"poolId": 6,
"chainId": 8453,
"lp0": {
"address": "0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22",
"oracle": "tokens",
"oracleId": "cbETH",
"decimals": "1e18"
},
"lp1": {
"address": "0x4200000000000000000000000000000000000006",
"oracle": "tokens",
"oracleId": "WETH",
"decimals": "1e18"
}
},
{
"name": "baseswap-dai-usdbc",
"address": "0x6D3c5a4a7aC4B1428368310E4EC3bB1350d01455",
"decimals": "1e18",
"beefyFee": 0.095,
"poolId": 5,
"chainId": 8453,
"lp0": {
"address": "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",
"oracle": "tokens",
"oracleId": "DAI",
"decimals": "1e18"
},
"lp1": {
"address": "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA",
"oracle": "tokens",
"oracleId": "USDbC",
"decimals": "1e6"
}
},
{
"name": "baseswap-cbeth-usdbc",
"address": "0x29a706a49baE714bCfcC96ac1A43e116cB57794c",
"decimals": "1e18",
"beefyFee": 0.095,
"poolId": 4,
"chainId": 8453,
"lp0": {
"address": "0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22",
"oracle": "tokens",
"oracleId": "cbETH",
"decimals": "1e18"
},
"lp1": {
"address": "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA",
"oracle": "tokens",
"oracleId": "USDbC",
"decimals": "1e6"
}
},
{
"name": "baseswap-weth-axlusdc",
"address": "0x9A0b05F3cF748A114A4f8351802b3BFfE07100D4",
"decimals": "1e18",
"beefyFee": 0.095,
"poolId": 3,
"chainId": 8453,
"lp0": {
"address": "0x4200000000000000000000000000000000000006",
"oracle": "tokens",
"oracleId": "WETH",
"decimals": "1e18"
},
"lp1": {
"address": "0xEB466342C4d449BC9f53A865D5Cb90586f405215",
"oracle": "tokens",
"oracleId": "axlUSDC",
"decimals": "1e6"
}
},
{
"name": "baseswap-weth-ogre",
"address": "0x81a03d61c913BdcC60519423C8841C18FfB752a8",
"decimals": "1e18",
"beefyFee": 0.095,
"poolId": 2,
"chainId": 8453,
"lp0": {
"address": "0x4200000000000000000000000000000000000006",
"oracle": "tokens",
"oracleId": "WETH",
"decimals": "1e18"
},
"lp1": {
"address": "0xAB8a1c03b8E4e1D21c8Ddd6eDf9e07f26E843492",
"oracle": "tokens",
"oracleId": "OGRE",
"decimals": "1e18"
}
},
{
"name": "baseswap-weth-bswap",
"address": "0xE80B4F755417FB4baF4dbd23C029db3F62786523",
"decimals": "1e18",
"beefyFee": 0.095,
"poolId": 1,
"chainId": 8453,
"lp0": {
"address": "0x4200000000000000000000000000000000000006",
"oracle": "tokens",
"oracleId": "WETH",
"decimals": "1e18"
},
"lp1": {
"address": "0x78a087d713Be963Bf307b18F2Ff8122EF9A63ae9",
"oracle": "tokens",
"oracleId": "BSWAP",
"decimals": "1e18"
}
},
{
"name": "baseswap-weth-usdbc",
"address": "0x41d160033C222E6f3722EC97379867324567d883",
"decimals": "1e18",
"beefyFee": 0.095,
"poolId": 7,
"chainId": 8453,
"lp0": {
"address": "0x4200000000000000000000000000000000000006",
"oracle": "tokens",
"oracleId": "WETH",
"decimals": "1e18"
},
"lp1": {
"address": "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA",
"oracle": "tokens",
"oracleId": "USDbC",
"decimals": "1e6"
}
}
]
Loading