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.
- Loading branch information
Showing
34 changed files
with
1,118 additions
and
15 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
24 changes: 24 additions & 0 deletions
24
packages/sushi/src/router/liquidity-providers/AlienBaseV2.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,24 @@ | ||
import { PublicClient } from 'viem' | ||
import { ChainId } from '../../chain/index.js' | ||
import { LiquidityProviders } from './LiquidityProvider.js' | ||
import { UniswapV2BaseProvider } from './UniswapV2Base.js' | ||
|
||
export class AlienBaseV2Provider extends UniswapV2BaseProvider { | ||
override fee = 0.0016 | ||
constructor(chainId: ChainId, web3Client: PublicClient) { | ||
const factory = { | ||
[ChainId.BASE]: '0x3E84D913803b02A4a7f027165E8cA42C14C0FdE7', | ||
} as const | ||
const initCodeHash = { | ||
[ChainId.BASE]: | ||
'0x7ede5bbb7d245103c4a6d59bfd62246fbc488e93f95f23a19d9d76f0d91bd0d0', | ||
} as const | ||
super(chainId, web3Client, factory, initCodeHash) | ||
} | ||
getType(): LiquidityProviders { | ||
return LiquidityProviders.AlienBaseV2 | ||
} | ||
getPoolProviderName(): string { | ||
return 'AlienBaseV2' | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
packages/sushi/src/router/liquidity-providers/AlienBaseV3.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,52 @@ | ||
import { PublicClient } from 'viem' | ||
import { ChainId } from '../../chain/index.js' | ||
import { LiquidityProviders } from './LiquidityProvider.js' | ||
import { UniswapV3BaseProvider } from './UniswapV3Base.js' | ||
|
||
/** | ||
* The default factory enabled fee amounts, denominated in hundredths of bips. | ||
*/ | ||
export enum AlienBaseV3FeeAmount { | ||
/** 0.02% */ | ||
LOWEST = 200, | ||
/** 0.075% */ | ||
LOW = 750, | ||
/** 0.3% */ | ||
MEDIUM = 3000, | ||
/** 1% */ | ||
HIGH = 10000, | ||
} | ||
|
||
export const ALIENBASE_V3_FEE_SPACING_MAP: Record< | ||
AlienBaseV3FeeAmount, | ||
number | ||
> = { | ||
[AlienBaseV3FeeAmount.LOWEST]: 4, | ||
[AlienBaseV3FeeAmount.LOW]: 15, | ||
[AlienBaseV3FeeAmount.MEDIUM]: 60, | ||
[AlienBaseV3FeeAmount.HIGH]: 200, | ||
} | ||
|
||
export class AlienBaseV3Provider extends UniswapV3BaseProvider { | ||
override FEE = AlienBaseV3FeeAmount | ||
override TICK_SPACINGS = ALIENBASE_V3_FEE_SPACING_MAP | ||
constructor(chainId: ChainId, web3Client: PublicClient) { | ||
const factory = { | ||
[ChainId.BASE]: '0x0Fd83557b2be93617c9C1C1B6fd549401C74558C', | ||
} as const | ||
const initCodeHash = { | ||
[ChainId.BASE]: | ||
'0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54', | ||
} as const | ||
const tickLens = { | ||
[ChainId.BASE]: '0xe3B6A547495c84A039D70A81178496220B5Fbd8e', | ||
} as const | ||
super(chainId, web3Client, factory, initCodeHash, tickLens) | ||
} | ||
getType(): LiquidityProviders { | ||
return LiquidityProviders.AlienBaseV3 | ||
} | ||
getPoolProviderName(): string { | ||
return 'AlienBaseV3' | ||
} | ||
} |
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 BSCSwapProvider extends UniswapV2BaseProvider { | ||
override fee = 0.003 | ||
constructor(chainId: ChainId, web3Client: PublicClient) { | ||
const factory = { | ||
[ChainId.BSC]: '0xCe8fd65646F2a2a897755A1188C04aCe94D2B8D0', | ||
} as const | ||
const initCodeHash = { | ||
[ChainId.BSC]: | ||
'0xacc1c81cc3e9fb496da555f6bd67c3a095e579b26c1b580070cc6afa8f0a94fa', | ||
} as const | ||
super(chainId, web3Client, factory, initCodeHash) | ||
} | ||
getType(): LiquidityProviders { | ||
return LiquidityProviders.BSCSwap | ||
} | ||
getPoolProviderName(): string { | ||
return 'BSCSwap' | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
packages/sushi/src/router/liquidity-providers/BakerySwap.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,24 @@ | ||
import { PublicClient } from 'viem' | ||
import { ChainId } from '../../chain/index.js' | ||
import { LiquidityProviders } from './LiquidityProvider.js' | ||
import { UniswapV2BaseProvider } from './UniswapV2Base.js' | ||
|
||
export class BakerySwapProvider extends UniswapV2BaseProvider { | ||
override fee = 0.003 | ||
constructor(chainId: ChainId, web3Client: PublicClient) { | ||
const factory = { | ||
[ChainId.BSC]: '0x01bF7C66c6BD861915CdaaE475042d3c4BaE16A7', | ||
} as const | ||
const initCodeHash = { | ||
[ChainId.BSC]: | ||
'0xe2e87433120e32c4738a7d8f3271f3d872cbe16241d67537139158d90bac61d3', | ||
} as const | ||
super(chainId, web3Client, factory, initCodeHash) | ||
} | ||
getType(): LiquidityProviders { | ||
return LiquidityProviders.BakerySwap | ||
} | ||
getPoolProviderName(): string { | ||
return 'BakerySwap' | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
packages/sushi/src/router/liquidity-providers/BaseSwapV3.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,53 @@ | ||
import { PublicClient } from 'viem' | ||
import { ChainId } from '../../chain/index.js' | ||
import { LiquidityProviders } from './LiquidityProvider.js' | ||
import { UniswapV3BaseProvider } from './UniswapV3Base.js' | ||
|
||
/** | ||
* The default factory enabled fee amounts, denominated in hundredths of bips. | ||
*/ | ||
export enum BaseSwapV3FeeAmount { | ||
/** 0.008% */ | ||
LOWEST = 80, | ||
/** 0.035% */ | ||
LOW = 350, | ||
/** 0.045% */ | ||
MEDIUM = 450, | ||
/** 0.25% */ | ||
HIGH = 2500, | ||
/** 1% */ | ||
HIGHEST = 10000, | ||
} | ||
|
||
export const BASESWAP_V3_FEE_SPACING_MAP: Record<BaseSwapV3FeeAmount, number> = | ||
{ | ||
[BaseSwapV3FeeAmount.LOWEST]: 1, | ||
[BaseSwapV3FeeAmount.LOW]: 10, | ||
[BaseSwapV3FeeAmount.MEDIUM]: 10, | ||
[BaseSwapV3FeeAmount.HIGH]: 60, | ||
[BaseSwapV3FeeAmount.HIGHEST]: 200, | ||
} | ||
|
||
export class BaseSwapV3Provider extends UniswapV3BaseProvider { | ||
override FEE = BaseSwapV3FeeAmount | ||
override TICK_SPACINGS = BASESWAP_V3_FEE_SPACING_MAP | ||
constructor(chainId: ChainId, web3Client: PublicClient) { | ||
const factory = { | ||
[ChainId.BASE]: '0x38015D05f4fEC8AFe15D7cc0386a126574e8077B', | ||
} as const | ||
const initCodeHash = { | ||
[ChainId.BASE]: | ||
'0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54', | ||
} as const | ||
const tickLens = { | ||
[ChainId.BASE]: '0xe3B6A547495c84A039D70A81178496220B5Fbd8e', | ||
} as const | ||
super(chainId, web3Client, factory, initCodeHash, tickLens) | ||
} | ||
getType(): LiquidityProviders { | ||
return LiquidityProviders.BaseSwapV3 | ||
} | ||
getPoolProviderName(): string { | ||
return 'BaseSwapV3' | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
packages/sushi/src/router/liquidity-providers/BladeSwap.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,29 @@ | ||
import { PublicClient } from 'viem' | ||
import { ChainId } from '../../chain/index.js' | ||
import { AlgebraV1BaseProvider } from './AlgebraV1Base.js' | ||
import { LiquidityProviders } from './LiquidityProvider.js' | ||
|
||
export class BladeSwapProvider extends AlgebraV1BaseProvider { | ||
constructor(chainId: ChainId, web3Client: PublicClient) { | ||
const factory = { | ||
[ChainId.BLAST]: '0xA87DbF5082Af26c9A6Ab2B854E378f704638CCa5', | ||
} as const | ||
const poolDeployer = { | ||
[ChainId.BLAST]: '0xfFeEcb1fe0EAaEFeE69d122F6B7a0368637cb593', | ||
} as const | ||
const initCodeHash = { | ||
[ChainId.BLAST]: | ||
'0xa9df2657ce5872e94bdc9525588fd983b0aa5db2f3c7a83d7e6b6a99cd2003a1', | ||
} as const | ||
const tickLens = { | ||
[ChainId.BLAST]: '0x969195B66f95D8B70fA414671b438134889Ba348', | ||
} as const | ||
super(chainId, web3Client, factory, initCodeHash, tickLens, poolDeployer) | ||
} | ||
getType(): LiquidityProviders { | ||
return LiquidityProviders.BladeSwap | ||
} | ||
getPoolProviderName(): string { | ||
return 'BladeSwap' | ||
} | ||
} |
Oops, something went wrong.