forked from sushi-labs/sushiswap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from rainlanguage/2024-04-27-new-dexes
new dexes
- Loading branch information
Showing
36 changed files
with
865 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,7 @@ exports | |
# cache | ||
cache | ||
mem-cache | ||
test-cache | ||
|
||
# generated | ||
generated | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { PublicClient } from 'viem' | ||
import { ChainId } from '../../chain/index.js' | ||
import { LiquidityProviders } from './LiquidityProvider.js' | ||
import { UniswapV2BaseProvider } from './UniswapV2Base.js' | ||
|
||
export class BlastDEXProvider extends UniswapV2BaseProvider { | ||
override fee = 0.002 | ||
constructor(chainId: ChainId, web3Client: PublicClient) { | ||
const factory = { | ||
[ChainId.BLAST]: '0x66346aac17d0e61156AC5F2A934ccF2a9BDe4c65', | ||
} as const | ||
const initCodeHash = { | ||
[ChainId.BLAST]: | ||
'0x376acff9b60b853f5ccc9f1caecb8dcf722793593330ac58aac8a880a3eb8b9e', | ||
} as const | ||
super(chainId, web3Client, factory, initCodeHash) | ||
} | ||
getType(): LiquidityProviders { | ||
return LiquidityProviders.BlastDEX | ||
} | ||
getPoolProviderName(): string { | ||
return 'BlastDEX' | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/sushi/src/router/liquidity-providers/BlazeSwap.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { PublicClient } from 'viem' | ||
import { ChainId } from '../../chain/index.js' | ||
import { LiquidityProviders } from './LiquidityProvider.js' | ||
import { UniswapV2BaseProvider } from './UniswapV2Base.js' | ||
|
||
export class BlazeSwapProvider extends UniswapV2BaseProvider { | ||
constructor(chainId: ChainId, web3Client: PublicClient) { | ||
const factory = { | ||
[ChainId.FLARE]: '0x440602f459D7Dd500a74528003e6A20A46d6e2A6', | ||
} as const | ||
const initCodeHash = { | ||
[ChainId.FLARE]: | ||
'0xbf4c1c435583a2bb8d763765a34a46e376071c3b3d80e5bbac0950aeecdf31cb', | ||
} as const | ||
super(chainId, web3Client, factory, initCodeHash) | ||
} | ||
getType(): LiquidityProviders { | ||
return LiquidityProviders.BlazeSwap | ||
} | ||
getPoolProviderName(): string { | ||
return 'BlazeSwap' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { PublicClient, parseAbi } from 'viem' | ||
import { ChainId } from '../../chain/index.js' | ||
import { LiquidityProviders } from './LiquidityProvider.js' | ||
import { UniswapV2BaseProvider } from './UniswapV2Base.js' | ||
|
||
export class CamelotProvider extends UniswapV2BaseProvider { | ||
// Camelot has a slightly different getReserves() abi | ||
// so needs to be overriden | ||
override getReservesAbi = parseAbi([ | ||
'function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint16 _token0FeePercent, uint16 _token1FeePercent)', | ||
]) | ||
constructor(chainId: ChainId, web3Client: PublicClient) { | ||
const factory = { | ||
[ChainId.ARBITRUM]: '0x6EcCab422D763aC031210895C81787E87B43A652', | ||
} as const | ||
const initCodeHash = { | ||
[ChainId.ARBITRUM]: | ||
'0xa856464ae65f7619087bc369daaf7e387dae1e5af69cfa7935850ebf754b04c1', | ||
} as const | ||
super(chainId, web3Client, factory, initCodeHash) | ||
} | ||
getType(): LiquidityProviders { | ||
return LiquidityProviders.Camelot | ||
} | ||
getPoolProviderName(): string { | ||
return 'Camelot' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { PublicClient } from 'viem' | ||
import { ChainId } from '../../chain/index.js' | ||
import { LiquidityProviders } from './LiquidityProvider.js' | ||
import { UniswapV2BaseProvider } from './UniswapV2Base.js' | ||
|
||
export class DyorV2Provider extends UniswapV2BaseProvider { | ||
override fee = 0.003 | ||
constructor(chainId: ChainId, web3Client: PublicClient) { | ||
const factory = { | ||
[ChainId.BLAST]: '0xA1da7a7eB5A858da410dE8FBC5092c2079B58413', | ||
[ChainId.ZETACHAIN]: '0xA1da7a7eB5A858da410dE8FBC5092c2079B58413', | ||
} as const | ||
const initCodeHash = { | ||
[ChainId.BLAST]: | ||
'0xda2f1a903916d7de88d9357d27d763f123502a5d48e3b229d5fa049b3ffdeeb5', | ||
[ChainId.ZETACHAIN]: | ||
'0xda2f1a903916d7de88d9357d27d763f123502a5d48e3b229d5fa049b3ffdeeb5', | ||
} as const | ||
super(chainId, web3Client, factory, initCodeHash) | ||
} | ||
getType(): LiquidityProviders { | ||
return LiquidityProviders.DyorV2 | ||
} | ||
getPoolProviderName(): string { | ||
return 'DyorV2' | ||
} | ||
} |
Oops, something went wrong.