@paraswap/dex-lib 3.8.18 → 3.8.20-lite-psm

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 (171) hide show
  1. package/build/abi/inception/inception-ineth-pool.json +1062 -0
  2. package/build/abi/inception/inception-ineth.json +609 -0
  3. package/build/abi/inception/inception-ratio-feed.json +93 -0
  4. package/build/abi/inception/inception-vault.json +991 -0
  5. package/build/abi/infusion/InfusionFactory.json +147 -0
  6. package/build/abi/infusion/InfusionPair.json +658 -0
  7. package/build/abi/infusion/InfusionRouter.json +442 -0
  8. package/build/abi/lite-psm/psm.json +468 -0
  9. package/build/abi/oswap/oswap.abi.json +452 -0
  10. package/build/dex/aave-v1/aave-v1.js +0 -1
  11. package/build/dex/aave-v1/aave-v1.js.map +1 -1
  12. package/build/dex/idle-dao/idle-dao-pool.d.ts +56 -0
  13. package/build/dex/idle-dao/idle-dao-pool.js +176 -0
  14. package/build/dex/idle-dao/idle-dao-pool.js.map +1 -0
  15. package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +16 -0
  16. package/build/dex/idle-dao/idle-dao-pooling-pool.js +57 -0
  17. package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +1 -0
  18. package/build/dex/idle-dao/scripts.d.ts +9 -0
  19. package/build/dex/idle-dao/scripts.js +552 -0
  20. package/build/dex/idle-dao/scripts.js.map +1 -0
  21. package/build/dex/inception/config.d.ts +5 -0
  22. package/build/dex/inception/config.js +112 -0
  23. package/build/dex/inception/config.js.map +1 -0
  24. package/build/dex/inception/inception-event-pool.d.ts +23 -0
  25. package/build/dex/inception/inception-event-pool.js +34 -0
  26. package/build/dex/inception/inception-event-pool.js.map +1 -0
  27. package/build/dex/inception/inception-native.d.ts +43 -0
  28. package/build/dex/inception/inception-native.js +131 -0
  29. package/build/dex/inception/inception-native.js.map +1 -0
  30. package/build/dex/inception/inception-pool.d.ts +18 -0
  31. package/build/dex/inception/inception-pool.js +32 -0
  32. package/build/dex/inception/inception-pool.js.map +1 -0
  33. package/build/dex/inception/inception-price-feed.d.ts +19 -0
  34. package/build/dex/inception/inception-price-feed.js +51 -0
  35. package/build/dex/inception/inception-price-feed.js.map +1 -0
  36. package/build/dex/inception/inception.d.ts +44 -0
  37. package/build/dex/inception/inception.js +162 -0
  38. package/build/dex/inception/inception.js.map +1 -0
  39. package/build/dex/inception/tokens.d.ts +9 -0
  40. package/build/dex/inception/tokens.js +28 -0
  41. package/build/dex/inception/tokens.js.map +1 -0
  42. package/build/dex/inception/types.d.ts +22 -0
  43. package/build/dex/inception/types.js +3 -0
  44. package/build/dex/inception/types.js.map +1 -0
  45. package/build/dex/inception/utils.d.ts +7 -0
  46. package/build/dex/inception/utils.js +58 -0
  47. package/build/dex/inception/utils.js.map +1 -0
  48. package/build/dex/index.js +4 -0
  49. package/build/dex/index.js.map +1 -1
  50. package/build/dex/infusion/config.d.ts +4 -0
  51. package/build/dex/infusion/config.js +25 -0
  52. package/build/dex/infusion/config.js.map +1 -0
  53. package/build/dex/infusion/infusion-stable-pool.d.ts +4 -0
  54. package/build/dex/infusion/infusion-stable-pool.js +74 -0
  55. package/build/dex/infusion/infusion-stable-pool.js.map +1 -0
  56. package/build/dex/infusion/infusion.d.ts +54 -0
  57. package/build/dex/infusion/infusion.js +510 -0
  58. package/build/dex/infusion/infusion.js.map +1 -0
  59. package/build/dex/infusion/types.d.ts +47 -0
  60. package/build/dex/infusion/types.js +3 -0
  61. package/build/dex/infusion/types.js.map +1 -0
  62. package/build/dex/infusion/utils/isStablePair.d.ts +2 -0
  63. package/build/dex/infusion/utils/isStablePair.js +18 -0
  64. package/build/dex/infusion/utils/isStablePair.js.map +1 -0
  65. package/build/dex/lite-psm/config.d.ts +3 -0
  66. package/build/dex/lite-psm/config.js +29 -0
  67. package/build/dex/lite-psm/config.js.map +1 -0
  68. package/build/dex/lite-psm/lite-psm-event-pool.d.ts +29 -0
  69. package/build/dex/lite-psm/lite-psm-event-pool.js +158 -0
  70. package/build/dex/lite-psm/lite-psm-event-pool.js.map +1 -0
  71. package/build/dex/lite-psm/lite-psm.d.ts +53 -0
  72. package/build/dex/lite-psm/lite-psm.js +365 -0
  73. package/build/dex/lite-psm/lite-psm.js.map +1 -0
  74. package/build/dex/lite-psm/types.d.ts +40 -0
  75. package/build/dex/lite-psm/types.js +3 -0
  76. package/build/dex/lite-psm/types.js.map +1 -0
  77. package/build/dex/maker-psm/maker-psm.js +3 -2
  78. package/build/dex/maker-psm/maker-psm.js.map +1 -1
  79. package/build/dex/oswap/config.d.ts +5 -0
  80. package/build/dex/oswap/config.js +31 -0
  81. package/build/dex/oswap/config.js.map +1 -0
  82. package/build/dex/oswap/oswap-pool.d.ts +51 -0
  83. package/build/dex/oswap/oswap-pool.js +150 -0
  84. package/build/dex/oswap/oswap-pool.js.map +1 -0
  85. package/build/dex/oswap/oswap.d.ts +46 -0
  86. package/build/dex/oswap/oswap.js +273 -0
  87. package/build/dex/oswap/oswap.js.map +1 -0
  88. package/build/dex/oswap/types.d.ts +20 -0
  89. package/build/dex/oswap/types.js +3 -0
  90. package/build/dex/oswap/types.js.map +1 -0
  91. package/build/dex/platypus/platypus.js +3 -17
  92. package/build/dex/platypus/platypus.js.map +1 -1
  93. package/build/dex/swaap-v1/swaap-v1.js +0 -4
  94. package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
  95. package/build/dex/trader-joe-v2.1/config.d.ts +3 -0
  96. package/build/dex/trader-joe-v2.1/config.js +5 -1
  97. package/build/dex/trader-joe-v2.1/config.js.map +1 -1
  98. package/build/dex/trader-joe-v2.1/trader-joe-v2.1.d.ts +2 -14
  99. package/build/dex/trader-joe-v2.1/trader-joe-v2.1.js +3 -85
  100. package/build/dex/trader-joe-v2.1/trader-joe-v2.1.js.map +1 -1
  101. package/package.json +1 -1
  102. package/src/abi/lite-psm/psm.json +468 -0
  103. package/src/dex/index.ts +4 -0
  104. package/src/dex/lite-psm/config.ts +29 -0
  105. package/src/dex/lite-psm/lite-psm-e2e.test.ts +79 -0
  106. package/src/dex/lite-psm/lite-psm-event-pool.ts +213 -0
  107. package/src/dex/lite-psm/lite-psm-events.test.ts +61 -0
  108. package/src/dex/lite-psm/lite-psm-integration.test.ts +96 -0
  109. package/src/dex/lite-psm/lite-psm.ts +578 -0
  110. package/src/dex/lite-psm/types.ts +46 -0
  111. package/src/dex/maker-psm/maker-psm.ts +3 -2
  112. package/src/dex/trader-joe-v2.1/base.ts +178 -0
  113. package/src/dex/trader-joe-v2.1/config.ts +5 -0
  114. package/src/dex/trader-joe-v2.1/trader-joe-v2.1.ts +8 -165
  115. package/src/dex/trader-joe-v2.1/trader-joe-v2.2.ts +23 -0
  116. package/.vscode/launch.json +0 -53
  117. package/.vscode/settings.json +0 -2
  118. package/.vscode/tasks.json +0 -15
  119. package/build/abi/maverick-v2/MaverickV2Router.json +0 -778
  120. package/build/abi/uniswap-v3/AlienBaseV3Router.abi.json +0 -52
  121. package/build/abi/wombat/pool.json +0 -1289
  122. package/build/dex/aave-v2/tokens-avalanche.json +0 -44
  123. package/build/dex/aave-v2/tokens-mainnet.json +0 -188
  124. package/build/dex/aave-v2/tokens-polygon.json +0 -44
  125. package/build/dex/bProtocol.d.ts +0 -18
  126. package/build/dex/bProtocol.js +0 -39
  127. package/build/dex/bProtocol.js.map +0 -1
  128. package/build/dex/bancor.d.ts +0 -26
  129. package/build/dex/bancor.js +0 -58
  130. package/build/dex/bancor.js.map +0 -1
  131. package/build/dex/compound.d.ts +0 -18
  132. package/build/dex/compound.js +0 -46
  133. package/build/dex/compound.js.map +0 -1
  134. package/build/dex/curve-v2.d.ts +0 -58
  135. package/build/dex/curve-v2.js +0 -180
  136. package/build/dex/curve-v2.js.map +0 -1
  137. package/build/dex/dodo-v1.d.ts +0 -33
  138. package/build/dex/dodo-v1.js +0 -63
  139. package/build/dex/dodo-v1.js.map +0 -1
  140. package/build/dex/lido.d.ts +0 -19
  141. package/build/dex/lido.js +0 -42
  142. package/build/dex/lido.js.map +0 -1
  143. package/build/dex/maker-psm/scripts/gem.abi.json +0 -136
  144. package/build/dex/maker-psm/scripts/validate-state.d.ts +0 -0
  145. package/build/dex/maker-psm/scripts/validate-state.js +0 -185
  146. package/build/dex/maker-psm/scripts/validate-state.js.map +0 -1
  147. package/build/dex/maker-psm/scripts/vat.abi.json +0 -243
  148. package/build/dex/onebit.d.ts +0 -25
  149. package/build/dex/onebit.js +0 -42
  150. package/build/dex/onebit.js.map +0 -1
  151. package/build/dex/smoothy.d.ts +0 -26
  152. package/build/dex/smoothy.js +0 -48
  153. package/build/dex/smoothy.js.map +0 -1
  154. package/build/dex/solidly-v3/scripts/check-event-pool-event.d.ts +0 -1
  155. package/build/dex/solidly-v3/scripts/check-event-pool-event.js +0 -53
  156. package/build/dex/solidly-v3/scripts/check-event-pool-event.js.map +0 -1
  157. package/build/dex/stable-pool.d.ts +0 -28
  158. package/build/dex/stable-pool.js +0 -55
  159. package/build/dex/stable-pool.js.map +0 -1
  160. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +0 -7
  161. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +0 -20
  162. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +0 -1
  163. package/build/dex/trader-joe-v2.1.d.ts +0 -43
  164. package/build/dex/trader-joe-v2.1.js +0 -79
  165. package/build/dex/trader-joe-v2.1.js.map +0 -1
  166. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.d.ts +0 -17
  167. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js +0 -64
  168. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js.map +0 -1
  169. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.d.ts +0 -17
  170. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js +0 -79
  171. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js.map +0 -1
