@paraswap/dex-lib 2.16.3 → 2.16.4-balancer-v2-buy.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.
Files changed (86) hide show
  1. package/.idea/aws.xml +17 -0
  2. package/.idea/codeStyles/Project.xml +19 -0
  3. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  4. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  5. package/.idea/misc.xml +6 -0
  6. package/.idea/modules.xml +8 -0
  7. package/.idea/paraswap-dex-lib.iml +9 -0
  8. package/.idea/vcs.xml +6 -0
  9. package/build/abi/TraderJoeV21Router.json +1489 -0
  10. package/build/config.js +10 -10
  11. package/build/dex/balancer-v2/balancer-v2.d.ts +9 -14
  12. package/build/dex/balancer-v2/balancer-v2.js +19 -16
  13. package/build/dex/balancer-v2/balancer-v2.js.map +1 -1
  14. package/build/dex/balancer-v2/config.d.ts +2 -7
  15. package/build/dex/balancer-v2/config.js +20 -30
  16. package/build/dex/balancer-v2/config.js.map +1 -1
  17. package/build/dex/balancer-v2/pools/balancer-v2-pool.d.ts +25 -0
  18. package/build/dex/balancer-v2/pools/balancer-v2-pool.js +107 -0
  19. package/build/dex/balancer-v2/pools/balancer-v2-pool.js.map +1 -0
  20. package/build/dex/balancer-v2/pools/linear/LinearMath.d.ts +20 -0
  21. package/build/dex/balancer-v2/pools/linear/LinearMath.js +186 -0
  22. package/build/dex/balancer-v2/pools/linear/LinearMath.js.map +1 -0
  23. package/build/dex/balancer-v2/pools/linear/LinearPool.d.ts +51 -0
  24. package/build/dex/balancer-v2/pools/linear/LinearPool.js +477 -0
  25. package/build/dex/balancer-v2/pools/linear/LinearPool.js.map +1 -0
  26. package/build/dex/balancer-v2/pools/phantom-stable/PhantomStableMath.d.ts +10 -0
  27. package/build/dex/balancer-v2/pools/phantom-stable/PhantomStableMath.js +314 -0
  28. package/build/dex/balancer-v2/pools/phantom-stable/PhantomStableMath.js.map +1 -0
  29. package/build/dex/balancer-v2/pools/phantom-stable/PhantomStablePool.d.ts +50 -0
  30. package/build/dex/balancer-v2/pools/phantom-stable/PhantomStablePool.js +367 -0
  31. package/build/dex/balancer-v2/pools/phantom-stable/PhantomStablePool.js.map +1 -0
  32. package/build/dex/balancer-v2/pools/stable/StableMath.d.ts +7 -0
  33. package/build/dex/balancer-v2/pools/stable/StableMath.js +111 -0
  34. package/build/dex/balancer-v2/pools/stable/StableMath.js.map +1 -0
  35. package/build/dex/balancer-v2/pools/stable/StablePool.d.ts +30 -0
  36. package/build/dex/balancer-v2/pools/stable/StablePool.js +129 -0
  37. package/build/dex/balancer-v2/pools/stable/StablePool.js.map +1 -0
  38. package/build/dex/balancer-v2/pools/weighted/WeightedMath.d.ts +6 -0
  39. package/build/dex/balancer-v2/pools/weighted/WeightedMath.js +61 -0
  40. package/build/dex/balancer-v2/pools/weighted/WeightedMath.js.map +1 -0
  41. package/build/dex/balancer-v2/pools/weighted/WeightedPool.d.ts +30 -0
  42. package/build/dex/balancer-v2/pools/weighted/WeightedPool.js +112 -0
  43. package/build/dex/balancer-v2/pools/weighted/WeightedPool.js.map +1 -0
  44. package/build/dex/balancer-v2/types.d.ts +1 -0
  45. package/build/dex/balancer-v2/types.js.map +1 -1
  46. package/build/dex/index.js +2 -0
  47. package/build/dex/index.js.map +1 -1
  48. package/build/dex/trader-joe-v2.1.d.ts +43 -0
  49. package/build/dex/trader-joe-v2.1.js +78 -0
  50. package/build/dex/trader-joe-v2.1.js.map +1 -0
  51. package/package.json +1 -1
  52. package/src/abi/TraderJoeV21Router.json +1489 -0
  53. package/src/config.ts +10 -10
  54. package/src/dex/balancer-v2/balancer-v2-e2e.test.ts +207 -224
  55. package/src/dex/balancer-v2/balancer-v2.ts +41 -29
  56. package/src/dex/balancer-v2/config.ts +23 -35
  57. package/src/dex/balancer-v2/pools/balancer-v2-pool.ts +274 -0
  58. package/src/dex/balancer-v2/{LinearMath.ts → pools/linear/LinearMath.ts} +81 -23
  59. package/src/dex/balancer-v2/{LinearPool.ts → pools/linear/LinearPool.ts} +241 -5
  60. package/src/dex/balancer-v2/{StableMath.ts → pools/phantom-stable/PhantomStableMath.ts} +101 -21
  61. package/src/dex/balancer-v2/{PhantomStablePool.ts → pools/phantom-stable/PhantomStablePool.ts} +165 -11
  62. package/src/dex/balancer-v2/pools/stable/StableMath.ts +204 -0
  63. package/src/dex/balancer-v2/pools/stable/StablePool.ts +221 -0
  64. package/src/dex/balancer-v2/pools/weighted/WeightedMath.ts +84 -0
  65. package/src/dex/balancer-v2/pools/weighted/WeightedPool.ts +189 -0
  66. package/src/dex/balancer-v2/types.ts +1 -0
  67. package/src/dex/index.ts +2 -0
  68. package/src/dex/trader-joe-v2.1.ts +155 -0
  69. package/tests/constants-e2e.ts +9 -4
  70. package/build/abi/DirectSwap.json +0 -970
  71. package/build/dex/test-dex/config.d.ts +0 -4
  72. package/build/dex/test-dex/config.js +0 -15
  73. package/build/dex/test-dex/config.js.map +0 -1
  74. package/build/dex/test-dex/test-dex-pool.d.ts +0 -39
  75. package/build/dex/test-dex/test-dex-pool.js +0 -63
  76. package/build/dex/test-dex/test-dex-pool.js.map +0 -1
  77. package/build/dex/test-dex/test-dex.d.ts +0 -37
  78. package/build/dex/test-dex/test-dex.js +0 -126
  79. package/build/dex/test-dex/test-dex.js.map +0 -1
  80. package/build/dex/test-dex/types.d.ts +0 -6
  81. package/build/dex/test-dex/types.js +0 -3
  82. package/build/dex/test-dex/types.js.map +0 -1
  83. package/build/dex/woo-fi-v2/woo-fi-math.d.ts +0 -16
  84. package/build/dex/woo-fi-v2/woo-fi-math.js +0 -137
  85. package/build/dex/woo-fi-v2/woo-fi-math.js.map +0 -1
  86. package/src/dex/balancer-v2/balancer-v2-pool.ts +0 -744
