minimized reused code for mobius pairs

This commit is contained in:
Noah Khamliche 2022-03-02 16:05:20 -05:00 committed by Noah Khamliche
parent 29f9c725e3
commit 6d08add20b

View File

@ -1072,6 +1072,13 @@ const createCurveFactoryCryptoExchangePool = (info: { tokens: string[]; pool: st
poolAddress: info.pool,
gasSchedule: info.gasSchedule,
});
const MOBIUSMONEY_CELO_SHARED = {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
metaTokens: undefined,
gasSchedule: 100e3,
};
/**
* Mainnet Curve configuration
@ -1746,130 +1753,73 @@ export const FIREBIRDONESWAP_POLYGON_INFOS: { [name: string]: CurveInfo } = {
export const MOBIUSMONEY_CELO_INFOS: { [name: string]: CurveInfo } = {
[MOBIUSMONEY_CELO_POOLS.poof_cusd_v2]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
...MOBIUSMONEY_CELO_SHARED,
poolAddress: MOBIUSMONEY_CELO_POOLS.poof_cusd_v2,
tokens: [CELO_TOKENS.cUSD, CELO_TOKENS.pUSD],
metaTokens: undefined,
gasSchedule: 100e3,
},
[MOBIUSMONEY_CELO_POOLS.poof_celo_v2]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
...MOBIUSMONEY_CELO_SHARED,
poolAddress: MOBIUSMONEY_CELO_POOLS.poof_celo_v2,
tokens: [CELO_TOKENS.WCELO, CELO_TOKENS.pCELO],
metaTokens: undefined,
gasSchedule: 100e3,
},
[MOBIUSMONEY_CELO_POOLS.usdc_optics_v2]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
...MOBIUSMONEY_CELO_SHARED,
poolAddress: MOBIUSMONEY_CELO_POOLS.usdc_optics_v2,
tokens: [CELO_TOKENS.cUSD, CELO_TOKENS.cUSDC_V2],
metaTokens: undefined,
gasSchedule: 100e3,
},
[MOBIUSMONEY_CELO_POOLS.weth_optics_v2]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
...MOBIUSMONEY_CELO_SHARED,
poolAddress: MOBIUSMONEY_CELO_POOLS.weth_optics_v2,
tokens: [CELO_TOKENS.cETH, CELO_TOKENS.oWETH],
metaTokens: undefined,
gasSchedule: 100e3,
},
[MOBIUSMONEY_CELO_POOLS.wbtc_optics_v2]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
...MOBIUSMONEY_CELO_SHARED,
poolAddress: MOBIUSMONEY_CELO_POOLS.wbtc_optics_v2,
tokens: [CELO_TOKENS.cBTC, CELO_TOKENS.WBTC],
metaTokens: undefined,
gasSchedule: 100e3,
},
[MOBIUSMONEY_CELO_POOLS.pusdc_optics_v2]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
...MOBIUSMONEY_CELO_SHARED,
poolAddress: MOBIUSMONEY_CELO_POOLS.pusdc_optics_v2,
tokens: [CELO_TOKENS.cUSD, CELO_TOKENS.pUSDC_V2],
metaTokens: undefined,
gasSchedule: 100e3,
},
[MOBIUSMONEY_CELO_POOLS.usdc_allbridge_avax]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
...MOBIUSMONEY_CELO_SHARED,
poolAddress: MOBIUSMONEY_CELO_POOLS.usdc_allbridge_avax,
tokens: [CELO_TOKENS.cUSD, CELO_TOKENS.aaUSDC],
metaTokens: undefined,
gasSchedule: 100e3,
},
[MOBIUSMONEY_CELO_POOLS.usdc_allbridge_solana]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
...MOBIUSMONEY_CELO_SHARED,
poolAddress: MOBIUSMONEY_CELO_POOLS.usdc_allbridge_solana,
tokens: [CELO_TOKENS.cUSD, CELO_TOKENS.asUSDC],
metaTokens: undefined,
gasSchedule: 100e3,
},
[MOBIUSMONEY_CELO_POOLS.usdc_eth_optics]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
poolAddress: MOBIUSMONEY_CELO_POOLS.usdc_eth_optics,
tokens: [CELO_TOKENS.cUSD, CELO_TOKENS.cUSDC],
metaTokens: undefined,
gasSchedule: 100e3,
},
[MOBIUSMONEY_CELO_POOLS.usdc_poly_optics]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
...MOBIUSMONEY_CELO_SHARED,
poolAddress: MOBIUSMONEY_CELO_POOLS.usdc_poly_optics,
tokens: [CELO_TOKENS.cUSD, CELO_TOKENS.pUSDC],
metaTokens: undefined,
gasSchedule: 100e3,
},
[MOBIUSMONEY_CELO_POOLS.wbtc]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
...MOBIUSMONEY_CELO_SHARED,
poolAddress: MOBIUSMONEY_CELO_POOLS.wbtc,
tokens: [CELO_TOKENS.cBTC, CELO_TOKENS.wBTCO],
metaTokens: undefined,
gasSchedule: 100e3,
},
[MOBIUSMONEY_CELO_POOLS.weth]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
...MOBIUSMONEY_CELO_SHARED,
poolAddress: MOBIUSMONEY_CELO_POOLS.weth,
tokens: [CELO_TOKENS.cETH, CELO_TOKENS.WETHv1],
metaTokens: undefined,
gasSchedule: 100e3,
},
[MOBIUSMONEY_CELO_POOLS.usdt_moss]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
...MOBIUSMONEY_CELO_SHARED,
poolAddress: MOBIUSMONEY_CELO_POOLS.usdt_moss,
tokens: [CELO_TOKENS.cETH, CELO_TOKENS.mcUSDT],
metaTokens: undefined,
gasSchedule: 100e3,
},
[MOBIUSMONEY_CELO_POOLS.usdc_moss]: {
exchangeFunctionSelector: CurveFunctionSelectors.swap,
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
...MOBIUSMONEY_CELO_SHARED,
poolAddress: MOBIUSMONEY_CELO_POOLS.usdc_moss,
tokens: [CELO_TOKENS.cETH, CELO_TOKENS.mcUSDC],
metaTokens: undefined,
gasSchedule: 100e3,
},
};