@@ -4,98 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.TraderJoeV21 = void 0;
7
- const constants_1 = require("../../constants");
8
- const simple_exchange_1 = require("../simple-exchange");
9
7
  const abi_1 = require("@ethersproject/abi");
10
8
  const TraderJoeV21Router_json_1 = __importDefault(require("../../abi/TraderJoeV21Router.json"));
11
- const types_1 = require("./types");
12
9
  const config_1 = require("./config");
13
- const utils_1 = require("../../executor/utils");
14
- class TraderJoeV21 extends simple_exchange_1.SimpleExchange {
10
+ const base_1 = require("./base");
11
+ class TraderJoeV21 extends base_1.BaseTraderJoeV2 {
15
12
  constructor(dexHelper) {
16
- super(dexHelper, 'traderjoev2.1');
13
+ super(dexHelper, 'traderjoev2.1', config_1.TRADERJOE_V2_1_ROUTER_ADDRESS[dexHelper.config.data.network], '2');
17
14
  this.needWrapNative = true;
18
- this.routerAddress =
19
- config_1.TRADERJOE_V2_1_ROUTER_ADDRESS[dexHelper.config.data.network];
20
15
  this.exchangeRouterInterface = new abi_1.Interface(TraderJoeV21Router_json_1.default);
21
16
  }
22
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
23
- let payload = this.abiCoder.encodeParameters(['tuple(tuple(uint256[],uint8[],address[]),uint256)'], [
24
- [
25
- [
26
- [
27
- data.binStep, // _pairBinSteps: uint256[]
28
- ],
29
- [
30
- 2, // _versions: uint8[]
31
- ],
32
- [
33
- data.tokenIn,
34
- data.tokenOut, // _tokenPath: address[]
35
- ],
36
- ],
37
- (0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(), // _deadline: uint256
38
- ],
39
- ]);
40
- return {
41
- targetExchange: this.routerAddress,
42
- payload,
43
- networkFee: '0',
44
- };
45
- }
46
- getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
47
- const swapFunction = side === constants_1.SwapSide.SELL
48
- ? types_1.TraderJoeV2RouterFunctions.swapExactTokensForTokens
49
- : types_1.TraderJoeV2RouterFunctions.swapTokensForExactTokens;
50
- const swapFunctionParams = side === constants_1.SwapSide.SELL
51
- ? [
52
- srcAmount,
53
- destAmount,
54
- [[data.binStep], ['2'], [srcToken, destToken]],
55
- this.augustusAddress,
56
- (0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(),
57
- ]
58
- : [
59
- destAmount,
60
- srcAmount,
61
- [[data.binStep], ['2'], [srcToken, destToken]],
62
- this.augustusAddress,
63
- (0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)(),
64
- ];
65
- const swapData = this.exchangeRouterInterface.encodeFunctionData(swapFunction, swapFunctionParams);
66
- return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, this.routerAddress);
67
- }
68
- getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
69
- const swapFunction = side === constants_1.SwapSide.SELL
70
- ? types_1.TraderJoeV2RouterFunctions.swapExactTokensForTokens
71
- : types_1.TraderJoeV2RouterFunctions.swapTokensForExactTokens;
72
- const placeholder = (0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)();
73
- const swapFunctionParams = side === constants_1.SwapSide.SELL
74
- ? [
75
- srcAmount,
76
- destAmount,
77
- [[data.binStep], ['2'], [srcToken, destToken]],
78
- recipient,
79
- placeholder,
80
- ]
81
- : [
82
- destAmount,
83
- srcAmount,
84
- [[data.binStep], ['2'], [srcToken, destToken]],
85
- recipient,
86
- placeholder,
87
- ];
88
- const swapData = this.exchangeRouterInterface.encodeFunctionData(swapFunction, swapFunctionParams);
89
- return {
90
- needWrapNative: this.needWrapNative,
91
- dexFuncHasRecipient: true,
92
- exchangeData: swapData,
93
- targetExchange: this.routerAddress,
94
- returnAmountPos: side === constants_1.SwapSide.SELL
95
- ? (0, utils_1.extractReturnAmountPosition)(this.exchangeRouterInterface, swapFunction, 'amountOut')
96
- : undefined,
97
- };
98
- }
99
17
  }