@@ -0,0 +1,84 @@
1
+ import { MathSol } from '../../balancer-v2-math';
2
+
3
+ const _require = (b: boolean, message: string) => {
4
+ if (!b) throw new Error(message);
5
+ };
6
+
7
+ export class WeightedMath {
8
+ static _MAX_IN_RATIO = 300000000000000000n;
9
+ static _MAX_OUT_RATIO = 300000000000000000n;
10
+
11
+ static _calcInGivenOut(
12
+ balanceIn: bigint,
13
+ weightIn: bigint,
14
+ balanceOut: bigint,
15
+ weightOut: bigint,
16
+ amountsOut: bigint[],
17
+ ): bigint[] {
18
+ /* https://docs.balancer.fi/reference/math/weighted-math.html#ingivenout */
19
+ /**********************************************************************************************
20
+ // outGivenOut //
21
+ // aI = amountIn //
22
+ // bI = balanceIn //
23
+ // bO = balanceOut / / bO \ (wO / wI) \ //
24
+ // aO = amountOut aI = bI * | | -------------------------- | ^ - 1 | //
25
+ // wI = weightIn \ \ ( bO - aO ) / / //
26
+ // wO = weightOut //
27
+ *********************************************************************************************/
28
+ const exponent = MathSol.divUpFixed(weightOut, weightIn);
29
+ return amountsOut.map(amountOut => {
30
+ _require(
31
+ amountOut <= MathSol.mulDownFixed(balanceOut, this._MAX_OUT_RATIO),
32
+ 'Errors.MAX_OUT_RATIO',
33
+ );
34
+
35
+ const denominator = balanceOut - amountOut;
36
+ const base = MathSol.divUpFixed(balanceOut, denominator);
37
+ const power = MathSol.powUpFixed(base, exponent);
38
+ const ratio = MathSol.sub(power, MathSol.ONE);
39
+
40
+ return MathSol.mulUpFixed(balanceIn, ratio);
41
+ });
42
+ }
43
+
44
+ // Computes how many tokens can be taken out of a pool if `amountIn` are sent, given the
45
+ // current balances and weights.
46
+ static _calcOutGivenIn(
47
+ balanceIn: bigint,
48
+ weightIn: bigint,
49
+ balanceOut: bigint,
50
+ weightOut: bigint,
51
+ amountsIn: bigint[],
52
+ ): bigint[] {
53
+ /* https://docs.balancer.fi/reference/math/weighted-math.html#outgivenin */
54
+ /**********************************************************************************************
55
+ // outGivenIn //
56
+ // aO = amountOut //
57
+ // bO = balanceOut //
58
+ // bI = balanceIn / / bI \ (wI / wO) \ //
59
+ // aI = amountIn aO = bO * | 1 - | -------------------------- | ^ | //
60
+ // wI = weightIn \ \ ( bI + aI ) / / //
61
+ // wO = weightOut //
62
+ **********************************************************************************************/
63
+
64
+ // Amount out, so we round down overall.
65
+
66
+ // The multiplication rounds down, and the subtrahend (power) rounds up (so the base rounds up too).
67
+ // Because bI / (bI + aI) <= 1, the exponent rounds down.
68
+
69
+ // Cannot exceed maximum in ratio
70
+
71
+ const exponent = MathSol.divDownFixed(weightIn, weightOut);
72
+ return amountsIn.map(amountIn => {
73
+ _require(
74
+ amountIn <= MathSol.mulDownFixed(balanceIn, this._MAX_IN_RATIO),
75
+ 'Errors.MAX_IN_RATIO',
76
+ );
77
+ const denominator = balanceIn + amountIn;
78
+ const base = MathSol.divUpFixed(balanceIn, denominator);
79
+ const power = MathSol.powUpFixed(base, exponent);
80
+
81
+ return MathSol.mulDownFixed(balanceOut, MathSol.complementFixed(power));
82
+ });
83
+ }
84
+ }
@@ -0,0 +1,189 @@
1
+ import { Interface } from '@ethersproject/abi';
2
+ import WeightedPoolABI from '../../../../abi/balancer-v2/weighted-pool.json';
3
+ import { callData, PoolState, SubgraphPoolBase, TokenState } from '../../types';
4
+ import { decodeThrowError, getTokenScalingFactor } from '../../utils';
5
+ import { SwapSide } from '../../../../constants';
6
+ import { BaseMinimalSwapInfoPool } from '../balancer-v2-pool';
7
+ import { WeightedMath } from './WeightedMath';
8
+
9
+ export type WeightedPoolPairData = {
10
+ tokenInBalance: bigint;
11
+ tokenOutBalance: bigint;
12
+ tokenInScalingFactor: bigint;
13
+ tokenOutScalingFactor: bigint;
14
+ tokenInWeight: bigint;
15
+ tokenOutWeight: bigint;
16
+ swapFee: bigint;
17
+ };
18
+
19
+
20
+ export class WeightedPool extends BaseMinimalSwapInfoPool {
21
+ vaultAddress: string;
22
+ vaultInterface: Interface;
23
+ poolInterface: Interface;
24
+
25
+ constructor(vaultAddress: string, vaultInterface: Interface) {
26
+ super();
27
+ this.vaultAddress = vaultAddress;
28
+ this.vaultInterface = vaultInterface;
29
+ this.poolInterface = new Interface(WeightedPoolABI);
30
+ }
31
+
32
+ _onSwapGivenOut(
33
+ tokenAmountsOut: bigint[],
34
+ currentBalanceTokenIn: bigint,
35
+ currentBalanceTokenOut: bigint,
36
+ _weightIn: bigint,
37
+ _weightOut: bigint,
38
+ ): bigint[] {
39
+ return WeightedMath._calcInGivenOut(
40
+ currentBalanceTokenIn,
41
+ _weightIn,
42
+ currentBalanceTokenOut,
43
+ _weightOut,
44
+ tokenAmountsOut,
45
+ );
46
+ }
47
+
48
+ _onSwapGivenIn(
49
+ tokenAmountsIn: bigint[],
50
+ currentBalanceTokenIn: bigint,
51
+ currentBalanceTokenOut: bigint,
52
+ _weightIn: bigint,
53
+ _weightOut: bigint,
54
+ ): bigint[] {
55
+ return WeightedMath._calcOutGivenIn(
56
+ currentBalanceTokenIn,
57
+ _weightIn,
58
+ currentBalanceTokenOut,
59
+ _weightOut,
60
+ tokenAmountsIn,
61
+ );
62
+ }
63
+
64
+ /*
65
+ Helper function to parse pool data into params for onSell function.
66
+ */
67
+ parsePoolPairData(
68
+ pool: SubgraphPoolBase,
69
+ poolState: PoolState,
70
+ tokenIn: string,
71
+ tokenOut: string,
72
+ ): WeightedPoolPairData {
73
+ const inAddress = tokenIn.toLowerCase();
74
+ const outAddress = tokenOut.toLowerCase();
75
+
76
+ const tIn = pool.tokens.find(t => t.address.toLowerCase() === inAddress);
77
+ const tOut = pool.tokens.find(t => t.address.toLowerCase() === outAddress);
78
+
79
+ if (!tIn || !tOut) return {} as WeightedPoolPairData;
80
+
81
+ const tokenInBalance = poolState.tokens[inAddress].balance;
82
+ const tokenOutBalance = poolState.tokens[outAddress].balance;
83
+ const tokenInWeight = poolState.tokens[inAddress].weight || 0n;
84
+ const tokenOutWeight = poolState.tokens[outAddress].weight || 0n;
85
+ const tokenInScalingFactor = getTokenScalingFactor(tIn.decimals);
86
+ const tokenOutScalingFactor = getTokenScalingFactor(tOut.decimals);
87
+
88
+ const poolPairData: WeightedPoolPairData = {
89
+ tokenInBalance,
90
+ tokenOutBalance,
91
+ tokenInScalingFactor,
92
+ tokenOutScalingFactor,
93
+ tokenInWeight,
94
+ tokenOutWeight,
95
+ swapFee: poolState.swapFee,
96
+ };
97
+ return poolPairData;
98
+ }
99
+
100
+ /*
101
+ Helper function to construct onchain multicall data for WeightedPool (also 'LiquidityBootstrapping' and 'Investment' pool types).
102
+ */
103
+ getOnChainCalls(pool: SubgraphPoolBase): callData[] {
104
+ return [
105
+ {
106
+ target: this.vaultAddress,
107
+ callData: this.vaultInterface.encodeFunctionData('getPoolTokens', [
108
+ pool.id,
109
+ ]),
110
+ },
111
+ {
112
+ target: pool.address,
113
+ callData: this.poolInterface.encodeFunctionData('getSwapFeePercentage'),
114
+ },
115
+ {
116
+ target: pool.address,
117
+ callData: this.poolInterface.encodeFunctionData('getNormalizedWeights'),
118
+ },
119
+ ];
120
+ }
121
+
122
+ /*
123
+ Helper function to decodes multicall data for a Weighted Pool.
124
+ data must contain returnData
125
+ startIndex is where to start in returnData. Allows this decode function to be called along with other pool types.
126
+ */
127
+ decodeOnChainCalls(
128
+ pool: SubgraphPoolBase,
129
+ data: { success: boolean; returnData: any }[],
130
+ startIndex: number,
131
+ ): [{ [address: string]: PoolState }, number] {
132
+ const pools = {} as { [address: string]: PoolState };
133
+
134
+ const poolTokens = decodeThrowError(
135
+ this.vaultInterface,
136
+ 'getPoolTokens',
137
+ data[startIndex++],
138
+ pool.address,
139
+ );
140
+ const swapFee = decodeThrowError(
141
+ this.poolInterface,
142
+ 'getSwapFeePercentage',
143
+ data[startIndex++],
144
+ pool.address,
145
+ )[0];
146
+ const normalisedWeights = decodeThrowError(
147
+ this.poolInterface,
148
+ 'getNormalizedWeights',
149
+ data[startIndex++],
150
+ pool.address,
151
+ )[0];
152
+
153
+ const poolState: PoolState = {
154
+ swapFee: BigInt(swapFee.toString()),
155
+ tokens: poolTokens.tokens.reduce(
156
+ (ptAcc: { [address: string]: TokenState }, pt: string, j: number) => {
157
+ const tokenState: TokenState = {
158
+ balance: BigInt(poolTokens.balances[j].toString()),
159
+ };
160
+
161
+ if (normalisedWeights)
162
+ tokenState.weight = BigInt(normalisedWeights[j].toString());
163
+
164
+ ptAcc[pt.toLowerCase()] = tokenState;
165
+ return ptAcc;
166
+ },
167
+ {},
168
+ ),
169
+ orderedTokens: poolTokens.tokens,
170
+ };
171
+
172
+ pools[pool.address] = poolState;
173
+
174
+ return [pools, startIndex];
175
+ }
176
+
177
+ /*
178
+ For weighted pools there is a Swap limit of 30%: amounts swapped may not be larger than this percentage of total balance.
179
+ */
180
+ getSwapMaxAmount(poolPairData: WeightedPoolPairData, side: SwapSide): bigint {
181
+ return (
182
+ ((side === SwapSide.SELL
183
+ ? poolPairData.tokenInBalance
184
+ : poolPairData.tokenOutBalance) *
185
+ 3n) /
186
+ 10n
187
+ );
188
+ }
189
+ }
@@ -33,6 +33,7 @@ export type PoolState = {
33
33
  };
