Skip to content

Commit

Permalink
Merge pull request #453 from paraswap/BACK-1215/move-zyberswapv3-even…
Browse files Browse the repository at this point in the history
…t-based

Back 1215/move zyberswapv3 event based
  • Loading branch information
mwamedacen authored Aug 1, 2023
2 parents fa7feef + 6ddde7b commit 9b52bbb
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 224 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paraswap/dex-lib",
"version": "2.26.3",
"version": "2.27.0",
"main": "build/index.js",
"types": "build/index.d.ts",
"repository": "https://github.com/paraswap/paraswap-dex-lib",
Expand Down
68 changes: 47 additions & 21 deletions src/dex/algebra/algebra-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,52 @@ function testForNetwork(
});
}

describe('QuickSwapV3 E2E', () => {
const dexKey = 'QuickSwapV3';

describe('Polygon', () => {
const network = Network.POLYGON;
const tokenASymbol: string = 'USDC';
const tokenBSymbol: string = 'DAI';

const tokenAAmount: string = '1000000000';
const tokenBAmount: string = '1000000000000000000000';
const nativeTokenAmount = '1000000000000000000';

testForNetwork(
network,
dexKey,
tokenASymbol,
tokenBSymbol,
tokenAAmount,
tokenBAmount,
nativeTokenAmount,
);
describe('Algebra', () => {
describe('QuickSwapV3 E2E', () => {
const dexKey = 'QuickSwapV3';

describe('Polygon', () => {
const network = Network.POLYGON;
const tokenASymbol: string = 'USDC';
const tokenBSymbol: string = 'DAI';

const tokenAAmount: string = '1000000000';
const tokenBAmount: string = '1000000000000000000000';
const nativeTokenAmount = '1000000000000000000';

testForNetwork(
network,
dexKey,
tokenASymbol,
tokenBSymbol,
tokenAAmount,
tokenBAmount,
nativeTokenAmount,
);
});
});

describe('ZyberSwapV3', () => {
const dexKey = 'ZyberSwapV3';

describe('Arbitrum', () => {
const network = Network.ARBITRUM;
const tokenASymbol: string = 'USDC';
const tokenBSymbol: string = 'DAI';

const tokenAAmount: string = '1000000000';
const tokenBAmount: string = '1000000000000000000000';
const nativeTokenAmount = '1000000000000000000';

testForNetwork(
network,
dexKey,
tokenASymbol,
tokenBSymbol,
tokenAAmount,
tokenBAmount,
nativeTokenAmount,
);
});
});
});
20 changes: 20 additions & 0 deletions src/dex/algebra/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ export const AlgebraConfig: DexConfigMap<DexParams> = {
deployer: '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', // validate
},
},
ZyberSwapV3: {
[Network.ARBITRUM]: {
factory: '0x9C2ABD632771b433E5E7507BcaA41cA3b25D8544',
router: '0xFa58b8024B49836772180f2Df902f231ba712F72',
quoter: '0xAeD211346Fa2E6A5063b4f273BCf7DDbD0368d62',
initHash:
'0x6ec6c9c8091d160c0aa74b2b14ba9c1717e95093bd3ac085cee99a49aab294a4',
chunksCount: 10,
initRetryFrequency: 10,
algebraStateMulticall: '0xcd7C50ba57136b6B461168D1f634E2CffA4c298D',
subgraphURL:
'https://api.thegraph.com/subgraphs/name/iliaazhel/zyberswap-info',
uniswapMulticall: '0x1F98415757620B543A52E61c46B32eB19261F984',
deployer: '0x24e85f5f94c6017d2d87b434394e87df4e4d56e3',
},
},
};

export const Adapters: Record<number, AdapterMappings> = {
Expand All @@ -44,4 +60,8 @@ export const Adapters: Record<number, AdapterMappings> = {
[SwapSide.SELL]: [{ name: 'PolygonZkEvmAdapter01', index: 1 }],
[SwapSide.BUY]: [{ name: 'PolygonZkEvmBuyAdapter', index: 1 }],
},
[Network.ARBITRUM]: {
[SwapSide.SELL]: [{ name: 'ArbitrumAdapter01', index: 3 }],
[SwapSide.BUY]: [{ name: 'ArbitrumBuyAdapter', index: 2 }],
},
};
2 changes: 0 additions & 2 deletions src/dex/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ import { SolidlyEthereum } from './solidly/solidly-ethereum';
import { MaverickV1 } from './maverick-v1/maverick-v1';
import { QuickSwapV3 } from './quickswap/quickswap-v3';
import { ThenaFusion } from './quickswap/thena-fusion';
import { ZyberSwapV3 } from './quickswap/zyberswap-v3';
import { CamelotV3 } from './quickswap/camelot-v3';
import { TraderJoeV2 } from './trader-joe-v2';
import { SwaapV2 } from './swaap-v2/swaap-v2';
Expand All @@ -89,7 +88,6 @@ const LegacyDexes = [
DodoV2,
QuickSwapV3,
ThenaFusion,
ZyberSwapV3,
CamelotV3,
SpiritSwapV3,
TraderJoeV2,
Expand Down
9 changes: 0 additions & 9 deletions src/dex/quickswap/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ export const QuickSwapConfig: DexConfigMap<DexParams> = {
'0x6c1bebd370ba84753516bc1393c0d0a6c645856da55f5393ac8ab3d6dbc861d3',
},
},
ZyberSwapV3: {
[Network.ARBITRUM]: {
factoryAddress: '0x9C2ABD632771b433E5E7507BcaA41cA3b25D8544',
router: '0xFa58b8024B49836772180f2Df902f231ba712F72',
quoteAddress: '0xAeD211346Fa2E6A5063b4f273BCf7DDbD0368d62',
initCode:
'0x6ec6c9c8091d160c0aa74b2b14ba9c1717e95093bd3ac085cee99a49aab294a4',
},
},
ThenaFusion: {
[Network.BSC]: {
factoryAddress: '0x306F06C147f064A010530292A1EB6737c3e378e4',
Expand Down
Loading

0 comments on commit 9b52bbb

Please sign in to comment.