100
18
  exports.TraderJoeV21 = TraderJoeV21;
101
19
  TraderJoeV21.dexKeys = ['traderjoev2.1'];
@@ -1 +1 @@
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AAC;IACJ,CAAC;;AAfH,oCAgBC;AAfQ,oBAAO,GAAG,CAAC,eAAe,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraswap/dex-lib",
3
- "version": "3.8.18",
3
+ "version": "3.8.20-lite-psm",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "repository": "https://github.com/paraswap/paraswap-dex-lib",
@@ -0,0 +1,468 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ { "internalType": "bytes32", "name": "ilk_", "type": "bytes32" },
5
+ { "internalType": "address", "name": "gem_", "type": "address" },
6
+ { "internalType": "address", "name": "daiJoin_", "type": "address" },
7
+ { "internalType": "address", "name": "pocket_", "type": "address" }
8
+ ],
9
+ "stateMutability": "nonpayable",
10
+ "type": "constructor"
11
+ },
12
+ {
13
+ "anonymous": false,
14
+ "inputs": [
15
+ {
16
+ "indexed": true,
17
+ "internalType": "address",
18
+ "name": "owner",
19
+ "type": "address"
20
+ },
21
+ {
22
+ "indexed": false,
23
+ "internalType": "uint256",
24
+ "name": "value",
25
+ "type": "uint256"
26
+ },
27
+ {
28
+ "indexed": false,
29
+ "internalType": "uint256",
30
+ "name": "fee",
31
+ "type": "uint256"
32
+ }
33
+ ],
34
+ "name": "BuyGem",
35
+ "type": "event"
36
+ },
37
+ {
38
+ "anonymous": false,
39
+ "inputs": [
40
+ {
41
+ "indexed": false,
42
+ "internalType": "uint256",
43
+ "name": "wad",
44
+ "type": "uint256"
45
+ }
46
+ ],
47
+ "name": "Chug",
48
+ "type": "event"
49
+ },
50
+ {
51
+ "anonymous": false,
52
+ "inputs": [
53
+ {
54
+ "indexed": true,
55
+ "internalType": "address",
56
+ "name": "usr",
57
+ "type": "address"
58
+ }
59
+ ],
60
+ "name": "Deny",
61
+ "type": "event"
62
+ },
63
+ {
64
+ "anonymous": false,
65
+ "inputs": [
66
+ {
67
+ "indexed": true,
68
+ "internalType": "address",
69
+ "name": "usr",
70
+ "type": "address"
71
+ }
72
+ ],
73
+ "name": "Diss",
74
+ "type": "event"
75
+ },
76
+ {
77
+ "anonymous": false,
78
+ "inputs": [
79
+ {
80
+ "indexed": true,
81
+ "internalType": "bytes32",
82
+ "name": "what",
83
+ "type": "bytes32"
84
+ },
85
+ {
86
+ "indexed": false,
87
+ "internalType": "address",
88
+ "name": "data",
89
+ "type": "address"
90
+ }
91
+ ],
92
+ "name": "File",
93
+ "type": "event"
94
+ },
95
+ {
96
+ "anonymous": false,
97
+ "inputs": [
98
+ {
99
+ "indexed": true,
100
+ "internalType": "bytes32",
101
+ "name": "what",
102
+ "type": "bytes32"
103
+ },
104
+ {
105
+ "indexed": false,
106
+ "internalType": "uint256",
107
+ "name": "data",
108
+ "type": "uint256"
109
+ }
110
+ ],
111
+ "name": "File",
112
+ "type": "event"
113
+ },
114
+ {
115
+ "anonymous": false,
116
+ "inputs": [
117
+ {
118
+ "indexed": false,
119
+ "internalType": "uint256",
120
+ "name": "wad",
121
+ "type": "uint256"
122
+ }
123
+ ],
124
+ "name": "Fill",
125
+ "type": "event"
126
+ },
127
+ {
128
+ "anonymous": false,
129
+ "inputs": [
130
+ {
131
+ "indexed": true,
132
+ "internalType": "address",
133
+ "name": "usr",
134
+ "type": "address"
135
+ }
136
+ ],
137
+ "name": "Kiss",
138
+ "type": "event"
139
+ },
140
+ {
141
+ "anonymous": false,
142
+ "inputs": [
143
+ {
144
+ "indexed": true,
145
+ "internalType": "address",
146
+ "name": "usr",
147
+ "type": "address"
148
+ }
149
+ ],
150
+ "name": "Rely",
151
+ "type": "event"
152
+ },
153
+ {
154
+ "anonymous": false,
155
+ "inputs": [
156
+ {
157
+ "indexed": true,
158
+ "internalType": "address",
159
+ "name": "owner",
160
+ "type": "address"
161
+ },
162
+ {
163
+ "indexed": false,
164
+ "internalType": "uint256",
165
+ "name": "value",
166
+ "type": "uint256"
167
+ },
168
+ {
169
+ "indexed": false,
170
+ "internalType": "uint256",
171
+ "name": "fee",
172
+ "type": "uint256"
173
+ }
174
+ ],
175
+ "name": "SellGem",
176
+ "type": "event"
177
+ },
178
+ {
179
+ "anonymous": false,
180
+ "inputs": [
181
+ {
182
+ "indexed": false,
183
+ "internalType": "uint256",
184
+ "name": "wad",
185
+ "type": "uint256"
186
+ }
187
+ ],
188
+ "name": "Trim",
189
+ "type": "event"
190
+ },
191
+ {
192
+ "inputs": [],
193
+ "name": "HALTED",
194
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
195
+ "stateMutability": "view",
196
+ "type": "function"
197
+ },
198
+ {
199
+ "inputs": [{ "internalType": "address", "name": "", "type": "address" }],
200
+ "name": "bud",
201
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
202
+ "stateMutability": "view",
203
+ "type": "function"
204
+ },
205
+ {
206
+ "inputs": [],
207
+ "name": "buf",
208
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
209
+ "stateMutability": "view",
210
+ "type": "function"
211
+ },
212
+ {
213
+ "inputs": [
214
+ { "internalType": "address", "name": "usr", "type": "address" },
215
+ { "internalType": "uint256", "name": "gemAmt", "type": "uint256" }
216
+ ],
217
+ "name": "buyGem",
218
+ "outputs": [
219
+ { "internalType": "uint256", "name": "daiInWad", "type": "uint256" }
220
+ ],
221
+ "stateMutability": "nonpayable",
222
+ "type": "function"
223
+ },
224
+ {
225
+ "inputs": [
226
+ { "internalType": "address", "name": "usr", "type": "address" },
227
+ { "internalType": "uint256", "name": "gemAmt", "type": "uint256" }
228
+ ],
229
+ "name": "buyGemNoFee",
230
+ "outputs": [
231
+ { "internalType": "uint256", "name": "daiInWad", "type": "uint256" }
232
+ ],
233
+ "stateMutability": "nonpayable",
234
+ "type": "function"
235
+ },
236
+ {
237
+ "inputs": [],
238
+ "name": "chug",
239
+ "outputs": [
240
+ { "internalType": "uint256", "name": "wad", "type": "uint256" }
241
+ ],
242
+ "stateMutability": "nonpayable",
243
+ "type": "function"
244
+ },
245
+ {
246
+ "inputs": [],
247
+ "name": "cut",
248
+ "outputs": [
249
+ { "internalType": "uint256", "name": "wad", "type": "uint256" }
250
+ ],
251
+ "stateMutability": "view",
252
+ "type": "function"
253
+ },
254
+ {
255
+ "inputs": [],
256
+ "name": "dai",
257
+ "outputs": [
258
+ { "internalType": "contract GemLike", "name": "", "type": "address" }
259
+ ],
260
+ "stateMutability": "view",
261
+ "type": "function"
262
+ },
263
+ {
264
+ "inputs": [],
265
+ "name": "daiJoin",
266
+ "outputs": [
267
+ { "internalType": "contract DaiJoinLike", "name": "", "type": "address" }
268
+ ],
269
+ "stateMutability": "view",
270
+ "type": "function"
271
+ },
272
+ {
273
+ "inputs": [],
274
+ "name": "dec",
275
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
276
+ "stateMutability": "view",
277
+ "type": "function"
278
+ },
279
+ {
280
+ "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
281
+ "name": "deny",
282
+ "outputs": [],
283
+ "stateMutability": "nonpayable",
284
+ "type": "function"
285
+ },
286
+ {
287
+ "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
288
+ "name": "diss",
289
+ "outputs": [],
290
+ "stateMutability": "nonpayable",
291
+ "type": "function"
292
+ },
293
+ {
294
+ "inputs": [
295
+ { "internalType": "bytes32", "name": "what", "type": "bytes32" },
296
+ { "internalType": "uint256", "name": "data", "type": "uint256" }
297
+ ],
298
+ "name": "file",
299
+ "outputs": [],
300
+ "stateMutability": "nonpayable",
301
+ "type": "function"
302
+ },
303
+ {
304
+ "inputs": [
305
+ { "internalType": "bytes32", "name": "what", "type": "bytes32" },
306
+ { "internalType": "address", "name": "data", "type": "address" }
307
+ ],
308
+ "name": "file",
309
+ "outputs": [],
310
+ "stateMutability": "nonpayable",
311
+ "type": "function"
312
+ },
313
+ {
314
+ "inputs": [],
315
+ "name": "fill",
316
+ "outputs": [
317
+ { "internalType": "uint256", "name": "wad", "type": "uint256" }
318
+ ],
319
+ "stateMutability": "nonpayable",
320
+ "type": "function"
321
+ },
322
+ {
323
+ "inputs": [],
324
+ "name": "gem",
325
+ "outputs": [
326
+ { "internalType": "contract GemLike", "name": "", "type": "address" }
327
+ ],
328
+ "stateMutability": "view",
329
+ "type": "function"
330
+ },
331
+ {
332
+ "inputs": [],
333
+ "name": "gemJoin",
334
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
335
+ "stateMutability": "view",
336
+ "type": "function"
337
+ },
338
+ {
339
+ "inputs": [],
340
+ "name": "gush",
341
+ "outputs": [
342
+ { "internalType": "uint256", "name": "wad", "type": "uint256" }
343
+ ],
344
+ "stateMutability": "view",
345
+ "type": "function"
346
+ },
347
+ {
348
+ "inputs": [],
349
+ "name": "ilk",
350
+ "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
351
+ "stateMutability": "view",
352
+ "type": "function"
353
+ },
354
+ {
355
+ "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
356
+ "name": "kiss",
357
+ "outputs": [],
358
+ "stateMutability": "nonpayable",
359
+ "type": "function"
360
+ },
361
+ {
362
+ "inputs": [],
363
+ "name": "live",
364
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
365
+ "stateMutability": "view",
366
+ "type": "function"
367
+ },
368
+ {
369
+ "inputs": [],
370
+ "name": "pocket",
371
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
372
+ "stateMutability": "view",
373
+ "type": "function"
374
+ },
375
+ {
376
+ "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
377
+ "name": "rely",
378
+ "outputs": [],
379
+ "stateMutability": "nonpayable",
380
+ "type": "function"
381
+ },
382
+ {
383
+ "inputs": [],
384
+ "name": "rush",
385
+ "outputs": [
386
+ { "internalType": "uint256", "name": "wad", "type": "uint256" }
387
+ ],
388
+ "stateMutability": "view",
389
+ "type": "function"
390
+ },
391
+ {
392
+ "inputs": [
393
+ { "internalType": "address", "name": "usr", "type": "address" },
394
+ { "internalType": "uint256", "name": "gemAmt", "type": "uint256" }
395
+ ],
396
+ "name": "sellGem",
397
+ "outputs": [
398
+ { "internalType": "uint256", "name": "daiOutWad", "type": "uint256" }
399
+ ],
400
+ "stateMutability": "nonpayable",
401
+ "type": "function"
402
+ },
403
+ {
404
+ "inputs": [
405
+ { "internalType": "address", "name": "usr", "type": "address" },
406
+ { "internalType": "uint256", "name": "gemAmt", "type": "uint256" }
407
+ ],
408
+ "name": "sellGemNoFee",
409
+ "outputs": [
410
+ { "internalType": "uint256", "name": "daiOutWad", "type": "uint256" }
411
+ ],
412
+ "stateMutability": "nonpayable",
413
+ "type": "function"
414
+ },
415
+ {
416
+ "inputs": [],
417
+ "name": "tin",
418
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
419
+ "stateMutability": "view",
420
+ "type": "function"
421
+ },
422
+ {
423
+ "inputs": [],
424
+ "name": "to18ConversionFactor",
425
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
426
+ "stateMutability": "view",
427
+ "type": "function"
428
+ },
429
+ {
430
+ "inputs": [],
431
+ "name": "tout",
432
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
433
+ "stateMutability": "view",
434
+ "type": "function"
435
+ },
436
+ {
437
+ "inputs": [],
438
+ "name": "trim",
439
+ "outputs": [
440
+ { "internalType": "uint256", "name": "wad", "type": "uint256" }
441
+ ],
442
+ "stateMutability": "nonpayable",
443
+ "type": "function"
444
+ },
445
+ {
446
+ "inputs": [],
447
+ "name": "vat",
448
+ "outputs": [
449
+ { "internalType": "contract VatLike", "name": "", "type": "address" }
450
+ ],
451
+ "stateMutability": "view",
452
+ "type": "function"
453
+ },
454
+ {
455
+ "inputs": [],
456
+ "name": "vow",
457
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
458
+ "stateMutability": "view",
459
+ "type": "function"
460
+ },
461
+ {
462
+ "inputs": [{ "internalType": "address", "name": "", "type": "address" }],
463
+ "name": "wards",
464
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
465
+ "stateMutability": "view",
466
+ "type": "function"
467
+ }
468
+ ]
package/src/dex/index.ts CHANGED
@@ -67,6 +67,7 @@ import { QuickSwapV3 } from './quickswap/quickswap-v3';
67
67
  import { ThenaFusion } from './quickswap/thena-fusion';
