@paraswap/dex-lib 2.30.2-chronos-v3 → 2.30.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dex/balancer-v2/balancer-v2.js +0 -2
- package/build/dex/balancer-v2/balancer-v2.js.map +1 -1
- package/build/dex/balancer-v2/optimizer.js +38 -51
- package/build/dex/balancer-v2/optimizer.js.map +1 -1
- package/build/dex/balancer-v2/types.d.ts +0 -4
- package/build/dex/balancer-v2/types.js.map +1 -1
- package/build/dex/curve-v1-factory/config.js +17 -9
- package/build/dex/curve-v1-factory/config.js.map +1 -1
- package/build/dex/curve-v1-factory/curve-v1-factory.d.ts +1 -1
- package/build/dex/curve-v1-factory/curve-v1-factory.js +192 -177
- package/build/dex/curve-v1-factory/curve-v1-factory.js.map +1 -1
- package/build/dex/curve-v1-factory/curve-v1-pool-manager.js +4 -1
- package/build/dex/curve-v1-factory/curve-v1-pool-manager.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_calc_withdraw_one_coin.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/_calc_withdraw_one_coin.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_dynamic_fee.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/_dynamic_fee.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_rates.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/_rates.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_xp.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/_xp.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_xp_mem.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/_xp_mem.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/calc_token_amount.js +61 -14
- package/build/dex/curve-v1-factory/price-handlers/functions/calc_token_amount.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/calc_withdraw_one_coin.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/calc_withdraw_one_coin.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/constants.js +10 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/constants.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D_mem.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D_mem.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D_precisions.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D_precisions.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_dy.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_dy.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_dy_underlying.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_dy_underlying.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_y.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_y.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_y_D.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_y_D.js.map +1 -1
- package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.d.ts +1 -1
- package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.js +2 -2
- package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.js.map +1 -1
- package/build/dex/curve-v1-factory/types.d.ts +4 -1
- package/build/dex/curve-v1-factory/types.js +1 -0
- package/build/dex/curve-v1-factory/types.js.map +1 -1
- package/build/dex/solidly/forks-override/ramses.js +20 -8
- package/build/dex/solidly/forks-override/ramses.js.map +1 -1
- package/build/dex/solidly/solidly.js +1 -1
- package/build/dex/{ramses-v2 → test-dex}/config.d.ts +1 -1
- package/build/dex/test-dex/config.js +15 -0
- package/build/dex/test-dex/config.js.map +1 -0
- package/build/dex/test-dex/test-dex-pool.d.ts +39 -0
- package/build/dex/test-dex/test-dex-pool.js +63 -0
- package/build/dex/test-dex/test-dex-pool.js.map +1 -0
- package/build/dex/test-dex/test-dex.d.ts +37 -0
- package/build/dex/test-dex/test-dex.js +126 -0
- package/build/dex/test-dex/test-dex.js.map +1 -0
- package/build/dex/test-dex/types.d.ts +6 -0
- package/build/dex/{pancakeswap-v3 → test-dex}/types.js.map +1 -1
- package/build/dex/uniswap-v3/config.js +0 -14
- package/build/dex/uniswap-v3/config.js.map +1 -1
- package/build/dex/uniswap-v3/types.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3-pool.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3.js +1 -1
- package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
- package/build/dex/woo-fi-v2/woo-fi-math.d.ts +16 -0
- package/build/dex/woo-fi-v2/woo-fi-math.js +137 -0
- package/build/dex/woo-fi-v2/woo-fi-math.js.map +1 -0
- package/package.json +1 -2
- package/scripts/dex-integration.ts +1 -1
- package/src/dex/balancer-v2/balancer-v2.ts +0 -2
- package/src/dex/balancer-v2/optimizer.ts +49 -62
- package/src/dex/balancer-v2/types.ts +0 -4
- package/src/dex/curve-v1-factory/config.ts +17 -9
- package/src/dex/curve-v1-factory/curve-v1-factory-e2e.test.ts +19 -0
- package/src/dex/curve-v1-factory/curve-v1-factory-integration.test.ts +108 -45
- package/src/dex/curve-v1-factory/curve-v1-factory.ts +415 -367
- package/src/dex/curve-v1-factory/curve-v1-pool-manager.ts +4 -1
- package/src/dex/curve-v1-factory/price-handlers/functions/_calc_withdraw_one_coin.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/_dynamic_fee.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/_rates.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/_xp.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/_xp_mem.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/calc_token_amount.ts +71 -13
- package/src/dex/curve-v1-factory/price-handlers/functions/calc_withdraw_one_coin.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/constants.ts +11 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_D.ts +2 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_D_mem.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_D_precisions.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_dy.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_dy_underlying.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_y.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_y_D.ts +1 -0
- package/src/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.ts +2 -1
- package/src/dex/curve-v1-factory/types.ts +3 -1
- package/src/dex/solidly/forks-override/ramses.ts +105 -76
- package/src/dex/solidly/solidly.ts +1 -1
- package/src/dex/uniswap-v3/config.ts +0 -16
- package/src/dex/uniswap-v3/types.ts +4 -2
- package/src/dex/uniswap-v3/uniswap-v3-e2e.test.ts +50 -133
- package/src/dex/uniswap-v3/uniswap-v3-integration.test.ts +2 -150
- package/src/dex/uniswap-v3/uniswap-v3-pool.ts +5 -2
- package/src/dex/uniswap-v3/uniswap-v3.ts +4 -3
- package/tests/constants-e2e.ts +10 -0
- package/.idea/aws.xml +0 -17
- package/.idea/codeStyles/Project.xml +0 -19
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/paraswap-dex-lib.iml +0 -9
- package/.idea/vcs.xml +0 -6
- package/build/abi/algebra/AlgebraPool.abi.json +0 -727
- package/build/abi/curve-v1/StableSwapFRXETH.json +0 -889
- package/build/abi/curve-v1/StableSwapWBETH.json +0 -1223
- package/build/abi/wBETH.json +0 -1527
- package/build/dex/algebra/algebra-pool.d.ts +0 -46
- package/build/dex/algebra/algebra-pool.js +0 -336
- package/build/dex/algebra/algebra-pool.js.map +0 -1
- package/build/dex/curve-v1/pools/frxETHpool.d.ts +0 -7
- package/build/dex/curve-v1/pools/frxETHpool.js +0 -27
- package/build/dex/curve-v1/pools/frxETHpool.js.map +0 -1
- package/build/dex/curve-v1/pools/wbETHpool.d.ts +0 -29
- package/build/dex/curve-v1/pools/wbETHpool.js +0 -408
- package/build/dex/curve-v1/pools/wbETHpool.js.map +0 -1
- package/build/dex/pancakeswap-v3/types.d.ts +0 -14
- package/build/dex/ramses-v2/config.js +0 -28
- package/build/dex/ramses-v2/config.js.map +0 -1
- package/build/dex/ramses-v2/constants.d.ts +0 -28
- package/build/dex/ramses-v2/constants.js +0 -35
- package/build/dex/ramses-v2/constants.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/BitMath.d.ts +0 -4
- package/build/dex/ramses-v2/contract-math/BitMath.js +0 -93
- package/build/dex/ramses-v2/contract-math/BitMath.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/FixedPoint128.d.ts +0 -3
- package/build/dex/ramses-v2/contract-math/FixedPoint128.js +0 -8
- package/build/dex/ramses-v2/contract-math/FixedPoint128.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/FixedPoint96.d.ts +0 -4
- package/build/dex/ramses-v2/contract-math/FixedPoint96.js +0 -9
- package/build/dex/ramses-v2/contract-math/FixedPoint96.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/FullMath.d.ts +0 -4
- package/build/dex/ramses-v2/contract-math/FullMath.js +0 -19
- package/build/dex/ramses-v2/contract-math/FullMath.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/LiquidityMath.d.ts +0 -3
- package/build/dex/ramses-v2/contract-math/LiquidityMath.js +0 -22
- package/build/dex/ramses-v2/contract-math/LiquidityMath.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/Oracle.d.ts +0 -10
- package/build/dex/ramses-v2/contract-math/Oracle.js +0 -133
- package/build/dex/ramses-v2/contract-math/Oracle.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/SqrtPriceMath.d.ts +0 -10
- package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js +0 -91
- package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/SwapMath.d.ts +0 -8
- package/build/dex/ramses-v2/contract-math/SwapMath.js +0 -70
- package/build/dex/ramses-v2/contract-math/SwapMath.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/Tick.d.ts +0 -7
- package/build/dex/ramses-v2/contract-math/Tick.js +0 -45
- package/build/dex/ramses-v2/contract-math/Tick.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/TickBitMap.d.ts +0 -8
- package/build/dex/ramses-v2/contract-math/TickBitMap.js +0 -87
- package/build/dex/ramses-v2/contract-math/TickBitMap.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/TickMath.d.ts +0 -8
- package/build/dex/ramses-v2/contract-math/TickMath.js +0 -162
- package/build/dex/ramses-v2/contract-math/TickMath.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/UnsafeMath.d.ts +0 -3
- package/build/dex/ramses-v2/contract-math/UnsafeMath.js +0 -10
- package/build/dex/ramses-v2/contract-math/UnsafeMath.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/uniswap-v3-math.d.ts +0 -18
- package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js +0 -392
- package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/utils.d.ts +0 -3
- package/build/dex/ramses-v2/contract-math/utils.js +0 -16
- package/build/dex/ramses-v2/contract-math/utils.js.map +0 -1
- package/build/dex/ramses-v2/ramses-v2-pool.d.ts +0 -42
- package/build/dex/ramses-v2/ramses-v2-pool.js +0 -307
- package/build/dex/ramses-v2/ramses-v2-pool.js.map +0 -1
- package/build/dex/ramses-v2/ramses-v2.d.ts +0 -61
- package/build/dex/ramses-v2/ramses-v2.js +0 -690
- package/build/dex/ramses-v2/ramses-v2.js.map +0 -1
- package/build/dex/ramses-v2/types.d.ts +0 -154
- package/build/dex/ramses-v2/types.js +0 -9
- package/build/dex/ramses-v2/types.js.map +0 -1
- package/build/dex/ramses-v2/utils.d.ts +0 -6
- package/build/dex/ramses-v2/utils.js +0 -71
- package/build/dex/ramses-v2/utils.js.map +0 -1
- /package/build/dex/{pancakeswap-v3 → test-dex}/types.js +0 -0
|
@@ -42,7 +42,10 @@ export class CurveV1FactoryPoolManager {
|
|
|
42
42
|
// It should bo considered for optimizing
|
|
43
43
|
private coinAddressesToPoolIdentifiers: Record<string, string[]> = {};
|
|
44
44
|
|
|
45
|
-
private allCurveLiquidityApiSlugs: Set<string> = new Set([
|
|
45
|
+
private allCurveLiquidityApiSlugs: Set<string> = new Set([
|
|
46
|
+
'/factory',
|
|
47
|
+
'/factory-crvusd',
|
|
48
|
+
]);
|
|
46
49
|
|
|
47
50
|
private statePollingManager = StatePollingManager;
|
|
48
51
|
private taskScheduler: TaskScheduler;
|
|
@@ -284,6 +284,7 @@ const implementations: Record<ImplementationNames, _calc_withdraw_one_coin> = {
|
|
|
284
284
|
[ImplementationNames.FACTORY_PLAIN_2_BASIC_EMA]: customArbitrum2CoinBtc,
|
|
285
285
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: customArbitrum2CoinBtc,
|
|
286
286
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: factoryPlain2EthEma2,
|
|
287
|
+
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: customArbitrum2CoinBtc,
|
|
287
288
|
};
|
|
288
289
|
|
|
289
290
|
export default implementations;
|
|
@@ -93,6 +93,7 @@ const implementations: Record<ImplementationNames, _dynamic_fee> = {
|
|
|
93
93
|
[ImplementationNames.FACTORY_PLAIN_2_BASIC_EMA]: notExist,
|
|
94
94
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: notExist,
|
|
95
95
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: notExist,
|
|
96
|
+
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: notExist,
|
|
96
97
|
};
|
|
97
98
|
|
|
98
99
|
export default implementations;
|
|
@@ -108,6 +108,7 @@ const implementations: Record<ImplementationNames, _rates> = {
|
|
|
108
108
|
[ImplementationNames.FACTORY_PLAIN_2_BASIC_EMA]: notExist,
|
|
109
109
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: notExist,
|
|
110
110
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: notExist,
|
|
111
|
+
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: notExist,
|
|
111
112
|
};
|
|
112
113
|
|
|
113
114
|
export default implementations;
|
|
@@ -106,6 +106,7 @@ const implementations: Record<ImplementationNames, _xp> = {
|
|
|
106
106
|
[ImplementationNames.FACTORY_PLAIN_2_BASIC_EMA]: notExist,
|
|
107
107
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: notExist,
|
|
108
108
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: notExist,
|
|
109
|
+
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: notExist,
|
|
109
110
|
};
|
|
110
111
|
|
|
111
112
|
export default implementations;
|
|
@@ -95,6 +95,7 @@ const implementations: Record<ImplementationNames, _xp_mem> = {
|
|
|
95
95
|
[ImplementationNames.FACTORY_PLAIN_2_BASIC_EMA]: factoryPlain2Basic,
|
|
96
96
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: factoryPlain2Basic,
|
|
97
97
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: factoryPlain2Basic,
|
|
98
|
+
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: factoryPlain2Basic,
|
|
98
99
|
};
|
|
99
100
|
|
|
100
101
|
export default implementations;
|
|
@@ -35,6 +35,35 @@ const customPlain3CoinThree: calc_token_amount = (
|
|
|
35
35
|
return (diff * token_amount) / D0;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
+
const customAvalanche3CoinLending: calc_token_amount = (
|
|
39
|
+
self: IPoolContext,
|
|
40
|
+
state: PoolState,
|
|
41
|
+
amounts: bigint[],
|
|
42
|
+
is_deposit: boolean,
|
|
43
|
+
) => {
|
|
44
|
+
const { N_COINS } = self.constants;
|
|
45
|
+
|
|
46
|
+
const coin_balances = [...state.balances];
|
|
47
|
+
const amp = state.A;
|
|
48
|
+
const D0 = self.get_D_precision(self, coin_balances, amp);
|
|
49
|
+
for (const i of _.range(N_COINS)) {
|
|
50
|
+
if (is_deposit) coin_balances[i] += amounts[i];
|
|
51
|
+
else coin_balances[i] -= amounts[i];
|
|
52
|
+
}
|
|
53
|
+
const D1 = self.get_D_precision(self, coin_balances, amp);
|
|
54
|
+
let diff = 0n;
|
|
55
|
+
if (is_deposit) diff = D1 - D0;
|
|
56
|
+
else diff = D0 - D1;
|
|
57
|
+
|
|
58
|
+
if (state.totalSupply === undefined) {
|
|
59
|
+
throw new Error(
|
|
60
|
+
`${self.IMPLEMENTATION_NAME} customAvalanche3CoinLending: totalSupply is not provided`,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (diff * state.totalSupply) / D0;
|
|
65
|
+
};
|
|
66
|
+
|
|
38
67
|
const factoryPlain2Basic: calc_token_amount = (
|
|
39
68
|
self: IPoolContext,
|
|
40
69
|
state: PoolState,
|
|
@@ -67,33 +96,61 @@ const factoryPlain2Basic: calc_token_amount = (
|
|
|
67
96
|
return (diff * token_amount) / D0;
|
|
68
97
|
};
|
|
69
98
|
|
|
70
|
-
const
|
|
99
|
+
const customPlain2CoinCrv: calc_token_amount = (
|
|
71
100
|
self: IPoolContext,
|
|
72
101
|
state: PoolState,
|
|
73
102
|
amounts: bigint[],
|
|
74
103
|
is_deposit: boolean,
|
|
75
104
|
) => {
|
|
76
|
-
const { N_COINS } = self.constants;
|
|
77
|
-
|
|
78
|
-
const coin_balances = [...state.balances];
|
|
105
|
+
const { N_COINS, BI_N_COINS, FEE_DENOMINATOR } = self.constants;
|
|
79
106
|
const amp = state.A;
|
|
80
|
-
const
|
|
107
|
+
const balances = [...state.balances];
|
|
108
|
+
const D0 = self.get_D_mem(self, state, balances, amp);
|
|
81
109
|
for (const i of _.range(N_COINS)) {
|
|
82
|
-
if (is_deposit)
|
|
83
|
-
else
|
|
110
|
+
if (is_deposit) balances[i] += amounts[i];
|
|
111
|
+
else balances[i] -= amounts[i];
|
|
84
112
|
}
|
|
85
|
-
const D1 = self.
|
|
86
|
-
let diff = 0n;
|
|
87
|
-
if (is_deposit) diff = D1 - D0;
|
|
88
|
-
else diff = D0 - D1;
|
|
113
|
+
const D1 = self.get_D_mem(self, state, balances, amp);
|
|
89
114
|
|
|
90
115
|
if (state.totalSupply === undefined) {
|
|
91
116
|
throw new Error(
|
|
92
|
-
`${self.IMPLEMENTATION_NAME}
|
|
117
|
+
`${self.IMPLEMENTATION_NAME} customPlain3CoinThree: totalSupply is not provided`,
|
|
93
118
|
);
|
|
94
119
|
}
|
|
95
120
|
|
|
96
|
-
|
|
121
|
+
const total_supply = state.totalSupply;
|
|
122
|
+
let D2 = D1;
|
|
123
|
+
|
|
124
|
+
if (total_supply > 0n) {
|
|
125
|
+
const base_fee = (state.fee * BI_N_COINS) / (4n * (BI_N_COINS - 1n));
|
|
126
|
+
for (const i of _.range(N_COINS)) {
|
|
127
|
+
const ideal_balance = (D1 * state.balances[i]) / D0;
|
|
128
|
+
let difference = 0n;
|
|
129
|
+
const new_balance = balances[i];
|
|
130
|
+
if (ideal_balance > new_balance) {
|
|
131
|
+
difference = ideal_balance - new_balance;
|
|
132
|
+
} else {
|
|
133
|
+
difference = new_balance - ideal_balance;
|
|
134
|
+
}
|
|
135
|
+
balances[i] -= (base_fee * difference) / FEE_DENOMINATOR;
|
|
136
|
+
}
|
|
137
|
+
const xp = self._xp_mem(
|
|
138
|
+
self,
|
|
139
|
+
[...state.constants.rate_multipliers],
|
|
140
|
+
balances,
|
|
141
|
+
);
|
|
142
|
+
D2 = self.get_D_mem(self, state, xp, amp);
|
|
143
|
+
} else {
|
|
144
|
+
return D1;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
let diff = 0n;
|
|
148
|
+
if (is_deposit) {
|
|
149
|
+
diff = D2 - D0;
|
|
150
|
+
} else {
|
|
151
|
+
diff = D0 - D2;
|
|
152
|
+
}
|
|
153
|
+
return (diff * total_supply) / D0;
|
|
97
154
|
};
|
|
98
155
|
|
|
99
156
|
const notImplemented: calc_token_amount = (
|
|
@@ -165,6 +222,7 @@ const implementations: Record<ImplementationNames, calc_token_amount> = {
|
|
|
165
222
|
[ImplementationNames.FACTORY_PLAIN_2_BASIC_EMA]: customPlain3CoinThree,
|
|
166
223
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: customPlain3CoinThree,
|
|
167
224
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: customPlain3CoinThree,
|
|
225
|
+
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: customPlain2CoinCrv,
|
|
168
226
|
};
|
|
169
227
|
|
|
170
228
|
export default implementations;
|
|
@@ -82,6 +82,7 @@ export const implementations: Record<
|
|
|
82
82
|
[ImplementationNames.FACTORY_PLAIN_2_BASIC_EMA]: customPlain3CoinThree,
|
|
83
83
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: customPlain3CoinThree,
|
|
84
84
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: customPlain3CoinThree,
|
|
85
|
+
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: customPlain3CoinThree,
|
|
85
86
|
};
|
|
86
87
|
|
|
87
88
|
export default implementations;
|
|
@@ -573,6 +573,17 @@ const implementationConstants: Record<
|
|
|
573
573
|
isFeeOnTransferSupported: true,
|
|
574
574
|
isLending: false,
|
|
575
575
|
|
|
576
|
+
N_COINS: 2,
|
|
577
|
+
BI_N_COINS: 2n,
|
|
578
|
+
PRECISION: BI_POWS[18],
|
|
579
|
+
FEE_DENOMINATOR: BI_POWS[10],
|
|
580
|
+
A_PRECISION: 100n,
|
|
581
|
+
},
|
|
582
|
+
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: {
|
|
583
|
+
isWrapNative: false,
|
|
584
|
+
isFeeOnTransferSupported: false,
|
|
585
|
+
isLending: false,
|
|
586
|
+
|
|
576
587
|
N_COINS: 2,
|
|
577
588
|
BI_N_COINS: 2n,
|
|
578
589
|
PRECISION: BI_POWS[18],
|
|
@@ -321,6 +321,8 @@ const implementations: Record<ImplementationNames, get_D> = {
|
|
|
321
321
|
makeFuncCacheable(factoryPlain2Basic),
|
|
322
322
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]:
|
|
323
323
|
makeFuncCacheable(factoryPlain2Basic),
|
|
324
|
+
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]:
|
|
325
|
+
makeFuncCacheable(factoryPlain2Basic),
|
|
324
326
|
};
|
|
325
327
|
|
|
326
328
|
export default implementations;
|
|
@@ -140,6 +140,7 @@ export const implementations: Record<ImplementationNames, get_D_mem> = {
|
|
|
140
140
|
[ImplementationNames.FACTORY_PLAIN_2_BASIC_EMA]: factoryPlain2Basic,
|
|
141
141
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: factoryPlain2Basic,
|
|
142
142
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: factoryPlain2EthEma2,
|
|
143
|
+
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: factoryPlain2Basic,
|
|
143
144
|
};
|
|
144
145
|
|
|
145
146
|
export default implementations;
|
|
@@ -112,6 +112,7 @@ const implementations: Record<ImplementationNames, get_D_precisions> = {
|
|
|
112
112
|
[ImplementationNames.FACTORY_PLAIN_2_BASIC_EMA]: notExist,
|
|
113
113
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: notExist,
|
|
114
114
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: notExist,
|
|
115
|
+
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: notExist,
|
|
115
116
|
};
|
|
116
117
|
|
|
117
118
|
export default implementations;
|
|
@@ -266,6 +266,7 @@ const implementations: Record<ImplementationNames, get_dy> = {
|
|
|
266
266
|
[ImplementationNames.FACTORY_PLAIN_2_BASIC_EMA]: factoryPlain2Basic,
|
|
267
267
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: factoryPlain2Basic,
|
|
268
268
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: factoryPlain2EthEma2,
|
|
269
|
+
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: factoryPlain2Basic,
|
|
269
270
|
};
|
|
270
271
|
|
|
271
272
|
export default implementations;
|
|
@@ -285,6 +285,7 @@ const implementations: Record<ImplementationNames, get_dy_underlying> = {
|
|
|
285
285
|
[ImplementationNames.FACTORY_PLAIN_2_BASIC_EMA]: notExist,
|
|
286
286
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: notExist,
|
|
287
287
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: notExist,
|
|
288
|
+
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: notExist,
|
|
288
289
|
};
|
|
289
290
|
|
|
290
291
|
export default implementations;
|
|
@@ -189,6 +189,7 @@ const implementations: Record<ImplementationNames, get_y> = {
|
|
|
189
189
|
[ImplementationNames.FACTORY_PLAIN_2_BASIC_EMA]: customPlain2CoinFrax,
|
|
190
190
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: customPlain2CoinFrax,
|
|
191
191
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: customPlain2CoinFrax,
|
|
192
|
+
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: customPlain2CoinFrax,
|
|
192
193
|
};
|
|
193
194
|
|
|
194
195
|
export default implementations;
|
|
@@ -175,6 +175,7 @@ const implementations: Record<ImplementationNames, get_y_D> = {
|
|
|
175
175
|
[ImplementationNames.FACTORY_PLAIN_2_BASIC_EMA]: customPlain2CoinFrax,
|
|
176
176
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: customPlain2CoinFrax,
|
|
177
177
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: customPlain2CoinFrax,
|
|
178
|
+
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: customPlain2CoinFrax,
|
|
178
179
|
};
|
|
179
180
|
|
|
180
181
|
export default implementations;
|
|
@@ -44,6 +44,7 @@ export class FactoryStateHandler extends PoolPollingBase {
|
|
|
44
44
|
readonly poolConstants: PoolConstants,
|
|
45
45
|
readonly poolContextConstants: PoolContextConstants,
|
|
46
46
|
readonly isSrcFeeOnTransferSupported: boolean,
|
|
47
|
+
liquidityApiSlug: string,
|
|
47
48
|
baseStatePoolPolling?: PoolPollingBase,
|
|
48
49
|
customGasCost?: number,
|
|
49
50
|
readonly isStoredRatesSupported: boolean = false,
|
|
@@ -65,7 +66,7 @@ export class FactoryStateHandler extends PoolPollingBase {
|
|
|
65
66
|
poolIdentifier,
|
|
66
67
|
poolConstants,
|
|
67
68
|
address,
|
|
68
|
-
|
|
69
|
+
liquidityApiSlug,
|
|
69
70
|
false,
|
|
70
71
|
baseStatePoolPolling,
|
|
71
72
|
isSrcFeeOnTransferSupported,
|
|
@@ -104,6 +104,7 @@ export enum FactoryImplementationNames {
|
|
|
104
104
|
FACTORY_PLAIN_2_ETH_EMA = 'factory_plain_2_eth_ema',
|
|
105
105
|
FACTORY_PLAIN_2_ETH_EMA2 = 'factory_plain_2_eth_ema2',
|
|
106
106
|
FACTORY_PLAIN_2_OPTIMIZED = 'factory_plain_2_optimized',
|
|
107
|
+
FACTORY_PLAIN_2_CRV_EMA = 'factory_plain_2_crv_ema',
|
|
107
108
|
|
|
108
109
|
FACTORY_PLAIN_3_BALANCES = 'factory_plain_3_balances',
|
|
109
110
|
FACTORY_PLAIN_3_BASIC = 'factory_plain_3_basic',
|
|
@@ -154,6 +155,7 @@ export type FactoryPoolImplementations = {
|
|
|
154
155
|
basePoolAddress?: Address;
|
|
155
156
|
customGasCost?: number;
|
|
156
157
|
isStoreRateSupported?: boolean;
|
|
158
|
+
liquidityApiSlug?: string;
|
|
157
159
|
};
|
|
158
160
|
|
|
159
161
|
export type CustomPoolConfig = {
|
|
@@ -174,7 +176,7 @@ export type CustomPoolConfig = {
|
|
|
174
176
|
};
|
|
175
177
|
|
|
176
178
|
export type DexParams = {
|
|
177
|
-
|
|
179
|
+
factoryAddresses: string[] | null;
|
|
178
180
|
stateUpdatePeriodMs: number;
|
|
179
181
|
factoryPoolImplementations: Record<Address, FactoryPoolImplementations>;
|
|
180
182
|
customPools: Record<string, CustomPoolConfig>;
|
|
@@ -9,12 +9,11 @@ import { IDexHelper } from '../../../dex-helper';
|
|
|
9
9
|
import { SolidlyPair } from '../types';
|
|
10
10
|
import { Interface } from '@ethersproject/abi';
|
|
11
11
|
|
|
12
|
-
|
|
13
12
|
const RamsesFactoryABI = [
|
|
14
13
|
{
|
|
15
|
-
inputs: [{internalType: 'address', name: '', type: 'address'}],
|
|
14
|
+
inputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
16
15
|
name: 'pairFee',
|
|
17
|
-
outputs: [{internalType: 'uint256',
|
|
16
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
18
17
|
stateMutability: 'view',
|
|
19
18
|
type: 'function',
|
|
20
19
|
},
|
|
@@ -34,10 +33,9 @@ export type RamsesSubgraphPool = {
|
|
|
34
33
|
export type RamsesSubgraphToken = {
|
|
35
34
|
id: string;
|
|
36
35
|
decimals: string;
|
|
37
|
-
}
|
|
36
|
+
};
|
|
38
37
|
|
|
39
38
|
export class Ramses extends Solidly {
|
|
40
|
-
|
|
41
39
|
public static dexKeysWithNetwork: { key: string; networks: Network[] }[] =
|
|
42
40
|
getDexKeysWithNetwork(_.pick(SolidlyConfig, ['Ramses']));
|
|
43
41
|
|
|
@@ -57,7 +55,9 @@ export class Ramses extends Solidly {
|
|
|
57
55
|
protected getFeesMultiCallData(pair: SolidlyPair) {
|
|
58
56
|
const callEntry = {
|
|
59
57
|
target: this.factoryAddress,
|
|
60
|
-
callData: ramsesFactoryIface.encodeFunctionData('pairFee', [
|
|
58
|
+
callData: ramsesFactoryIface.encodeFunctionData('pairFee', [
|
|
59
|
+
pair.exchange,
|
|
60
|
+
]),
|
|
61
61
|
};
|
|
62
62
|
const callDecoder = (values: any[]) =>
|
|
63
63
|
parseInt(
|
|
@@ -109,8 +109,11 @@ export class Ramses extends Solidly {
|
|
|
109
109
|
if (!(data && data.pools0 && data.pools1))
|
|
110
110
|
throw new Error("Couldn't fetch the pools from the subgraph");
|
|
111
111
|
|
|
112
|
-
const tokenIds = _.uniq(
|
|
113
|
-
|
|
112
|
+
const tokenIds = _.uniq(
|
|
113
|
+
[]
|
|
114
|
+
.concat(data.pools0, data.pools1)
|
|
115
|
+
.map((pool: RamsesSubgraphPool) => [pool.token0, pool.token1])
|
|
116
|
+
.flat(),
|
|
114
117
|
);
|
|
115
118
|
|
|
116
119
|
const tokensQuery = `
|
|
@@ -121,7 +124,6 @@ export class Ramses extends Solidly {
|
|
|
121
124
|
}
|
|
122
125
|
}`;
|
|
123
126
|
|
|
124
|
-
|
|
125
127
|
const { data: tokensData } = await this.dexHelper.httpRequest.post(
|
|
126
128
|
this.subgraphURL,
|
|
127
129
|
{
|
|
@@ -131,35 +133,45 @@ export class Ramses extends Solidly {
|
|
|
131
133
|
SUBGRAPH_TIMEOUT,
|
|
132
134
|
);
|
|
133
135
|
|
|
134
|
-
const pools0 = await this.prepareSubgraphPools(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
136
|
+
const pools0 = await this.prepareSubgraphPools(
|
|
137
|
+
tokensData.tokens,
|
|
138
|
+
data.pools0,
|
|
139
|
+
(
|
|
140
|
+
pool,
|
|
141
|
+
{ address1, decimals1, liquidityUSDToken0, liquidityUSDToken1 },
|
|
142
|
+
) => ({
|
|
143
|
+
exchange: this.dexKey,
|
|
144
|
+
stable: pool.isStable,
|
|
145
|
+
address: pool.id.toLowerCase(),
|
|
146
|
+
connectorTokens: [
|
|
147
|
+
{
|
|
148
|
+
address: address1,
|
|
149
|
+
decimals: decimals1,
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
liquidityUSD: liquidityUSDToken0 + liquidityUSDToken1,
|
|
153
|
+
}),
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
const pools1 = await this.prepareSubgraphPools(
|
|
157
|
+
tokensData.tokens,
|
|
158
|
+
data.pools1,
|
|
159
|
+
(
|
|
160
|
+
pool,
|
|
161
|
+
{ address0, decimals0, liquidityUSDToken0, liquidityUSDToken1 },
|
|
162
|
+
) => ({
|
|
163
|
+
exchange: this.dexKey,
|
|
164
|
+
stable: pool.isStable,
|
|
165
|
+
address: pool.id.toLowerCase(),
|
|
166
|
+
connectorTokens: [
|
|
167
|
+
{
|
|
168
|
+
address: address0,
|
|
169
|
+
decimals: decimals0,
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
liquidityUSD: liquidityUSDToken0 + liquidityUSDToken1,
|
|
173
|
+
}),
|
|
174
|
+
);
|
|
163
175
|
|
|
164
176
|
return _.slice(
|
|
165
177
|
_.sortBy(_.concat(pools0, pools1), [pool => -1 * pool.liquidityUSD]),
|
|
@@ -172,7 +184,8 @@ export class Ramses extends Solidly {
|
|
|
172
184
|
tokens: RamsesSubgraphToken[],
|
|
173
185
|
pools: RamsesSubgraphPool[],
|
|
174
186
|
iterator: (
|
|
175
|
-
pool: RamsesSubgraphPool,
|
|
187
|
+
pool: RamsesSubgraphPool,
|
|
188
|
+
{
|
|
176
189
|
address0,
|
|
177
190
|
address1,
|
|
178
191
|
decimals0,
|
|
@@ -182,43 +195,59 @@ export class Ramses extends Solidly {
|
|
|
182
195
|
liquidityUSDToken0,
|
|
183
196
|
liquidityUSDToken1,
|
|
184
197
|
}: {
|
|
185
|
-
address0: string
|
|
186
|
-
address1: string
|
|
187
|
-
decimals0: number
|
|
188
|
-
decimals1: number
|
|
189
|
-
reserve0: bigint
|
|
190
|
-
reserve1: bigint
|
|
191
|
-
liquidityUSDToken0: number
|
|
192
|
-
liquidityUSDToken1: number
|
|
193
|
-
}
|
|
198
|
+
address0: string;
|
|
199
|
+
address1: string;
|
|
200
|
+
decimals0: number;
|
|
201
|
+
decimals1: number;
|
|
202
|
+
reserve0: bigint;
|
|
203
|
+
reserve1: bigint;
|
|
204
|
+
liquidityUSDToken0: number;
|
|
205
|
+
liquidityUSDToken1: number;
|
|
206
|
+
},
|
|
207
|
+
) => PoolLiquidity,
|
|
194
208
|
): Promise<PoolLiquidity[]> {
|
|
195
|
-
return Promise.all(
|
|
196
|
-
pool: RamsesSubgraphPool
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
209
|
+
return Promise.all(
|
|
210
|
+
pools.map(async (pool: RamsesSubgraphPool) => {
|
|
211
|
+
const address0 = pool.token0.toLowerCase();
|
|
212
|
+
const address1 = pool.token1.toLowerCase();
|
|
213
|
+
|
|
214
|
+
const decimals0 = parseInt(
|
|
215
|
+
tokens.find(t => t.id === address0)!.decimals,
|
|
216
|
+
);
|
|
217
|
+
const decimals1 = parseInt(
|
|
218
|
+
tokens.find(t => t.id === address1)!.decimals,
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
const reserve0 = BigInt(new BigNumber(pool.reserve0).toFixed());
|
|
222
|
+
const reserve1 = BigInt(new BigNumber(pool.reserve1).toFixed());
|
|
223
|
+
|
|
224
|
+
const liquidityUSDToken0 = await this.dexHelper.getTokenUSDPrice(
|
|
225
|
+
{
|
|
226
|
+
address: address0,
|
|
227
|
+
decimals: decimals0,
|
|
228
|
+
},
|
|
229
|
+
reserve0,
|
|
230
|
+
);
|
|
231
|
+
|
|
232
|
+
const liquidityUSDToken1 = await this.dexHelper.getTokenUSDPrice(
|
|
233
|
+
{
|
|
234
|
+
address: address1,
|
|
235
|
+
decimals: decimals1,
|
|
236
|
+
},
|
|
237
|
+
reserve1,
|
|
238
|
+
);
|
|
239
|
+
|
|
240
|
+
return iterator(pool, {
|
|
241
|
+
address0,
|
|
242
|
+
address1,
|
|
243
|
+
decimals0,
|
|
244
|
+
decimals1,
|
|
245
|
+
reserve0,
|
|
246
|
+
reserve1,
|
|
247
|
+
liquidityUSDToken0,
|
|
248
|
+
liquidityUSDToken1,
|
|
249
|
+
});
|
|
250
|
+
}),
|
|
251
|
+
);
|
|
223
252
|
}
|
|
224
253
|
}
|
|
@@ -107,22 +107,6 @@ export const UniswapV3Config: DexConfigMap<DexParams> = {
|
|
|
107
107
|
'https://api.thegraph.com/subgraphs/name/lynnshaoyu/uniswap-v3-avax',
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
|
-
ChronosV3: {
|
|
111
|
-
[Network.ARBITRUM]: {
|
|
112
|
-
factory: '0x4Db9D624F67E00dbF8ef7AE0e0e8eE54aF1dee49',
|
|
113
|
-
quoter: '0x6E7f0Ca45171a4440c0CDdF3A46A8dC5D4c2d4A0',
|
|
114
|
-
router: '0xE0aBdFD837D451640CF43cB1Ec4eE87976eFbb41',
|
|
115
|
-
supportedFees: SUPPORTED_FEES,
|
|
116
|
-
stateMulticall: '0x46b44eb4Cc3bEbB9f04C419f691aB85Ff885A4D6',
|
|
117
|
-
uniswapMulticall: '0xaBB58098A7B5172A9b0B38a1925A522dbf0b4FC3',
|
|
118
|
-
chunksCount: 10,
|
|
119
|
-
initRetryFrequency: 10,
|
|
120
|
-
initHash:
|
|
121
|
-
'0x09c178be473df44d1de6970978a4fdedce1ce52a23b2b979754547f6b43a19a5',
|
|
122
|
-
subgraphURL:
|
|
123
|
-
'https://subgraph.chronos.exchange/subgraphs/name/chronos-v3',
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
110
|
RamsesV2: {
|
|
127
111
|
[Network.ARBITRUM]: {
|
|
128
112
|
factory: '0xAA2cd7477c451E703f3B9Ba5663334914763edF8',
|
|
@@ -62,7 +62,9 @@ export type UniswapV3Data = {
|
|
|
62
62
|
isApproved?: boolean;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
export type DecodeStateMultiCallFunc = (
|
|
65
|
+
export type DecodeStateMultiCallFunc = (
|
|
66
|
+
result: MultiResult<BytesLike> | BytesLike,
|
|
67
|
+
) => DecodedStateMultiCallResultWithRelativeBitmaps;
|
|
66
68
|
|
|
67
69
|
export type DexParams = {
|
|
68
70
|
router: Address;
|
|
@@ -77,7 +79,7 @@ export type DexParams = {
|
|
|
77
79
|
subgraphURL: string;
|
|
78
80
|
initHash: string;
|
|
79
81
|
stateMultiCallAbi?: AbiItem[];
|
|
80
|
-
decodeStateMultiCallResultWithRelativeBitmaps
|
|
82
|
+
decodeStateMultiCallResultWithRelativeBitmaps?: DecodeStateMultiCallFunc;
|
|
81
83
|
};
|
|
82
84
|
|
|
83
85
|
export type UniswapV3SimpleSwapSellParam = {
|