@paraswap/dex-lib 3.4.2-balancer-v2-single-swap.0 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +377 -377
- package/build/config.js +9 -5
- package/build/config.js.map +1 -1
- package/build/dex/algebra/algebra.js +25 -25
- package/build/dex/balancer-v1/balancer-v1.js +34 -34
- package/build/dex/balancer-v2/balancer-v2.d.ts +1 -1
- package/build/dex/balancer-v2/balancer-v2.js +65 -78
- package/build/dex/balancer-v2/balancer-v2.js.map +1 -1
- package/build/dex/camelot/camelot.js +27 -27
- package/build/dex/kyberdmm/kyberdmm.js +27 -27
- package/build/dex/pancakeswap-v3/pancakeswap-v3.js +25 -25
- package/build/dex/solidly/solidly.js +27 -27
- package/build/dex/solidly-v3/solidly-v3.js +25 -25
- package/build/dex/swaap-v2/config.js +15 -0
- package/build/dex/swaap-v2/config.js.map +1 -1
- package/build/dex/uniswap-v2/uniswap-v2.js +26 -26
- package/build/dex/uniswap-v3/uniswap-v3.js +25 -25
- package/funding.json +5 -5
- package/package.json +1 -1
- package/src/config.ts +500 -496
- package/src/constants.ts +67 -67
- package/src/dex/aave-v2/aave-v2.ts +409 -409
- package/src/dex/aave-v3/aave-v3.ts +320 -320
- package/src/dex/algebra/algebra.ts +1180 -1180
- package/src/dex/angle-staked-stable/angle-staked-stable.ts +347 -347
- package/src/dex/augustus-rfq.ts +180 -180
- package/src/dex/bProtocol/bProtocol.ts +108 -108
- package/src/dex/balancer-v1/balancer-v1.ts +572 -572
- package/src/dex/balancer-v2/balancer-v2-e2e.test.ts +1699 -1699
- package/src/dex/balancer-v2/balancer-v2.ts +1669 -1701
- package/src/dex/bancor/bancor.ts +128 -128
- package/src/dex/camelot/camelot.ts +873 -873
- package/src/dex/compound/compound.ts +107 -107
- package/src/dex/curve-v1/config.ts +1179 -1179
- package/src/dex/curve-v1/curve-v1-e2e.test.ts +507 -507
- package/src/dex/curve-v1/curve-v1.ts +1315 -1315
- package/src/dex/curve-v1-factory/config.ts +1018 -1018
- package/src/dex/curve-v1-factory/curve-v1-factory.ts +1288 -1288
- package/src/dex/curve-v2/curve-v2.ts +440 -440
- package/src/dex/dexalot/dexalot.ts +1100 -1100
- package/src/dex/dodo-v1/dodo-v1.ts +132 -132
- package/src/dex/dodo-v2.ts +266 -266
- package/src/dex/etherfi.ts +239 -239
- package/src/dex/generic-rfq/generic-rfq.ts +431 -431
- package/src/dex/gmx/gmx.ts +321 -321
- package/src/dex/hashflow/hashflow.ts +1135 -1135
- package/src/dex/idex.ts +254 -254
- package/src/dex/index.ts +357 -357
- package/src/dex/jarvis-v6/jarvis-v6.ts +509 -509
- package/src/dex/jarvis.ts +262 -262
- package/src/dex/kyberdmm/kyberdmm.ts +649 -649
- package/src/dex/lido/lido.ts +110 -110
- package/src/dex/maker-psm/maker-psm.ts +592 -592
- package/src/dex/maverick-v1/maverick-v1.ts +537 -537
- package/src/dex/nerve/config.ts +635 -635
- package/src/dex/nerve/nerve-e2e.test.ts +731 -731
- package/src/dex/nerve/nerve-events.test.ts +911 -911
- package/src/dex/nerve/nerve.ts +467 -467
- package/src/dex/onebit/onebit.ts +113 -113
- package/src/dex/pancakeswap-v3/pancakeswap-v3.ts +1150 -1150
- package/src/dex/paraswap-limit-orders/config.ts +60 -60
- package/src/dex/paraswap-limit-orders/paraswap-limit-orders-e2e.test.ts +137 -137
- package/src/dex/paraswap-limit-orders/paraswap-limit-orders-integration.test.ts +328 -328
- package/src/dex/paraswap-limit-orders/paraswap-limit-orders.ts +631 -631
- package/src/dex/polygon-migrator/polygon-migrator.ts +194 -194
- package/src/dex/quick-perps/quick-perps.ts +337 -337
- package/src/dex/quickswap/config.ts +16 -16
- package/src/dex/quickswap/quickswap-e2e.test.ts +384 -384
- package/src/dex/smoothy/smoothy.ts +110 -110
- package/src/dex/solidly/config.ts +225 -225
- package/src/dex/solidly/solidly-e2e.test.ts +1421 -1421
- package/src/dex/solidly/solidly-integration.test.ts +1753 -1753
- package/src/dex/solidly/solidly.ts +687 -687
- package/src/dex/solidly-v3/solidly-v3.ts +968 -968
- package/src/dex/spark/spark.ts +284 -284
- package/src/dex/stable-pool/stable-pool.ts +129 -129
- package/src/dex/swaap-v2/config.ts +15 -0
- package/src/dex/swaap-v2/swaap-v2-e2e.test.ts +233 -17
- package/src/dex/swaap-v2/swaap-v2-integration.test.ts +1 -1
- package/src/dex/swaap-v2/swaap-v2.ts +1056 -1056
- package/src/dex/swell/swell.ts +312 -312
- package/src/dex/synthetix/synthetix.ts +420 -420
- package/src/dex/trader-joe-v2.1/trader-joe-v2.1.ts +180 -180
- package/src/dex/uniswap-v2/config.ts +637 -637
- package/src/dex/uniswap-v2/constants.ts +58 -58
- package/src/dex/uniswap-v2/uniswap-v2-e2e-avalanche.test.ts +1257 -1257
- package/src/dex/uniswap-v2/uniswap-v2-e2e-base.test.ts +42 -42
- package/src/dex/uniswap-v2/uniswap-v2-e2e-bsc.test.ts +1295 -1295
- package/src/dex/uniswap-v2/uniswap-v2-e2e-mainnet.test.ts +1834 -1834
- package/src/dex/uniswap-v2/uniswap-v2-e2e-polygon.test.ts +871 -871
- package/src/dex/uniswap-v2/uniswap-v2.ts +1117 -1117
- package/src/dex/uniswap-v3/uniswap-v3.ts +1501 -1501
- package/src/dex/uniswap-v3.ts +242 -242
- package/src/dex/weth/config.ts +73 -73
- package/src/dex/weth/weth.ts +230 -230
- package/src/dex/wombat/wombat.ts +467 -467
- package/src/dex/woo-fi-v2/woo-fi-v2.ts +529 -529
- package/src/dex/wsteth/wsteth.ts +304 -304
- package/src/dex/zerox/index.ts +328 -328
- package/src/executor/Executor01BytecodeBuilder.ts +474 -474
- package/src/executor/Executor02BytecodeBuilder.ts +1392 -1392
- package/src/executor/ExecutorBytecodeBuilder.ts +390 -390
- package/src/executor/ExecutorDetector.ts +131 -131
- package/src/executor/constants.ts +66 -66
- package/src/executor/executor01-bytecode-builder-e2e.test.ts +1478 -1478
- package/src/executor/utils.ts +62 -62
- package/src/router/simpleswap.ts +366 -366
- package/src/types.ts +342 -342
- package/tests/constants-e2e.ts +1632 -1622
- package/tests/generate-new-limit-order.ts +107 -107
|
@@ -450,33 +450,33 @@ class Camelot extends simple_exchange_1.SimpleExchange {
|
|
|
450
450
|
async getTopPoolsForToken(tokenAddress, count) {
|
|
451
451
|
if (!this.subgraphURL)
|
|
452
452
|
return [];
|
|
453
|
-
const query = `query ($token: Bytes!, $count: Int) {
|
|
454
|
-
pools0: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token0: $token, reserve0_gt: 1, reserve1_gt: 1}) {
|
|
455
|
-
id
|
|
456
|
-
isStable
|
|
457
|
-
token0 {
|
|
458
|
-
id
|
|
459
|
-
decimals
|
|
460
|
-
}
|
|
461
|
-
token1 {
|
|
462
|
-
id
|
|
463
|
-
decimals
|
|
464
|
-
}
|
|
465
|
-
reserveUSD
|
|
466
|
-
}
|
|
467
|
-
pools1: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token1: $token, reserve0_gt: 1, reserve1_gt: 1}) {
|
|
468
|
-
id
|
|
469
|
-
isStable
|
|
470
|
-
token0 {
|
|
471
|
-
id
|
|
472
|
-
decimals
|
|
473
|
-
}
|
|
474
|
-
token1 {
|
|
475
|
-
id
|
|
476
|
-
decimals
|
|
477
|
-
}
|
|
478
|
-
reserveUSD
|
|
479
|
-
}
|
|
453
|
+
const query = `query ($token: Bytes!, $count: Int) {
|
|
454
|
+
pools0: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token0: $token, reserve0_gt: 1, reserve1_gt: 1}) {
|
|
455
|
+
id
|
|
456
|
+
isStable
|
|
457
|
+
token0 {
|
|
458
|
+
id
|
|
459
|
+
decimals
|
|
460
|
+
}
|
|
461
|
+
token1 {
|
|
462
|
+
id
|
|
463
|
+
decimals
|
|
464
|
+
}
|
|
465
|
+
reserveUSD
|
|
466
|
+
}
|
|
467
|
+
pools1: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token1: $token, reserve0_gt: 1, reserve1_gt: 1}) {
|
|
468
|
+
id
|
|
469
|
+
isStable
|
|
470
|
+
token0 {
|
|
471
|
+
id
|
|
472
|
+
decimals
|
|
473
|
+
}
|
|
474
|
+
token1 {
|
|
475
|
+
id
|
|
476
|
+
decimals
|
|
477
|
+
}
|
|
478
|
+
reserveUSD
|
|
479
|
+
}
|
|
480
480
|
}`;
|
|
481
481
|
const { data } = await this.dexHelper.httpRequest.post(this.subgraphURL, {
|
|
482
482
|
query,
|
|
@@ -80,33 +80,33 @@ class KyberDmm extends simple_exchange_1.SimpleExchange {
|
|
|
80
80
|
async getTopPoolsForToken(tokenAddress, count) {
|
|
81
81
|
if (!this.config.subgraphURL)
|
|
82
82
|
return [];
|
|
83
|
-
const query = `
|
|
84
|
-
query ($token: Bytes!, $count: Int) {
|
|
85
|
-
pools0: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token0: $token}) {
|
|
86
|
-
id
|
|
87
|
-
reserveUSD
|
|
88
|
-
token0{
|
|
89
|
-
id
|
|
90
|
-
decimals
|
|
91
|
-
}
|
|
92
|
-
token1{
|
|
93
|
-
id
|
|
94
|
-
decimals
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
pools1: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token1: $token}) {
|
|
98
|
-
id
|
|
99
|
-
reserveUSD
|
|
100
|
-
token1{
|
|
101
|
-
id
|
|
102
|
-
decimals
|
|
103
|
-
}
|
|
104
|
-
token0{
|
|
105
|
-
id
|
|
106
|
-
decimals
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
83
|
+
const query = `
|
|
84
|
+
query ($token: Bytes!, $count: Int) {
|
|
85
|
+
pools0: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token0: $token}) {
|
|
86
|
+
id
|
|
87
|
+
reserveUSD
|
|
88
|
+
token0{
|
|
89
|
+
id
|
|
90
|
+
decimals
|
|
91
|
+
}
|
|
92
|
+
token1{
|
|
93
|
+
id
|
|
94
|
+
decimals
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
pools1: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token1: $token}) {
|
|
98
|
+
id
|
|
99
|
+
reserveUSD
|
|
100
|
+
token1{
|
|
101
|
+
id
|
|
102
|
+
decimals
|
|
103
|
+
}
|
|
104
|
+
token0{
|
|
105
|
+
id
|
|
106
|
+
decimals
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
110
|
`;
|
|
111
111
|
const { data } = await this.dexHelper.httpRequest.post(this.config.subgraphURL, {
|
|
112
112
|
query,
|
|
@@ -524,31 +524,31 @@ class PancakeswapV3 extends simple_exchange_1.SimpleExchange {
|
|
|
524
524
|
if (!this.config.subgraphURL)
|
|
525
525
|
return [];
|
|
526
526
|
const _tokenAddress = tokenAddress.toLowerCase();
|
|
527
|
-
const res = await this._querySubgraph(`query ($token: Bytes!, $count: Int) {
|
|
528
|
-
pools0: pools(first: $count, orderBy: totalValueLockedUSD, orderDirection: desc, where: {token0: $token}) {
|
|
529
|
-
id
|
|
530
|
-
token0 {
|
|
531
|
-
id
|
|
532
|
-
decimals
|
|
533
|
-
}
|
|
534
|
-
token1 {
|
|
535
|
-
id
|
|
536
|
-
decimals
|
|
537
|
-
}
|
|
538
|
-
totalValueLockedUSD
|
|
539
|
-
}
|
|
540
|
-
pools1: pools(first: $count, orderBy: totalValueLockedUSD, orderDirection: desc, where: {token1: $token}) {
|
|
541
|
-
id
|
|
542
|
-
token0 {
|
|
543
|
-
id
|
|
544
|
-
decimals
|
|
545
|
-
}
|
|
546
|
-
token1 {
|
|
547
|
-
id
|
|
548
|
-
decimals
|
|
549
|
-
}
|
|
550
|
-
totalValueLockedUSD
|
|
551
|
-
}
|
|
527
|
+
const res = await this._querySubgraph(`query ($token: Bytes!, $count: Int) {
|
|
528
|
+
pools0: pools(first: $count, orderBy: totalValueLockedUSD, orderDirection: desc, where: {token0: $token}) {
|
|
529
|
+
id
|
|
530
|
+
token0 {
|
|
531
|
+
id
|
|
532
|
+
decimals
|
|
533
|
+
}
|
|
534
|
+
token1 {
|
|
535
|
+
id
|
|
536
|
+
decimals
|
|
537
|
+
}
|
|
538
|
+
totalValueLockedUSD
|
|
539
|
+
}
|
|
540
|
+
pools1: pools(first: $count, orderBy: totalValueLockedUSD, orderDirection: desc, where: {token1: $token}) {
|
|
541
|
+
id
|
|
542
|
+
token0 {
|
|
543
|
+
id
|
|
544
|
+
decimals
|
|
545
|
+
}
|
|
546
|
+
token1 {
|
|
547
|
+
id
|
|
548
|
+
decimals
|
|
549
|
+
}
|
|
550
|
+
totalValueLockedUSD
|
|
551
|
+
}
|
|
552
552
|
}`, {
|
|
553
553
|
token: _tokenAddress,
|
|
554
554
|
count: limit,
|
|
@@ -277,33 +277,33 @@ class Solidly extends uniswap_v2_1.UniswapV2 {
|
|
|
277
277
|
else if (this.dexKey.toLowerCase() !== 'solidlyv2') {
|
|
278
278
|
stableFieldKey = 'isStable';
|
|
279
279
|
}
|
|
280
|
-
const query = `query ($token: Bytes!, $count: Int) {
|
|
281
|
-
pools0: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token0: $token, reserve0_gt: 1, reserve1_gt: 1}) {
|
|
282
|
-
id
|
|
283
|
-
${stableFieldKey}
|
|
284
|
-
token0 {
|
|
285
|
-
id
|
|
286
|
-
decimals
|
|
287
|
-
}
|
|
288
|
-
token1 {
|
|
289
|
-
id
|
|
290
|
-
decimals
|
|
291
|
-
}
|
|
292
|
-
reserveUSD
|
|
293
|
-
}
|
|
294
|
-
pools1: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token1: $token, reserve0_gt: 1, reserve1_gt: 1}) {
|
|
295
|
-
id
|
|
296
|
-
${stableFieldKey}
|
|
297
|
-
token0 {
|
|
298
|
-
id
|
|
299
|
-
decimals
|
|
300
|
-
}
|
|
301
|
-
token1 {
|
|
302
|
-
id
|
|
303
|
-
decimals
|
|
304
|
-
}
|
|
305
|
-
reserveUSD
|
|
306
|
-
}
|
|
280
|
+
const query = `query ($token: Bytes!, $count: Int) {
|
|
281
|
+
pools0: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token0: $token, reserve0_gt: 1, reserve1_gt: 1}) {
|
|
282
|
+
id
|
|
283
|
+
${stableFieldKey}
|
|
284
|
+
token0 {
|
|
285
|
+
id
|
|
286
|
+
decimals
|
|
287
|
+
}
|
|
288
|
+
token1 {
|
|
289
|
+
id
|
|
290
|
+
decimals
|
|
291
|
+
}
|
|
292
|
+
reserveUSD
|
|
293
|
+
}
|
|
294
|
+
pools1: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token1: $token, reserve0_gt: 1, reserve1_gt: 1}) {
|
|
295
|
+
id
|
|
296
|
+
${stableFieldKey}
|
|
297
|
+
token0 {
|
|
298
|
+
id
|
|
299
|
+
decimals
|
|
300
|
+
}
|
|
301
|
+
token1 {
|
|
302
|
+
id
|
|
303
|
+
decimals
|
|
304
|
+
}
|
|
305
|
+
reserveUSD
|
|
306
|
+
}
|
|
307
307
|
}`;
|
|
308
308
|
const { data } = await this.dexHelper.httpRequest.post(this.subgraphURL, {
|
|
309
309
|
query,
|
|
@@ -405,31 +405,31 @@ class SolidlyV3 extends simple_exchange_1.SimpleExchange {
|
|
|
405
405
|
}
|
|
406
406
|
async getTopPoolsForToken(tokenAddress, limit) {
|
|
407
407
|
const _tokenAddress = tokenAddress.toLowerCase();
|
|
408
|
-
const res = await this._querySubgraph(`query ($token: Bytes!, $count: Int) {
|
|
409
|
-
pools0: pools(first: $count, orderBy: totalValueLockedUSD, orderDirection: desc, where: {token0: $token, liquidity_gt: "0"}) {
|
|
410
|
-
id
|
|
411
|
-
token0 {
|
|
412
|
-
id
|
|
413
|
-
decimals
|
|
414
|
-
}
|
|
415
|
-
token1 {
|
|
416
|
-
id
|
|
417
|
-
decimals
|
|
418
|
-
}
|
|
419
|
-
totalValueLockedUSD
|
|
420
|
-
}
|
|
421
|
-
pools1: pools(first: $count, orderBy: totalValueLockedUSD, orderDirection: desc, where: {token1: $token, liquidity_gt: "0"}) {
|
|
422
|
-
id
|
|
423
|
-
token0 {
|
|
424
|
-
id
|
|
425
|
-
decimals
|
|
426
|
-
}
|
|
427
|
-
token1 {
|
|
428
|
-
id
|
|
429
|
-
decimals
|
|
430
|
-
}
|
|
431
|
-
totalValueLockedUSD
|
|
432
|
-
}
|
|
408
|
+
const res = await this._querySubgraph(`query ($token: Bytes!, $count: Int) {
|
|
409
|
+
pools0: pools(first: $count, orderBy: totalValueLockedUSD, orderDirection: desc, where: {token0: $token, liquidity_gt: "0"}) {
|
|
410
|
+
id
|
|
411
|
+
token0 {
|
|
412
|
+
id
|
|
413
|
+
decimals
|
|
414
|
+
}
|
|
415
|
+
token1 {
|
|
416
|
+
id
|
|
417
|
+
decimals
|
|
418
|
+
}
|
|
419
|
+
totalValueLockedUSD
|
|
420
|
+
}
|
|
421
|
+
pools1: pools(first: $count, orderBy: totalValueLockedUSD, orderDirection: desc, where: {token1: $token, liquidity_gt: "0"}) {
|
|
422
|
+
id
|
|
423
|
+
token0 {
|
|
424
|
+
id
|
|
425
|
+
decimals
|
|
426
|
+
}
|
|
427
|
+
token1 {
|
|
428
|
+
id
|
|
429
|
+
decimals
|
|
430
|
+
}
|
|
431
|
+
totalValueLockedUSD
|
|
432
|
+
}
|
|
433
433
|
}`, {
|
|
434
434
|
token: _tokenAddress,
|
|
435
435
|
count: limit,
|
|
@@ -7,6 +7,9 @@ exports.SwaapV2Config = {
|
|
|
7
7
|
[constants_1.Network.MAINNET]: {},
|
|
8
8
|
[constants_1.Network.POLYGON]: {},
|
|
9
9
|
[constants_1.Network.ARBITRUM]: {},
|
|
10
|
+
[constants_1.Network.BASE]: {},
|
|
11
|
+
[constants_1.Network.BSC]: {},
|
|
12
|
+
[constants_1.Network.OPTIMISM]: {},
|
|
10
13
|
},
|
|
11
14
|
};
|
|
12
15
|
exports.Adapters = {
|
|
@@ -22,5 +25,17 @@ exports.Adapters = {
|
|
|
22
25
|
[constants_1.SwapSide.SELL]: [{ name: 'ArbitrumAdapter02', index: 6 }],
|
|
23
26
|
[constants_1.SwapSide.BUY]: [{ name: 'ArbitrumBuyAdapter', index: 8 }],
|
|
24
27
|
},
|
|
28
|
+
[constants_1.Network.BASE]: {
|
|
29
|
+
[constants_1.SwapSide.SELL]: [{ name: 'BaseAdapter02', index: 1 }],
|
|
30
|
+
[constants_1.SwapSide.BUY]: [{ name: 'BaseBuyAdapter', index: 8 }],
|
|
31
|
+
},
|
|
32
|
+
[constants_1.Network.BSC]: {
|
|
33
|
+
[constants_1.SwapSide.SELL]: [{ name: 'BscAdapter02', index: 11 }],
|
|
34
|
+
[constants_1.SwapSide.BUY]: [{ name: 'BscBuyAdapter', index: 9 }],
|
|
35
|
+
},
|
|
36
|
+
[constants_1.Network.OPTIMISM]: {
|
|
37
|
+
[constants_1.SwapSide.SELL]: [{ name: 'OptimismAdapter02', index: 2 }],
|
|
38
|
+
[constants_1.SwapSide.BUY]: [{ name: 'OptimismBuyAdapter', index: 7 }],
|
|
39
|
+
},
|
|
25
40
|
};
|
|
26
41
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/swaap-v2/config.ts"],"names":[],"mappings":";;;AAEA,+CAAoD;AAEvC,QAAA,aAAa,GAA4B;IACpD,OAAO,EAAE;QACP,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE,EAAE;QACrB,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE,EAAE;QACrB,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE,EAAE;KACvB;CACF,CAAC;AAEW,QAAA,QAAQ,GAAoC;IACvD,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;QACjB,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,W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AC,oBAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KACtD;IACD,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE;QAClB,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAC1D,CAAC,oBAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KAC3D;CACF,CAAC"}
|
|
@@ -450,32 +450,32 @@ class UniswapV2 extends simple_exchange_1.SimpleExchange {
|
|
|
450
450
|
async getTopPoolsForToken(tokenAddress, count) {
|
|
451
451
|
if (!this.subgraphURL)
|
|
452
452
|
return [];
|
|
453
|
-
const query = `
|
|
454
|
-
query ($token: Bytes!, $count: Int) {
|
|
455
|
-
pools0: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token0: $token, reserve0_gt: 1, reserve1_gt: 1}) {
|
|
456
|
-
id
|
|
457
|
-
token0 {
|
|
458
|
-
id
|
|
459
|
-
decimals
|
|
460
|
-
}
|
|
461
|
-
token1 {
|
|
462
|
-
id
|
|
463
|
-
decimals
|
|
464
|
-
}
|
|
465
|
-
reserveUSD
|
|
466
|
-
}
|
|
467
|
-
pools1: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token1: $token, reserve0_gt: 1, reserve1_gt: 1}) {
|
|
468
|
-
id
|
|
469
|
-
token0 {
|
|
470
|
-
id
|
|
471
|
-
decimals
|
|
472
|
-
}
|
|
473
|
-
token1 {
|
|
474
|
-
id
|
|
475
|
-
decimals
|
|
476
|
-
}
|
|
477
|
-
reserveUSD
|
|
478
|
-
}
|
|
453
|
+
const query = `
|
|
454
|
+
query ($token: Bytes!, $count: Int) {
|
|
455
|
+
pools0: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token0: $token, reserve0_gt: 1, reserve1_gt: 1}) {
|
|
456
|
+
id
|
|
457
|
+
token0 {
|
|
458
|
+
id
|
|
459
|
+
decimals
|
|
460
|
+
}
|
|
461
|
+
token1 {
|
|
462
|
+
id
|
|
463
|
+
decimals
|
|
464
|
+
}
|
|
465
|
+
reserveUSD
|
|
466
|
+
}
|
|
467
|
+
pools1: pairs(first: $count, orderBy: reserveUSD, orderDirection: desc, where: {token1: $token, reserve0_gt: 1, reserve1_gt: 1}) {
|
|
468
|
+
id
|
|
469
|
+
token0 {
|
|
470
|
+
id
|
|
471
|
+
decimals
|
|
472
|
+
}
|
|
473
|
+
token1 {
|
|
474
|
+
id
|
|
475
|
+
decimals
|
|
476
|
+
}
|
|
477
|
+
reserveUSD
|
|
478
|
+
}
|
|
479
479
|
}`;
|
|
480
480
|
const { data } = await this.dexHelper.httpRequest.post(this.subgraphURL, {
|
|
481
481
|
query,
|
|
@@ -671,31 +671,31 @@ class UniswapV3 extends simple_exchange_1.SimpleExchange {
|
|
|
671
671
|
if (!this.config.subgraphURL)
|
|
672
672
|
return [];
|
|
673
673
|
const _tokenAddress = tokenAddress.toLowerCase();
|
|
674
|
-
const res = await this._querySubgraph(`query ($token: Bytes!, $count: Int) {
|
|
675
|
-
pools0: pools(first: $count, orderBy: totalValueLockedUSD, orderDirection: desc, where: {token0: $token}) {
|
|
676
|
-
id
|
|
677
|
-
token0 {
|
|
678
|
-
id
|
|
679
|
-
decimals
|
|
680
|
-
}
|
|
681
|
-
token1 {
|
|
682
|
-
id
|
|
683
|
-
decimals
|
|
684
|
-
}
|
|
685
|
-
totalValueLockedUSD
|
|
686
|
-
}
|
|
687
|
-
pools1: pools(first: $count, orderBy: totalValueLockedUSD, orderDirection: desc, where: {token1: $token}) {
|
|
688
|
-
id
|
|
689
|
-
token0 {
|
|
690
|
-
id
|
|
691
|
-
decimals
|
|
692
|
-
}
|
|
693
|
-
token1 {
|
|
694
|
-
id
|
|
695
|
-
decimals
|
|
696
|
-
}
|
|
697
|
-
totalValueLockedUSD
|
|
698
|
-
}
|
|
674
|
+
const res = await this._querySubgraph(`query ($token: Bytes!, $count: Int) {
|
|
675
|
+
pools0: pools(first: $count, orderBy: totalValueLockedUSD, orderDirection: desc, where: {token0: $token}) {
|
|
676
|
+
id
|
|
677
|
+
token0 {
|
|
678
|
+
id
|
|
679
|
+
decimals
|
|
680
|
+
}
|
|
681
|
+
token1 {
|
|
682
|
+
id
|
|
683
|
+
decimals
|
|
684
|
+
}
|
|
685
|
+
totalValueLockedUSD
|
|
686
|
+
}
|
|
687
|
+
pools1: pools(first: $count, orderBy: totalValueLockedUSD, orderDirection: desc, where: {token1: $token}) {
|
|
688
|
+
id
|
|
689
|
+
token0 {
|
|
690
|
+
id
|
|
691
|
+
decimals
|
|
692
|
+
}
|
|
693
|
+
token1 {
|
|
694
|
+
id
|
|
695
|
+
decimals
|
|
696
|
+
}
|
|
697
|
+
totalValueLockedUSD
|
|
698
|
+
}
|
|
699
699
|
}`, {
|
|
700
700
|
token: _tokenAddress,
|
|
701
701
|
count: limit,
|
package/funding.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"opRetro": {
|
|
3
|
-
"projectId": "0x40666399bef533ba8b13292f910c26f5523b057ed33a51d3d90d2fe0079a1c9e"
|
|
4
|
-
}
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"opRetro": {
|
|
3
|
+
"projectId": "0x40666399bef533ba8b13292f910c26f5523b057ed33a51d3d90d2fe0079a1c9e"
|
|
4
|
+
}
|
|
5
|
+
}
|