@paraswap/dex-lib 4.3.5-algebra-integral-ring-v2.0 → 4.3.5

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 (43) hide show
  1. package/build/dex/index.js +0 -4
  2. package/build/dex/index.js.map +1 -1
  3. package/build/dex/miro-migrator/constants.d.ts +1 -1
  4. package/build/dex/miro-migrator/constants.js +1 -1
  5. package/build/dex/miro-migrator/miro-migrator-pool.d.ts +5 -5
  6. package/build/dex/miro-migrator/miro-migrator-pool.js +22 -13
  7. package/build/dex/miro-migrator/miro-migrator-pool.js.map +1 -1
  8. package/build/dex/miro-migrator/miro-migrator.js +2 -4
  9. package/build/dex/miro-migrator/miro-migrator.js.map +1 -1
  10. package/build/dex/uniswap-v2/uniswap-v2.d.ts +1 -1
  11. package/build/dex/uniswap-v2/uniswap-v2.js.map +1 -1
  12. package/build/dex/uniswap-v3/contract-math/uniswap-v3-math.d.ts +1 -1
  13. package/build/dex/uniswap-v3/contract-math/uniswap-v3-math.js +3 -5
  14. package/build/dex/uniswap-v3/contract-math/uniswap-v3-math.js.map +1 -1
  15. package/build/dex/uniswap-v3/uniswap-v3.d.ts +1 -1
  16. package/build/dex/uniswap-v3/uniswap-v3.js +4 -25
  17. package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
  18. package/package.json +1 -1
  19. package/build/abi/algebra-integral/AlgebraFactory.abi.json +0 -947
  20. package/build/abi/algebra-integral/Quoter.abi.json +0 -231
  21. package/build/abi/algebra-integral/SwapRouter.abi.json +0 -810
  22. package/build/abi/ring-v2/few-wrapped-token.json +0 -587
  23. package/build/abi/ring-v2/ring-v2-factory.json +0 -125
  24. package/build/abi/ring-v2/ring-v2-pool.json +0 -461
  25. package/build/abi/ring-v2/ring-v2-router.json +0 -332
  26. package/build/dex/algebra-integral/algebra-integral-factory.d.ts +0 -29
  27. package/build/dex/algebra-integral/algebra-integral-factory.js +0 -159
  28. package/build/dex/algebra-integral/algebra-integral-factory.js.map +0 -1
  29. package/build/dex/algebra-integral/algebra-integral.d.ts +0 -43
  30. package/build/dex/algebra-integral/algebra-integral.js +0 -425
  31. package/build/dex/algebra-integral/algebra-integral.js.map +0 -1
  32. package/build/dex/algebra-integral/config.d.ts +0 -3
  33. package/build/dex/algebra-integral/config.js +0 -17
  34. package/build/dex/algebra-integral/config.js.map +0 -1
  35. package/build/dex/algebra-integral/types.d.ts +0 -35
  36. package/build/dex/algebra-integral/types.js +0 -10
  37. package/build/dex/algebra-integral/types.js.map +0 -1
  38. package/build/dex/miro-migrator/miro-migrator-state.d.ts +0 -27
  39. package/build/dex/miro-migrator/miro-migrator-state.js +0 -89
  40. package/build/dex/miro-migrator/miro-migrator-state.js.map +0 -1
  41. package/build/dex/uniswap-v2/ring-v2.d.ts +0 -35
  42. package/build/dex/uniswap-v2/ring-v2.js +0 -240
  43. package/build/dex/uniswap-v2/ring-v2.js.map +0 -1
