Skip to content

Commit

Permalink
add implementation for WoofiV2
Browse files Browse the repository at this point in the history
  • Loading branch information
aburkut committed Sep 25, 2023
1 parent 3902d7e commit 1982b62
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ const baseConfigs: { [network: number]: BaseConfig } = {
hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
hashFlowDisabledMMs: [],
adapterAddresses: {
BaseAdapter01: '0x5F23023f66eFbC55ffC86E62f0f7898D9Ac9FD38',
BaseBuyAdapter: '0x683778fAc3144eb6bE0df14325036c5a0DD81F92',
BaseAdapter01: '0x30F6B9b6485ff0B67E881f5ac80D3F1c70A4B23d',
BaseBuyAdapter: '0xB11bCA7B01b425afD0743A4D77B4f593883f94C0',
},
uniswapV2ExchangeRouterAddress:
'0x75d199EfB540e47D27D52c62Da3E7daC2B9e834F',
Expand Down
12 changes: 6 additions & 6 deletions src/dex/maverick-v1/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ export const MaverickV1Config: DexConfigMap<DexParams> = {
routerAddress: '0x4a585e0f7c18e2c414221d6402652d5e0990e5f8',
poolInspectorAddress: '0xaA5BF61a664109e959D69C38734d4EA7dF74e456',
},
[Network.BASE]: {
subgraphURL:
'https://api.studio.thegraph.com/query/42519/maverick-base/version/latest',
routerAddress: '0x32AED3Bce901DA12ca8489788F3A99fCe1056e14',
poolInspectorAddress: '0x550056A68cB155b6Cc3DeF4A7FA656260e7842e2',
},
// [Network.BASE]: {
// subgraphURL:
// 'https://api.studio.thegraph.com/query/42519/maverick-base/version/latest',
// routerAddress: '0x32AED3Bce901DA12ca8489788F3A99fCe1056e14',
// poolInspectorAddress: '0x550056A68cB155b6Cc3DeF4A7FA656260e7842e2',
// },
},
};

Expand Down
10 changes: 10 additions & 0 deletions src/dex/woo-fi-v2/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ export const WooFiV2Config: DexConfigMap<DexParams> = {
decimals: 6,
},
},
[Network.BASE]: {
wooPPV2Address: '0xb130a49065178465931d4f887056328CeA5D723f',
wooOracleV2Address: '0x2Fe5E5D341cFFa606a5d9DA1B6B646a381B0f7ec',
integrationHelperAddress: '0xC4E9B633685461E7B7A807D12a246C81f96F31B8',
// USDbC
quoteToken: {
address: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA',
decimals: 6,
},
},
},
};

Expand Down
64 changes: 64 additions & 0 deletions src/dex/woo-fi-v2/woo-fi-v2-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,68 @@ describe('WooFiV2 E2E', () => {
tokenQuoteAmount,
);
});

describe('Base', () => {
const network = Network.BASE;

const baseATokenSymbol = 'USDbC';
const baseBTokenSymbol = 'ETH';

const tokenBaseAAmount = '100000000';
const tokenBaseBAmount = '1000000000000000000';

const tokens = Tokens[network];
const holders = Holders[network];

const provider = new StaticJsonRpcProvider(
generateConfig(network).privateHttpProvider,
network,
);

const sideToContractMethods = new Map([
[
SwapSide.SELL,
[
ContractMethod.simpleSwap,
ContractMethod.multiSwap,
ContractMethod.megaSwap,
],
],
]);

sideToContractMethods.forEach((contractMethods, side) =>
describe(`${side}`, () => {
contractMethods.forEach((contractMethod: ContractMethod) => {
describe(`${contractMethod}`, () => {
it(`${baseATokenSymbol} -> ${baseBTokenSymbol}`, async () => {
await testE2E(
tokens[baseATokenSymbol],
tokens[baseBTokenSymbol],
holders[baseATokenSymbol],
tokenBaseAAmount,
side,
dexKey,
contractMethod,
network,
provider,
);
});
it(`${baseBTokenSymbol} -> ${baseATokenSymbol}`, async () => {
await testE2E(
tokens[baseBTokenSymbol],
tokens[baseATokenSymbol],
holders[baseBTokenSymbol],
tokenBaseBAmount,
side,
dexKey,
contractMethod,
network,
provider,
);
});
});
});
}),
);
});
});

0 comments on commit 1982b62

Please sign in to comment.