68
68
  import { SwaapV2 } from './swaap-v2/swaap-v2';
69
69
  import { TraderJoeV21 } from './trader-joe-v2.1/trader-joe-v2.1';
70
+ import { TraderJoeV22 } from './trader-joe-v2.1/trader-joe-v2.2';
70
71
  import { PancakeswapV3 } from './pancakeswap-v3/pancakeswap-v3';
71
72
  import { Algebra } from './algebra/algebra';
72
73
  import { AngleTransmuter } from './angle-transmuter/angle-transmuter';
@@ -83,6 +84,7 @@ import { VelodromeSlipstream } from './uniswap-v3/forks/velodrome-slipstream/vel
83
84
  import { AaveV3Stata } from './aave-v3-stata/aave-v3-stata';
84
85
  import { ConcentratorArusd } from './concentrator-arusd/concentrator-arusd';
85
86
  import { FxProtocolRusd } from './fx-protocol-rusd/fx-protocol-rusd';
87
+ import { LitePsm } from './lite-psm/lite-psm';
86
88
 
87
89
  const LegacyDexes = [
88
90
  CurveV2,
@@ -95,6 +97,7 @@ const LegacyDexes = [
95
97
  QuickSwapV3,
96
98
  ThenaFusion,
97
99
  TraderJoeV21,
100
+ TraderJoeV22,
98
101
  Lido,
99
102
  AugustusRFQOrder,
100
103
  EtherFi,
@@ -161,6 +164,7 @@ const Dexes = [
161
164
  AaveV3Stata,
162
165
  ConcentratorArusd,
163
166
  FxProtocolRusd,
167
+ LitePsm,
164
168
  ];
165
169
 
166
170
  export type LegacyDexConstructor = new (dexHelper: IDexHelper) => IDexTxBuilder<
@@ -0,0 +1,29 @@
1
+ import { DexParams } from './types';
2
+ import { DexConfigMap } from '../../types';
3
+ import { Network } from '../../constants';
4
+
5
+ // Warning: Addresses should be lowercased
6
+ export const LitePsmConfig: DexConfigMap<DexParams> = {
7
+ LitePsm: {
8
+ [Network.MAINNET]: {
9
+ dai: {
10
+ address: '0x6b175474e89094c44da98b954eedeac495271d0f',
11
+ decimals: 18,
12
+ },
13
+ vatAddress: '0x35d1b3f3d7966a1dfe207aa4514c12a259a0492b',
14
+ pools: [
15
+ {
16
+ gem: {
17
+ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
18
+ decimals: 6,
19
+ },
20
+ gemJoinAddress: '0xf6e72db5454dd049d0788e411b06cfaf16853042', // Same as psmAddress. LitePsm does not have an external gem join.
21
+ pocketAddress: '0x37305b1cd40574e4c5ce33f8e8306be057fd7341',
22
+ psmAddress: '0xf6e72db5454dd049d0788e411b06cfaf16853042',
23
+ identifier:
24
+ '0x4c4954452d50534d2d555344432d410000000000000000000000000000000000', // bytes32("LITE-PSM-USDC-A")
25
+ },
26
+ ],
27
+ },
28
+ },
29
+ };