@@ -1,35 +0,0 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { Network, SwapSide } from '../../constants';
3
- import { IDexHelper } from '../../dex-helper';
4
- import { Token, TransferFeeParams, ExchangePrices, Address, DexExchangeParam, NumberAsString } from '../../types';
5
- import { UniswapData, UniswapV2Data } from './types';
6
- import { UniswapV2 } from './uniswap-v2';
7
- export declare enum RingV2Functions {
8
- swapExactTokensForTokens = "swapExactTokensForTokens",
9
- swapExactETHForTokens = "swapExactETHForTokens",
10
- swapTokensForExactTokens = "swapTokensForExactTokens",
11
- swapTokensForExactETH = "swapTokensForExactETH",
12
- swapETHForExactTokens = "swapETHForExactTokens"
13
- }
14
- export declare function computeFWTokenAddress(originalAddress: string, dexKey: string, network: Network): string;
15
- export declare class RingV2 extends UniswapV2 {
16
- protected network: Network;
17
- protected dexHelper: IDexHelper;
18
- protected isDynamicFees: boolean;
19
- protected factoryAddress: Address;
20
- protected subgraphURL: string | undefined;
21
- protected initCode: string;
22
- protected feeCode: number;
23
- protected poolGasCost: number;
24
- protected decoderIface: Interface;
25
- protected router: string;
26
- static dexKeysWithNetwork: {
27
- key: string;
28
- networks: Network[];
29
- }[];
30
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper, isDynamicFees?: boolean, factoryAddress?: Address, subgraphURL?: string | undefined, initCode?: string, feeCode?: number, poolGasCost?: number, decoderIface?: Interface, router?: string);
31
- getTokenAddresses<T extends string | Token>(_from: T, _to: T): [T, T];
32
- getPoolIdentifiers(_from: Token, _to: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
33
- getPricesVolume(_from: Token, _to: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[], transferFees?: TransferFeeParams): Promise<ExchangePrices<UniswapV2Data> | null>;
34
- getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: UniswapData, side: SwapSide): DexExchangeParam;
35
- }
@@ -1,240 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.RingV2 = exports.RingV2Functions = void 0;
7
- exports.computeFWTokenAddress = computeFWTokenAddress;
8
- const abi_1 = require("@ethersproject/abi");
9
- const address_1 = require("@ethersproject/address");
10
- const keccak256_1 = require("@ethersproject/keccak256");
11
- const constants_1 = require("../../constants");
12
- const types_1 = require("../../executor/types");
13
- const token_transfer_fee_1 = require("../../lib/token-transfer-fee");
14
- const utils_1 = require("../../utils");
15
- const uniswap_v2_1 = require("./uniswap-v2");
16
- const ring_v2_pool_json_1 = __importDefault(require("../../abi/ring-v2/ring-v2-pool.json"));
17
- const ring_v2_factory_json_1 = __importDefault(require("../../abi/ring-v2/ring-v2-factory.json"));
18
- const ring_v2_router_json_1 = __importDefault(require("../../abi/ring-v2/ring-v2-router.json"));
19
- const few_wrapped_token_json_1 = __importDefault(require("../../abi/ring-v2/few-wrapped-token.json"));
20
- var RingV2Functions;
21
- (function (RingV2Functions) {
22
- RingV2Functions["swapExactTokensForTokens"] = "swapExactTokensForTokens";
23
- RingV2Functions["swapExactETHForTokens"] = "swapExactETHForTokens";
24
- RingV2Functions["swapTokensForExactTokens"] = "swapTokensForExactTokens";
25
- RingV2Functions["swapTokensForExactETH"] = "swapTokensForExactETH";
26
- RingV2Functions["swapETHForExactTokens"] = "swapETHForExactTokens";
27
- })(RingV2Functions || (exports.RingV2Functions = RingV2Functions = {}));
28
- const RingV2Config = {
29
- RingV2: {
30
- [constants_1.Network.MAINNET]: {
31
- subgraphURL: '2f5DMnspUwMx2n3229koTsFrAZRua3YV69pucVzWmQA9',
32
- factoryAddress: '0xeb2A625B704d73e82946D8d026E1F588Eed06416',
33
- initCode: '0xa7ae6a5ec37f0c21bbdac560794258c4089b8ae3ffa6e3909b53c6091764a676',
34
- poolGasCost: 80 * 1000,
35
- feeCode: 30,
36
- router: '0x39d1d8fcC5E6EEAf567Bce4e29B94fec956D3519',
37
- },
38
- },
39
- };
40
- const FewWrappedTokenConfig = {
41
- RingV2: {
42
- [constants_1.Network.MAINNET]: {
43
- fewWrapFactory: '0x7D86394139bf1122E82FDF45Bb4e3b038A4464DD',
44
- bytecode: few_wrapped_token_json_1.default.bytecode,
45
- },
46
- },
47
- };
48
- function computeFWTokenAddress(originalAddress, dexKey, network) {
49
- const constructorArgumentsEncoded = abi_1.defaultAbiCoder.encode(['address'], [originalAddress]);
50
- const create2Inputs = [
51
- '0xff',
52
- FewWrappedTokenConfig[dexKey][network].fewWrapFactory, // factory address
53
- (0, keccak256_1.keccak256)(constructorArgumentsEncoded), // salt
54
- (0, keccak256_1.keccak256)(FewWrappedTokenConfig[dexKey][network].bytecode), // init code
55
- ];
56
- const input = `0x${create2Inputs.map(i => i.slice(2)).join('')}`;
57
- return (0, address_1.getAddress)(`0x${(0, keccak256_1.keccak256)(input).slice(-40)}`);
58
- }
59
- const DefaultRingV2PoolGasCost = 90 * 1000;
60
- const ringV2poolIface = new abi_1.Interface(ring_v2_pool_json_1.default);
61
- class RingV2 extends uniswap_v2_1.UniswapV2 {
62
- network;
63
- dexHelper;
64
- isDynamicFees;
65
- factoryAddress;
66
- subgraphURL;
67
- initCode;
68
- feeCode;
69
- poolGasCost;
70
- decoderIface;
71
- router;
72
- static dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(RingV2Config);
73
- constructor(network, dexKey, dexHelper, isDynamicFees = false, factoryAddress = RingV2Config[dexKey][network]
74
- .factoryAddress, subgraphURL = RingV2Config[dexKey] &&
75
- RingV2Config[dexKey][network].subgraphURL, initCode = RingV2Config[dexKey][network].initCode,
76
- // feeCode is ignored when isDynamicFees is set to true
77
- feeCode = RingV2Config[dexKey][network].feeCode, poolGasCost = (RingV2Config[dexKey] &&
78
- RingV2Config[dexKey][network].poolGasCost) ??
79
- DefaultRingV2PoolGasCost, decoderIface = ringV2poolIface, router = (RingV2Config[dexKey] &&
80
- RingV2Config[dexKey][network].router) ??
81
- dexHelper.config.data.uniswapV2ExchangeRouterAddress) {
82
- super(network, dexKey, dexHelper, isDynamicFees, factoryAddress, subgraphURL, initCode, feeCode, poolGasCost, decoderIface, undefined, // adapters being the same as UniswapV2
83
- router);
84
- this.network = network;
85
- this.dexHelper = dexHelper;
86
- this.isDynamicFees = isDynamicFees;
87
- this.factoryAddress = factoryAddress;
88
- this.subgraphURL = subgraphURL;
89
- this.initCode = initCode;
90
- this.feeCode = feeCode;
91
- this.poolGasCost = poolGasCost;
92
- this.decoderIface = decoderIface;
93
- this.router = router;
94
- this.factory = new dexHelper.web3Provider.eth.Contract(ring_v2_factory_json_1.default, this.factoryAddress);
95
- this.exchangeRouterInterface = new abi_1.Interface(ring_v2_router_json_1.default);
96
- }
97
- getTokenAddresses(_from, _to) {
98
- const from = typeof _from === 'string'
99
- ? this.dexHelper.config.wrapETH(_from)
100
- : this.dexHelper.config.wrapETH(_from);
101
- const to = typeof _to === 'string'
102
- ? this.dexHelper.config.wrapETH(_to)
103
- : this.dexHelper.config.wrapETH(_to);
104
- const getFewWrappedToken = (token) => {
105
- const address = typeof token === 'string' ? token : token.address;
106
- const fewTokenAddress = computeFWTokenAddress(address, this.dexKey, this.network);
107
- const newToken = typeof token === 'string'
108
- ? fewTokenAddress
109
- : {
110
- ...token,
111
- address: fewTokenAddress,
112
- ...(token.symbol ? { symbol: `fw${token.symbol}` } : {}),
113
- };
114
- return newToken;
115
- };
116
- return [getFewWrappedToken(from), getFewWrappedToken(to)];
117
- }
118
- async getPoolIdentifiers(_from, _to, side, blockNumber) {
119
- const [from, to] = this.getTokenAddresses(_from, _to);
120
- if (from.address.toLowerCase() === to.address.toLowerCase()) {
121
- return [];
122
- }
123
- return [this.getPoolIdentifier(from.address, to.address)];
124
- }
125
- async getPricesVolume(_from, _to, amounts, side, blockNumber,
126
- // list of pool identifiers to use for pricing, if undefined use all pools
127
- limitPools, transferFees = {
128
- srcFee: 0,
129
- destFee: 0,
130
- srcDexFee: 0,
131
- destDexFee: 0,
132
- }) {
133
- try {
134
- const [from, to] = this.getTokenAddresses(_from, _to);
135
- if (from.address.toLowerCase() === to.address.toLowerCase()) {
136
- return null;
137
- }
138
- const poolIdentifier = this.getPoolIdentifier(from.address, to.address);
139
- if (limitPools && limitPools.every(p => p !== poolIdentifier)) {
140
- this.logger.debug('Pool not in limitPools');
141
- return null;
142
- }
143
- await this.batchCatchUpPairs([[from, to]], blockNumber);
144
- const isSell = side === constants_1.SwapSide.SELL;
145
- const pairParam = await this.getPairOrderedParams(from, to, blockNumber, transferFees.srcDexFee);
146
- if (!pairParam) {
147
- this.logger.debug('No pair parameters found');
148
- return null;
149
- }
150
- const unitAmount = (0, utils_1.getBigIntPow)(isSell ? from.decimals : to.decimals);
151
- const [unitVolumeWithFee, ...amountsWithFee] = (0, token_transfer_fee_1.applyTransferFee)([unitAmount, ...amounts], side, isSell ? transferFees.srcFee : transferFees.destFee, isSell ? constants_1.SRC_TOKEN_PARASWAP_TRANSFERS : constants_1.DEST_TOKEN_PARASWAP_TRANSFERS);
152
- this.logger.debug('Unit Volume With Fee:', unitVolumeWithFee, 'isSell=', isSell);
153
- const unit = isSell
154
- ? await this.getSellPricePath(unitVolumeWithFee, [pairParam])
155
- : await this.getBuyPricePath(unitVolumeWithFee, [pairParam]);
156
- const prices = isSell
157
- ? await Promise.all(amountsWithFee.map(amount => this.getSellPricePath(amount, [pairParam])))
158
- : await Promise.all(amountsWithFee.map(amount => this.getBuyPricePath(amount, [pairParam])));
159
- const [unitOutWithFee, ...outputsWithFee] = (0, token_transfer_fee_1.applyTransferFee)([unit, ...prices], side,
160
- // This part is confusing, because we treat differently SELL and BUY fees
161
- // If Buy, we should apply transfer fee on srcToken on top of dexFee applied earlier
162
- // But for Sell we should apply only one dexFee
163
- isSell ? transferFees.destDexFee : transferFees.srcFee, isSell ? this.DEST_TOKEN_DEX_TRANSFERS : constants_1.SRC_TOKEN_PARASWAP_TRANSFERS);
164
- // As ringv2 just has one pool per token pair
165
- return [
166
- {
167
- prices: outputsWithFee,
168
- unit: unitOutWithFee,
169
- data: {
170
- router: this.router,
171
- path: [from.address.toLowerCase(), to.address.toLowerCase()],
172
- factory: this.factoryAddress,
173
- initCode: this.initCode,
174
- feeFactor: this.feeFactor,
175
- pools: [
176
- {
177
- address: pairParam.exchange,
178
- fee: parseInt(pairParam.fee),
179
- direction: pairParam.direction,
180
- },
181
- ],
182
- },
183
- exchange: this.dexKey,
184
- poolIdentifier,
185
- gasCost: this.poolGasCost,
186
- poolAddresses: [pairParam.exchange],
187
- },
188
- ];
189
- }
190
- catch (e) {
191
- this.logger.debug('Error in getPricesVolume');
192
- if (blockNumber === 0)
193
- this.logger.error(`Error_getPricesVolume: Aurelius block manager not yet instantiated`);
194
- this.logger.error(`Error_getPrices:`, e);
195
- return null;
196
- }
197
- }
198
- getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
199
- let exchangeData;
200
- let specialDexFlag;
201
- let transferSrcTokenBeforeSwap;
202
- let targetExchange;
203
- let dexFuncHasRecipient;
204
- let ttl = 1200;
205
- const deadline = `0x${(Math.floor(new Date().getTime() / 1000) + ttl).toString(16)}`;
206
- const [from, to] = this.getTokenAddresses(srcToken, destToken);
207
- let path = [from.toLowerCase(), to.toLowerCase()];
208
- if ((0, utils_1.isETHAddress)(srcToken)) {
209
- if (side == constants_1.SwapSide.SELL) {
210
- exchangeData = this.exchangeRouterInterface.encodeFunctionData(RingV2Functions.swapExactETHForTokens, [destAmount, path, recipient, deadline]);
211
- }
212
- else {
213
- exchangeData = this.exchangeRouterInterface.encodeFunctionData(RingV2Functions.swapETHForExactTokens, [srcAmount, path, recipient, deadline]);
214
- }
215
- }
216
- else {
217
- if (side == constants_1.SwapSide.SELL) {
218
- exchangeData = this.exchangeRouterInterface.encodeFunctionData(RingV2Functions.swapExactTokensForTokens, [srcAmount, destAmount, path, recipient, deadline]);
219
- }
220
- else {
221
- exchangeData = this.exchangeRouterInterface.encodeFunctionData(RingV2Functions.swapTokensForExactTokens, [destAmount, srcAmount, path, recipient, deadline]);
222
- }
223
- }
224
- specialDexFlag = types_1.SpecialDex.DEFAULT;
225
- targetExchange = data.router;
226
- dexFuncHasRecipient = true;
227
- return {
228
- needWrapNative: this.needWrapNative,
229
- specialDexSupportsInsertFromAmount: true,
230
- dexFuncHasRecipient,
231
- exchangeData,
232
- targetExchange,
233
- specialDexFlag,
234
- transferSrcTokenBeforeSwap,
235
- returnAmountPos: undefined,
236
- };
237
- }
238
- }
239
- exports.RingV2 = RingV2;
240
- //# sourceMappingURL=ring-v2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ring-v2.js","sourceRoot":"","sources":["../../../src/dex/uniswap-v2/ring-v2.ts"],"names":[],"mappings":";;;;;;AA+DA,sDAmBC;AAlFD,4CAAgE;AAChE,oDAAoD;AACpD,wDAAqD;AACrD,+CAKyB;AAEzB,gDAAkD;AAClD,qEAAgE;AAUhE,uCAAgF;AAEhF,6CAAyC;AACzC,4FAA4D;AAC5D,kGAAsE;AACtE,gGAA4E;AAC5E,sGAA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