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