@paraswap/dex-lib 4.2.28-src-token-pos.0 → 4.2.28-src-token-pos.1

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 (28) hide show
  1. package/build/executor/Executor02BytecodeBuilder.js +3 -4
  2. package/build/executor/Executor02BytecodeBuilder.js.map +1 -1
  3. package/package.json +1 -1
  4. package/build/abi/miro-migrator/MiroMigrator.abi.json +0 -540
  5. package/build/dex/miro-migrator/config.d.ts +0 -3
  6. package/build/dex/miro-migrator/config.js +0 -14
  7. package/build/dex/miro-migrator/config.js.map +0 -1
  8. package/build/dex/miro-migrator/constants.d.ts +0 -2
  9. package/build/dex/miro-migrator/constants.js +0 -6
  10. package/build/dex/miro-migrator/constants.js.map +0 -1
  11. package/build/dex/miro-migrator/miro-migrator-pool.d.ts +0 -27
  12. package/build/dex/miro-migrator/miro-migrator-pool.js +0 -89
  13. package/build/dex/miro-migrator/miro-migrator-pool.js.map +0 -1
  14. package/build/dex/miro-migrator/miro-migrator.d.ts +0 -42
  15. package/build/dex/miro-migrator/miro-migrator.js +0 -174
  16. package/build/dex/miro-migrator/miro-migrator.js.map +0 -1
  17. package/build/dex/miro-migrator/types.d.ts +0 -13
  18. package/build/dex/miro-migrator/types.js +0 -8
  19. package/build/dex/miro-migrator/types.js.map +0 -1
  20. package/build/dex/solidly/rpc-pool-tracker.d.ts +0 -26
  21. package/build/dex/solidly/rpc-pool-tracker.js +0 -228
  22. package/build/dex/solidly/rpc-pool-tracker.js.map +0 -1
  23. package/build/dex/uniswap-v2/pancake-swap-v2.d.ts +0 -8
  24. package/build/dex/uniswap-v2/pancake-swap-v2.js +0 -15
  25. package/build/dex/uniswap-v2/pancake-swap-v2.js.map +0 -1
  26. package/build/dex/uniswap-v2/rpc-pool-tracker.d.ts +0 -40
  27. package/build/dex/uniswap-v2/rpc-pool-tracker.js +0 -350
  28. package/build/dex/uniswap-v2/rpc-pool-tracker.js.map +0 -1