34
34
  swapFee: bigint;
35
35
  orderedTokens: string[];
36
+ rate?: bigint;
36
37
  amp?: bigint;
37
38
  // Linear Pools
38
39
  mainIndex?: number;
package/src/dex/index.ts CHANGED
@@ -65,6 +65,7 @@ import { ZyberSwapV3 } from './quickswap/zyberswap-v3';
65
65
  import { TraderJoeV2 } from './trader-joe-v2';
66
66
  import { SpiritSwapV3 } from './quickswap/spiritswap-v3';
67
67
  import { PancakeswapV3 } from './uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3';
68
+ import { TraderJoeV21 } from './trader-joe-v2.1';
68
69
 
69
70
  const LegacyDexes = [
70
71
  CurveV2,
@@ -84,6 +85,7 @@ const LegacyDexes = [
84
85
  ZyberSwapV3,
85
86
  SpiritSwapV3,
86
87
  TraderJoeV2,
88
+ TraderJoeV21,
87
89
  Jarvis,
88
90
  Lido,
89
91
  AugustusRFQOrder,
@@ -0,0 +1,155 @@
1
+ import { Network, SwapSide } from '../constants';
2
+ import { AdapterExchangeParam, Address, SimpleExchangeParam } from '../types';
3
+ import { IDexTxBuilder } from './idex';
4
+ import { IDexHelper } from '../dex-helper';
5
+ import {
6
+ getLocalDeadlineAsFriendlyPlaceholder,
7
+ SimpleExchange,
8
+ } from './simple-exchange';
9
+ import { NumberAsString } from '@paraswap/core';
10
+ import { AsyncOrSync } from 'ts-essentials';
11
+ import { Interface, JsonFragment } from '@ethersproject/abi';
12
+ import TraderJoeV21RouterABI from '../abi/TraderJoeV21Router.json';
13
+
14
+ const TRADERJOE_V2_1_ROUTER_ADDRESS: { [network: number]: Address } = {
15
+ [Network.AVALANCHE]: '0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30',
16
+ [Network.ARBITRUM]: '0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30',
17
+ [Network.BSC]: '0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30',
18
+ };
19
+
20
+ type RouterPath = [
21
+ pairBinSteps: NumberAsString[],
22
+ versions: NumberAsString[],
23
+ tokenPath: Address[],
24
+ ];
25
+ type TraderJoeV2RouterSellParams = [
26
+ _amountIn: NumberAsString,
27
+ _amountOutMin: NumberAsString,
28
+ _routerPath: RouterPath,
29
+ to: Address,
30
+ _deadline: string,
31
+ ];
32
+
33
+ type TraderJoeV2RouterBuyParams = [
34
+ _amountOut: NumberAsString,
35
+ _amountInMax: NumberAsString,
36
+ _routerPath: RouterPath,
37
+ to: Address,
38
+ _deadline: string,
39
+ ];
40
+
41
+ type TraderJoeV2RouterParam =
42
+ | TraderJoeV2RouterSellParams
43
+ | TraderJoeV2RouterBuyParams;
44
+
45
+ export type TraderJoeV2Data = {
46
+ tokenIn: string; // redundant
47
+ tokenOut: string; // redundant
48
+ binStep: string;
49
+ };
50
+
51
+ enum TraderJoeV2RouterFunctions {
52
+ swapExactTokensForTokens = 'swapExactTokensForTokens',
53
+ swapTokensForExactTokens = 'swapTokensForExactTokens',
54
+ }
55
+ export class TraderJoeV21
56
+ extends SimpleExchange
57
+ implements IDexTxBuilder<TraderJoeV2Data, TraderJoeV2RouterParam>
58
+ {
59
+ static dexKeys = ['traderjoev2.1'];
60
+ protected routerAddress: string;
61
+ exchangeRouterInterface: Interface;
62
+ needWrapNative = true;
63
+
64
+ constructor(dexHelper: IDexHelper) {
65
+ super(dexHelper, 'traderjoev2.1');
66
+
67
+ this.routerAddress =
68
+ TRADERJOE_V2_1_ROUTER_ADDRESS[dexHelper.config.data.network];
69
+
70
+ this.exchangeRouterInterface = new Interface(
71
+ TraderJoeV21RouterABI as JsonFragment[],
72
+ );
73
+ }
74
+
75
+ getAdapterParam(
76
+ srcToken: Address,
77
+ destToken: Address,
78
+ srcAmount: NumberAsString,
79
+ destAmount: NumberAsString,
80
+ data: TraderJoeV2Data,
81
+ side: SwapSide,
82
+ ): AdapterExchangeParam {
83
+ let payload = this.abiCoder.encodeParameters(
84
+ ['tuple(tuple(uint256[],uint8[],address[]),uint256)'],
85
+ [
86
+ [
87
+ [
88
+ [
89
+ data.binStep, // _pairBinSteps: uint256[]
90
+ ],
91
+ [
92
+ 2, // _versions: uint8[]
93
+ ],
94
+ [
95
+ data.tokenIn,
96
+ data.tokenOut, // _tokenPath: address[]
97
+ ],
98
+ ],
99
+ getLocalDeadlineAsFriendlyPlaceholder(), // _deadline: uint256
100
+ ],
101
+ ],
102
+ );
103
+
104
+ return {
105
+ targetExchange: this.routerAddress,
106
+ payload,
107
+ networkFee: '0',
108
+ };
109
+ }
110
+
111
+ getSimpleParam(
112
+ srcToken: Address,
113
+ destToken: Address,
114
+ srcAmount: NumberAsString,
115
+ destAmount: NumberAsString,
116
+ data: TraderJoeV2Data,
117
+ side: SwapSide,
118
+ ): AsyncOrSync<SimpleExchangeParam> {
119
+ const swapFunction =
120
+ side === SwapSide.SELL
121
+ ? TraderJoeV2RouterFunctions.swapExactTokensForTokens
122
+ : TraderJoeV2RouterFunctions.swapTokensForExactTokens;
123
+
124
+ const swapFunctionParams: TraderJoeV2RouterParam =
125
+ side === SwapSide.SELL
126
+ ? [
127
+ srcAmount,
128
+ destAmount,
129
+ [[data.binStep], ['2'], [srcToken, destToken]],
130
+ this.augustusAddress,
131
+ getLocalDeadlineAsFriendlyPlaceholder(),
132
+ ]
133
+ : [
134
+ destAmount,
135
+ srcAmount,
136
+ [[data.binStep], ['2'], [srcToken, destToken]],
137
+ this.augustusAddress,
138
+ getLocalDeadlineAsFriendlyPlaceholder(),
139
+ ];
140
+
141
+ const swapData = this.exchangeRouterInterface.encodeFunctionData(
142
+ swapFunction,
143
+ swapFunctionParams,
144
+ );
145
+
146
+ return this.buildSimpleParamWithoutWETHConversion(
147
+ srcToken,
148
+ srcAmount,
149
+ destToken,
150
+ destAmount,
151
+ swapData,
152
+ this.routerAddress,
153
+ );
154
+ }
155
+ }
@@ -67,6 +67,10 @@ export const Tokens: {
67
67
  addBalance: balanceOfFn,
68
68
  addAllowance: allowanceFn,
69
69
  },
70
+ PSP: {
71
+ address: '0xcafe001067cdef266afb7eb5a286dcfd277f3de5',
72
+ decimals: 18,
73
+ },
70
74
  SETH: {
71
75
  address: '0x5e74C9036fb86BD7eCdcb084a0673EFc32eA31cb',
72
76
  decimals: 18,
@@ -812,12 +816,12 @@ export const Holders: {
812
816
  } = {
813
817
  [Network.MAINNET]: {
814
818
  ETH: '0x176F3DAb24a159341c0509bB36B833E7fdd0a132',
815
- USDC: '0xDcEF968d416a41Cdac0ED8702fAC8128A64241A2',
816
- WBTC: '0x6daB3bCbFb336b29d06B9C793AEF7eaA57888922',
819
+ USDC: '0x915dA56c5995EAaf66fd06BA3AeD62a4D3BD011A',
820
+ WBTC: '0x1Cb17a66DC606a52785f69F08F4256526aBd4943',
817
821
  BADGER: '0x34e2741a3f8483dbe5231f61c005110ff4b9f50a',
818
822
  STETH: '0x9bdb521a97e95177bf252c253e256a60c3e14447',
819
823
  wstETH: '0x6cE0F913F035ec6195bC3cE885aec4C66E485BC4',
820
- WETH: '0x56178a0d5f301baf6cf3e1cd53d9863437345bf9',
824
+ WETH: '0x2fEb1512183545f48f6b9C5b4EbfCaF49CfCa6F3',
821
825
  USDT: '0x5754284f345afc66a98fbb0a0afe71e0f007b949',
822
826
  XAUT: '0xc4e161e8d8a4bc4ac762ab33a28bbac5474203d7',
823
827
  CVX: '0x0aCA67Fa70B142A3b9bF2eD89A81B40ff85dACdC',
@@ -864,7 +868,8 @@ export const Holders: {
864
868
  SHIBA: '0x73af3bcf944a6559933396c1577b257e2054d935',
865
869
  aEthUSDC: '0x3178490d60B5cceaA5a79FD4D9050C7405Bab80c',
866
870
  aEthWETH: '0x645C4c0c95C1Aa6EF25d12f4a25038cA9b0C6Cc7',
867
- dUSDC: '0x3C6A135F7A3A7Ce203EF629B43D9dc66f0f98BFa',
871
+ dUSDC: '0x2FC2F705110A7F46Ce85F701d7217EF1018f01A3',
872
+ PSP: '0xE5E5440a1CE69C5cf67BFFA74d185e57c31b43E5',
868
873
  },
869
874
  [Network.ROPSTEN]: {
870
875
  ETH: '0x43262A12d8610AA70C15DbaeAC321d51613c9071',