@@ -1,89 +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.MiroMigratorEventPool = void 0;
7
- const abi_1 = require("@ethersproject/abi");
8
- const utils_1 = require("../../utils");
9
- const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
10
- const decoders_1 = require("../../lib/decoders");
11
- const MiroMigrator_abi_json_1 = __importDefault(require("../../abi/miro-migrator/MiroMigrator.abi.json"));
12
- const erc20_json_1 = __importDefault(require("../../abi/erc20.json"));
13
- class MiroMigratorEventPool extends stateful_event_subscriber_1.StatefulEventSubscriber {
14
- parentName;
15
- network;
16
- dexHelper;
17
- migratorAddress;
18
- xyzAddress;
19
- transferTopic;
20
- migratorInterface;
21
- xyzInterface;
22
- handlers = {};
23
- logDecoder;
24
- addressesSubscribed;
25
- constructor(parentName, network, dexHelper, logger, migratorAddress, xyzAddress, transferTopic, migratorInterface = new abi_1.Interface(MiroMigrator_abi_json_1.default), xyzInterface = new abi_1.Interface(erc20_json_1.default)) {
26
- super(parentName, 'state', dexHelper, logger);
27
- this.parentName = parentName;
28
- this.network = network;
29
- this.dexHelper = dexHelper;
30
- this.migratorAddress = migratorAddress;
31
- this.xyzAddress = xyzAddress;
32
- this.transferTopic = transferTopic;
33
- this.migratorInterface = migratorInterface;
34
- this.xyzInterface = xyzInterface;
35
- this.logDecoder = (log) => this.xyzInterface.parseLog(log);
36
- this.addressesSubscribed = [xyzAddress];
37
- }
38
- async processLog(state, log) {
39
- try {
40
- const event = this.logDecoder(log);
41
- if (log.topics[0] === this.transferTopic &&
42
- event.args.dst.toLowerCase() === this.migratorAddress.toLowerCase()) {
43
- return this.handleTransferTo(event, state, log);
44
- }
45
- if (log.topics[0] === this.transferTopic &&
46
- event.args.src.toLowerCase() === this.migratorAddress.toLowerCase()) {
47
- return this.handleTransferFrom(event, state, log);
48
- }
49
- return null;
50
- }
51
- catch (e) {
52
- (0, utils_1.catchParseLogError)(e, this.logger);
53
- return null;
54
- }
55
- }
56
- async generateState(blockNumber = 'latest') {
57
- const calls = [
58
- {
59
- target: this.xyzAddress,
60
- callData: this.xyzInterface.encodeFunctionData('balanceOf', [
61
- this.migratorAddress,
62
- ]),
63
- decodeFunction: decoders_1.uint256ToBigInt,
64
- },
65
- ];
66
- const [balance] = await this.dexHelper.multiWrapper.tryAggregate(true, calls, blockNumber);
67
- return { balance: balance.returnData };
68
- }
69
- async getOrGenerateState(blockNumber) {
70
- let state = this.getState(blockNumber);
71
- if (!state) {
72
- state = await this.generateState(blockNumber);
73
- this.setState(state, blockNumber);
74
- }
75
- return state;
76
- }
77
- async handleTransferTo(event, state, log) {
78
- return {
79
- balance: state.balance + BigInt(event.args.wad),
80
- };
81
- }
82
- async handleTransferFrom(event, state, log) {
83
- return {
84
- balance: state.balance - BigInt(event.args.wad),
85
- };
86
- }
87
- }
88
- exports.MiroMigratorEventPool = MiroMigratorEventPool;
89
- //# sourceMappingURL=miro-migrator-pool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"miro-migrator-pool.js","sourceRoot":"","sources":["../../../src/dex/miro-migrator/miro-migrator-pool.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA+C;AAG/C,uCAAiD;AACjD,+EAA0E;AAG1E,iDAAqD;AACrD,0GAA4E;AAC5E,sEAA4C;AAE5C,MAAa,qBAAsB,SAAQ,mDAAkC;IAchE;IACC;IACA;IAEA;IACA;IACA;IACA;IACA;IArBZ,QAAQ,GAMJ,EAAE,CAAC;IAEP,UAAU,CAAoB;IAE9B,mBAAmB,CAAW;IAE9B,YACW,UAAkB,EACjB,OAAe,EACf,SAAqB,EAC/B,MAAc,EACJ,eAAuB,EACvB,UAAkB,EAClB,aAAqB,EACrB,oBAA+B,IAAI,eAAS,CAAC,+BAAe,CAAC,EAC7D,eAA0B,IAAI,eAAS,CAAC,oBAAQ,CAAC;QAE3D,KAAK,CAAC,UAAU,E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C,IAAI,CAAC,GAAG,CAAC;SAChD,CAAC;IACJ,CAAC;CACF;AA3GD,sDA2GC"}
@@ -1,42 +0,0 @@
1
- import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, SimpleExchangeParam, PoolLiquidity, Logger, NumberAsString, DexExchangeParam } from '../../types';
2
- import { SwapSide, Network } from '../../constants';
3
- import { IDex } from '../../dex/idex';
4
- import { IDexHelper } from '../../dex-helper/idex-helper';
5
- import { MiroMigratorData } from './types';
6
- import { SimpleExchange } from '../simple-exchange';
7
- import { Interface } from '@ethersproject/abi';
8
- import { MiroMigratorEventPool } from './miro-migrator-pool';
9
- export declare class MiroMigrator extends SimpleExchange implements IDex<MiroMigratorData> {
10
- readonly network: Network;
11
- readonly dexKey: string;
12
- readonly dexHelper: IDexHelper;
13
- readonly migratorAddress: string;
14
- readonly pspTokenAddress: string;
15
- readonly xyzTokenAddress: string;
16
- protected unitPrice: bigint;
17
- protected migratorInterface: Interface;
18
- readonly hasConstantPriceLargeAmounts = true;
19
- readonly isFeeOnTransferSupported = false;
20
- static dexKeysWithNetwork: {
21
- key: string;
22
- networks: Network[];
23
- }[];
24
- readonly eventPool: MiroMigratorEventPool;
25
- logger: Logger;
26
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper, migratorAddress?: string, pspTokenAddress?: string, xyzTokenAddress?: string, unitPrice?: bigint, migratorInterface?: Interface);
27
- isPSP(tokenAddress: Address): boolean;
28
- isXYZ(tokenAddress: Address): boolean;
29
- isAppropriatePair(srcToken: Token, destToken: Token): boolean;
30
- getAdapters(side: SwapSide): {
31
- name: string;
32
- index: number;
33
- }[] | null;
34
- initializePricing(blockNumber: number): Promise<void>;
35
- getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
36
- getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<MiroMigratorData>>;
37
- getCalldataGasCost(poolPrices: PoolPrices<MiroMigratorData>): number | number[];
38
- getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: MiroMigratorData, side: SwapSide): AdapterExchangeParam;
39
- getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: MiroMigratorData, side: SwapSide): Promise<SimpleExchangeParam>;
40
- getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: MiroMigratorData, side: SwapSide): DexExchangeParam;
41
- getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
42
- }
@@ -1,174 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.MiroMigrator = void 0;
40
- const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
41
- const utils_1 = require("../../utils");
42
- const types_1 = require("./types");
43
- const simple_exchange_1 = require("../simple-exchange");
44
- const config_1 = require("./config");
45
- const bigint_constants_1 = require("../../bigint-constants");
46
- const abi_1 = require("@ethersproject/abi");
47
- const MiroMigrator_abi_json_1 = __importDefault(require("../../abi/miro-migrator/MiroMigrator.abi.json"));
48
- const constants_1 = require("./constants");
49
- const miro_migrator_pool_1 = require("./miro-migrator-pool");
50
- class MiroMigrator extends simple_exchange_1.SimpleExchange {
51
- network;
52
- dexKey;
53
- dexHelper;
54
- migratorAddress;
55
- pspTokenAddress;
56
- xyzTokenAddress;
57
- unitPrice;
58
- migratorInterface;
59
- hasConstantPriceLargeAmounts = true;
60
- isFeeOnTransferSupported = false;
61
- static dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.MiroMigratorConfig);
62
- eventPool;
63
- logger;
64
- constructor(network, dexKey, dexHelper, migratorAddress = config_1.MiroMigratorConfig[dexKey][network]
65
- .migratorAddress, pspTokenAddress = config_1.MiroMigratorConfig[dexKey][network]
66
- .pspTokenAddress, xyzTokenAddress = config_1.MiroMigratorConfig[dexKey][network]
67
- .xyzTokenAddress, unitPrice = bigint_constants_1.BI_POWS[18], migratorInterface = new abi_1.Interface(MiroMigrator_abi_json_1.default)) {
68
- super(dexHelper, dexKey);
69
- this.network = network;
70
- this.dexKey = dexKey;
71
- this.dexHelper = dexHelper;
72
- this.migratorAddress = migratorAddress;
73
- this.pspTokenAddress = pspTokenAddress;
74
- this.xyzTokenAddress = xyzTokenAddress;
75
- this.unitPrice = unitPrice;
76
- this.migratorInterface = migratorInterface;
77
- this.logger = dexHelper.getLogger(dexKey);
78
- this.eventPool = new miro_migrator_pool_1.MiroMigratorEventPool(this.dexKey, this.network, this.dexHelper, this.logger, this.migratorAddress, this.xyzTokenAddress, constants_1.TRANSFER_TOPIC);
79
- }
80
- isPSP(tokenAddress) {
81
- return this.pspTokenAddress.toLowerCase() === tokenAddress.toLowerCase();
82
- }
83
- isXYZ(tokenAddress) {
84
- return this.xyzTokenAddress.toLowerCase() === tokenAddress.toLowerCase();
85
- }
86
- isAppropriatePair(srcToken, destToken) {
87
- return this.isPSP(srcToken.address) && this.isXYZ(destToken.address);
88
- }
89
- getAdapters(side) {
90
- return null;
91
- }
92
- async initializePricing(blockNumber) {
93
- this.eventPool.initialize(blockNumber);
94
- }
95
- async getPoolIdentifiers(srcToken, destToken, side, blockNumber) {
96
- if (this.isAppropriatePair(srcToken, destToken)) {
97
- return [`${this.dexKey}_${srcToken.address}_${destToken.address}`];
98
- }
99
- return [];
100
- }
101
- async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools) {
102
- if (!this.isAppropriatePair(srcToken, destToken)) {
103
- return null;
104
- }
105
- const state = await this.eventPool.getOrGenerateState(blockNumber);
106
- if (!state)
107
- return null;
108
- const prices = [];
109
- for (const amount of amounts) {
110
- if (amount > state.balance) {
111
- prices.push(0n);
112
- }
113
- else {
114
- prices.push(amount);
115
- }
116
- }
117
- return [
118
- {
119
- prices,
120
- unit: this.unitPrice,
121
- gasCost: constants_1.MIRO_MIGRATION_GAS_COST,
122
- exchange: this.dexKey,
123
- poolAddresses: [this.migratorAddress],
124
- data: null,
125
- },
126
- ];
127
- }
128
- getCalldataGasCost(poolPrices) {
129
- return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
130
- }
131
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
132
- return {
133
- targetExchange: this.migratorAddress,
134
- payload: '0x',
135
- networkFee: '0',
136
- };
137
- }
138
- async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
139
- const swapData = this.migratorInterface.encodeFunctionData(types_1.MiroMigratorFunctions.migratePSPtoXYZ, [srcAmount, '0x']);
140
- return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, this.migratorAddress);
141
- }
142
- getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
143
- const swapData = this.migratorInterface.encodeFunctionData(types_1.MiroMigratorFunctions.migratePSPtoXYZ, [srcAmount, '0x']);
144
- return {
145
- needWrapNative: this.needWrapNative,
146
- dexFuncHasRecipient: false,
147
- exchangeData: swapData,
148
- targetExchange: this.migratorAddress,
149
- returnAmountPos: undefined,
150
- };
151
- }
152
- async getTopPoolsForToken(tokenAddress, limit) {
153
- if (!this.isPSP(tokenAddress) && !this.isXYZ(tokenAddress)) {
154
- return [];
155
- }
156
- return [
157
- {
158
- exchange: this.dexKey,
159
- address: this.migratorAddress,
160
- connectorTokens: [
161
- {
162
- address: this.isPSP(tokenAddress)
163
- ? this.xyzTokenAddress
164
- : this.pspTokenAddress,
165
- decimals: 18,
166
- },
167
- ],
168
- liquidityUSD: 1000000000, // Just returning a big number so this DEX will be preferred
169
- },
170
- ];
171
- }
172
- }
173
- exports.MiroMigrator = MiroMigrator;
174
- //# sourceMappingURL=miro-migrator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"miro-migrator.js","sourceRoot":"","sources":["../../../src/dex/miro-migrator/miro-migrator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,2EAA6D;AAC7D,uCAAoD;AAGpD,mCAAkE;AAClE,wDAAoD;AACpD,qCAA8C;AAC9C,6DAAiD;AACjD,4CAA+C;AAC/C,0GAA4E;AAC5E,2CAAsE;AACtE,6DAA6D;AAE7D,MAAa,YACX,SAAQ,gCAAc;IAcX;IACA;IACA;IACA;IAEA;IAEA;IAEC;IACA;IArBH,4BAA4B,GAAG,IAAI,CAAC;IAEpC,wBAAwB,GAAG,KAAK,CAAC;IAEnC,MAAM,CAAC,kBAAkB,GAC9B,IAAA,6BAAqB,EAAC,2BAAkB,CAAC,CAAC;IAC5B,SAAS,CAAwB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;YACtB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,eAAe,EAAE,SAAS;SAC3B,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,mBAAmB,CACvB,YAAqB,EACrB,KAAa;QAEb,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;YAC3D,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO;YACL;gBACE,QAAQ,EAAE,IAAI,CAAC,MAAM;gBACrB,OAAO,EAAE,IAAI,CAAC,eAAe;gBAC7B,eAAe,EAAE;oBACf;wBACE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;4BAC/B,CAAC,CAAC,IAAI,CAAC,eAAe;4BACtB,CAAC,CAAC,IAAI,CAAC,eAAe;wBACxB,QAAQ,EAAE,EAAE;qBACb;iBACF;gBACD,YAAY,EAAE,UAAU,EAAE,4DAA4D;aACvF;SACF,CAAC;IACJ,CAAC;;AAvMH,oCAwMC"}
@@ -1,13 +0,0 @@
1
- import { Address } from '../../types';
2
- export type PoolState = {
3
- balance: bigint;
4
- };
5
- export type MiroMigratorData = null;
6
- export type DexParams = {
7
- migratorAddress: Address;
8
- pspTokenAddress: Address;
9
- xyzTokenAddress: Address;
10
- };
11
- export declare enum MiroMigratorFunctions {
12
- migratePSPtoXYZ = "migratePSPtoXYZ"
13
- }
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MiroMigratorFunctions = void 0;
4
- var MiroMigratorFunctions;
5
- (function (MiroMigratorFunctions) {
6
- MiroMigratorFunctions["migratePSPtoXYZ"] = "migratePSPtoXYZ";
7
- })(MiroMigratorFunctions || (exports.MiroMigratorFunctions = MiroMigratorFunctions = {}));
8
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/miro-migrator/types.ts"],"names":[],"mappings":";;;AAcA,IAAY,qBAEX;AAFD,WAAY,qBAAqB;IAC/B,4DAAmC,CAAA;AACrC,CAAC,EAFW,qBAAqB,qCAArB,qBAAqB,QAEhC"}
@@ -1,26 +0,0 @@
1
- import { Network } from '../../constants';
2
- import { IDexHelper } from '../../dex-helper';
3
- import { MultiCallParams } from '../../lib/multi-wrapper';
4
- import { Address, PoolLiquidity, Token } from '../../types';
5
- import { Solidly } from './solidly';
6
- type Pool = {
7
- address: Address;
8
- token0: Token;
9
- token1: Token;
10
- reserve0: bigint;
11
- reserve1: bigint;
12
- };
13
- export declare class SolidlyRpcPoolTracker extends Solidly {
14
- protected network: Network;
15
- protected dexHelper: IDexHelper;
16
- protected isDynamicFees: boolean;
17
- pools: Pool[];
18
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper, isDynamicFees?: boolean);
19
- protected getAllPoolsCallData(): MultiCallParams<number> | undefined;
20
- protected getPoolCallData(index: number): MultiCallParams<string> | undefined;
21
- getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
22
- updatePools(): Promise<void>;
23
- initPools(fromIndex: number, toIndex: number): Promise<void>;
24
- updatePoolsReserves(pools: string[]): Promise<Pool[]>;
25
- }
26
- export {};
@@ -1,228 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SolidlyRpcPoolTracker = void 0;
4
- const abi_1 = require("@ethersproject/abi");
5
- const decoders_1 = require("../../lib/decoders");
6
- const solidly_1 = require("./solidly");
7
- const SolidlyFactoryABI = [
8
- {
9
- inputs: [],
10
- name: 'reserve0',
11
- outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
12
- stateMutability: 'view',
13
- type: 'function',
14
- },
15
- {
16
- inputs: [],
17
- name: 'reserve1',
18
- outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
19
- stateMutability: 'view',
20
- type: 'function',
21
- },
22
- {
23
- inputs: [],
24
- name: 'token0',
25
- outputs: [{ internalType: 'address', name: '', type: 'address' }],
26
- stateMutability: 'view',
27
- type: 'function',
28
- },
29
- {
30
- inputs: [],
31
- name: 'token1',
32
- outputs: [{ internalType: 'address', name: '', type: 'address' }],
33
- stateMutability: 'view',
34
- type: 'function',
35
- },
36
- {
37
- inputs: [],
38
- name: 'decimals',
39
- outputs: [
40
- {
41
- internalType: 'uint8',
42
- name: '',
43
- type: 'uint8',
44
- },
45
- ],
46
- stateMutability: 'view',
47
- type: 'function',
48
- },
49
- ];
50
- const solidlyFactoryIface = new abi_1.Interface(SolidlyFactoryABI);
51
- class SolidlyRpcPoolTracker extends solidly_1.Solidly {
52
- network;
53
- dexHelper;
54
- isDynamicFees;
55
- pools = [];
56
- constructor(network, dexKey, dexHelper, isDynamicFees = false) {
57
- super(network, dexKey, dexHelper, isDynamicFees);
58
- this.network = network;
59
- this.dexHelper = dexHelper;
60
- this.isDynamicFees = isDynamicFees;
61
- }
62
- // getAllPoolsCallData should be overridden in case RPC pool tracker is used
63
- getAllPoolsCallData() {
64
- return undefined;
65
- }
66
- // getPoolCallData should be overridden in case RPC pool tracker is used
67
- getPoolCallData(index) {
68
- return undefined;
69
- }
70
- async getTopPoolsForToken(tokenAddress, limit) {
71
- await this.updatePools();
72
- const token = tokenAddress.toLowerCase();
73
- let pools = this.pools.filter(pool => pool.token0.address === token || pool.token1.address === token);
74
- if (pools.length === 0) {
75
- return [];
76
- }
77
- pools = await this.updatePoolsReserves(pools.map(pool => pool.address));
78
- const tokensAmounts = pools
79
- .map(pool => {
80
- const token0 = pool.token0.address;
81
- const token1 = pool.token1.address;
82
- const reserve0 = pool.reserve0;
83
- const reserve1 = pool.reserve1;
84
- return [
85
- [token0, reserve0],
86
- [token1, reserve1],
87
- ];
88
- })
89
- .flat();
90
- const usdTokenAmounts = await this.dexHelper.getUsdTokenAmounts(tokensAmounts);
91
- const poolsWithLiquidity = pools.map((pool, i) => {
92
- const connectorToken = token === pool.token0.address ? pool.token1 : pool.token0;
93
- let token0ReserveUSD = usdTokenAmounts[i * 2];
94
- let token1ReserveUSD = usdTokenAmounts[i * 2 + 1];
95
- // fallback to non-empty usd reserves
96
- if (!token0ReserveUSD && token1ReserveUSD) {
97
- token0ReserveUSD = token1ReserveUSD;
98
- }
99
- if (!token1ReserveUSD && token0ReserveUSD) {
100
- token1ReserveUSD = token0ReserveUSD;
101
- }
102
- return {
103
- exchange: this.dexKey,
104
- address: pool.address,
105
- connectorTokens: [connectorToken],
106
- liquidityUSD: token0ReserveUSD + token1ReserveUSD,
107
- };
108
- });
109
- return poolsWithLiquidity
110
- .sort((a, b) => b.liquidityUSD - a.liquidityUSD)
111
- .slice(0, limit);
112
- }
113
- async updatePools() {
114
- const allPoolsCallData = this.getAllPoolsCallData();
115
- if (!allPoolsCallData) {
116
- throw new Error('getAllPoolsCallData is not implemented');
117
- }
118
- const callData = [allPoolsCallData];
119
- const [allPoolsLength] = await this.dexHelper.multiWrapper.tryAggregate(true, callData);
120
- if (this.pools.length < allPoolsLength.returnData) {
121
- await this.initPools(this.pools.length, allPoolsLength.returnData);
122
- }
123
- }
124
- async initPools(fromIndex, toIndex) {
125
- const allPoolsCallData = [];
126
- for (let i = fromIndex; i < toIndex; i++) {
127
- const poolCallData = this.getPoolCallData(i);
128
- if (!poolCallData) {
129
- throw new Error('getPoolCallData is not implemented');
130
- }
131
- allPoolsCallData.push(poolCallData);
132
- }
133
- const allPoolsResults = await this.dexHelper.multiWrapper.tryAggregate(true, allPoolsCallData);
134
- const poolsCalldata = [];
135
- for (const poolResult of allPoolsResults) {
136
- poolsCalldata.push({
137
- target: poolResult.returnData,
138
- callData: solidlyFactoryIface.encodeFunctionData('token0', []),
139
- decodeFunction: decoders_1.addressDecode,
140
- }, {
141
- target: poolResult.returnData,
142
- callData: solidlyFactoryIface.encodeFunctionData('token1', []),
143
- decodeFunction: decoders_1.addressDecode,
144
- }, {
145
- target: poolResult.returnData,
146
- callData: solidlyFactoryIface.encodeFunctionData('reserve0', []),
147
- decodeFunction: decoders_1.uint256ToBigInt,
148
- }, {
149
- target: poolResult.returnData,
150
- callData: solidlyFactoryIface.encodeFunctionData('reserve1', []),
151
- decodeFunction: decoders_1.uint256ToBigInt,
152
- });
153
- }
154
- const pools = await this.dexHelper.multiWrapper.tryAggregate(true, poolsCalldata);
155
- this.pools = [];
156
- const tokensSet = new Set();
157
- for (let i = 0; i < allPoolsResults.length; i++) {
158
- const token0 = pools[i * 4].returnData.toLowerCase();
159
- const token1 = pools[i * 4 + 1].returnData.toLowerCase();
160
- tokensSet.add(token0.toLowerCase());
161
- tokensSet.add(token1.toLowerCase());
162
- }
163
- const decimalsCalldata = [];
164
- const tokens = Array.from(tokensSet);
165
- for (const token of tokens) {
166
- decimalsCalldata.push({
167
- target: token,
168
- callData: solidlyFactoryIface.encodeFunctionData('decimals', []),
169
- decodeFunction: decoders_1.uint256DecodeToNumber,
170
- });
171
- }
172
- const decimalsResults = await this.dexHelper.multiWrapper.tryAggregate(true, decimalsCalldata);
173
- const decimals = decimalsResults.reduce((acc, result, index) => {
174
- const token = tokens[index];
175
- acc[token] = result.returnData;
176
- return acc;
177
- }, {});
178
- for (let i = 0; i < allPoolsResults.length; i++) {
179
- const poolAddress = allPoolsResults[i].returnData.toLowerCase();
180
- const token0 = pools[i * 4].returnData.toLowerCase();
181
- const token1 = pools[i * 4 + 1].returnData.toLowerCase();
182
- const reserve0 = pools[i * 4 + 2].returnData;
183
- const reserve1 = pools[i * 4 + 3].returnData;
184
- this.pools.push({
185
- address: poolAddress,
186
- token0: {
187
- address: token0,
188
- decimals: decimals[token0],
189
- },
190
- token1: {
191
- address: token1,
192
- decimals: decimals[token1],
193
- },
194
- reserve0,
195
- reserve1,
196
- });
197
- }
198
- }
199
- async updatePoolsReserves(pools) {
200
- const callData = [];
201
- for (const pool of pools) {
202
- callData.push({
203
- target: pool,
204
- callData: solidlyFactoryIface.encodeFunctionData('reserve0', []),
205
- decodeFunction: decoders_1.uint256ToBigInt,
206
- }, {
207
- target: pool,
208
- callData: solidlyFactoryIface.encodeFunctionData('reserve1', []),
209
- decodeFunction: decoders_1.uint256ToBigInt,
210
- });
211
- }
212
- const results = await this.dexHelper.multiWrapper.tryAggregate(true, callData);
213
- const _pools = [];
214
- for (let i = 0; i < pools.length; i++) {
215
- const reserve0 = results[i * 2].returnData;
216
- const reserve1 = results[i * 2 + 1].returnData;
217
- const poolIndex = this.pools.findIndex(pool => pool.address === pools[i]);
218
- if (poolIndex !== -1) {
219
- this.pools[poolIndex].reserve0 = reserve0;
220
- this.pools[poolIndex].reserve1 = reserve1;
221
- _pools.push(this.pools[poolIndex]);
222
- }
223
- }
224
- return _pools;
225
- }
226
- }
227
- exports.SolidlyRpcPoolTracker = SolidlyRpcPoolTracker;
228
- //# sourceMappingURL=rpc-pool-tracker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rpc-pool-tracker.js","sourceRoot":"","sources":["../../../src/dex/solidly/rpc-pool-tracker.ts"],"names":[],"mappings":";;;AAAA,4CAA+C;AAG/C,iDAI4B;AAG5B,uCAAoC;AAUpC,MAAM,iBAAiB,GAAG;IACxB;QACE,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACjE,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACjE,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,E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../constants';
2
- import { UniswapV2RpcPoolTracker } from './rpc-pool-tracker';
3
- export declare class PancakeSwapV2 extends UniswapV2RpcPoolTracker {
4
- static dexKeysWithNetwork: {
5
- key: string;
6
- networks: Network[];
7
- }[];
8
- }
@@ -1,15 +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.PancakeSwapV2 = void 0;
7
- const lodash_1 = __importDefault(require("lodash"));
8
- const utils_1 = require("../../utils");
9
- const config_1 = require("./config");
10
- const rpc_pool_tracker_1 = require("./rpc-pool-tracker");
11
- class PancakeSwapV2 extends rpc_pool_tracker_1.UniswapV2RpcPoolTracker {
12
- static dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(lodash_1.default.pick(config_1.UniswapV2Config, ['PancakeSwapV2']));
13
- }
14
- exports.PancakeSwapV2 = PancakeSwapV2;
15
- //# sourceMappingURL=pancake-swap-v2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pancake-swap-v2.js","sourceRoot":"","sources":["../../../src/dex/uniswap-v2/pancake-swap-v2.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AAEvB,uCAAoD;AACpD,qCAA2C;AAC3C,yDAA6D;AAE7D,MAAa,aAAc,SAAQ,0CAAuB;IACjD,MAAM,CAAC,kBAAkB,GAC9B,IAAA,6BAAqB,EAAC,gBAAC,CAAC,IAAI,CAAC,wBAAe,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;;AAFtE,sCAGC"}