@merkl/api 0.20.60 → 0.20.62
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/dist/src/eden/index.d.ts +25 -0
- package/dist/src/engine/dynamicData/implementations/Clamm.js +58 -61
- package/dist/src/index.d.ts +5 -0
- package/dist/src/modules/v4/programPayload/programPayload.controller.d.ts +5 -0
- package/dist/src/modules/v4/programPayload/programPayload.model.d.ts +3 -0
- package/dist/src/modules/v4/programPayload/programPayload.model.js +2 -0
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +52 -2
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +57 -0
- package/dist/src/modules/v4/programPayload/programPayload.service.js +5 -0
- package/dist/src/modules/v4/router.d.ts +5 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/eden/index.d.ts
CHANGED
@@ -3551,6 +3551,7 @@ declare const eden: {
|
|
3551
3551
|
get: (options: {
|
3552
3552
|
headers?: Record<string, unknown> | undefined;
|
3553
3553
|
query: {
|
3554
|
+
apr?: number | undefined;
|
3554
3555
|
creator: string;
|
3555
3556
|
campaign: string;
|
3556
3557
|
distributionChainId: number;
|
@@ -3578,6 +3579,7 @@ declare const eden: {
|
|
3578
3579
|
get: (options: {
|
3579
3580
|
headers?: Record<string, unknown> | undefined;
|
3580
3581
|
query: {
|
3582
|
+
apr?: number | undefined;
|
3581
3583
|
creator: string;
|
3582
3584
|
campaign: string;
|
3583
3585
|
distributionChainId: number;
|
@@ -3610,6 +3612,7 @@ declare const eden: {
|
|
3610
3612
|
get: (options: {
|
3611
3613
|
headers?: Record<string, unknown> | undefined;
|
3612
3614
|
query: {
|
3615
|
+
apr?: number | undefined;
|
3613
3616
|
creator: string;
|
3614
3617
|
campaign: string;
|
3615
3618
|
distributionChainId: number;
|
@@ -3631,6 +3634,7 @@ declare const eden: {
|
|
3631
3634
|
headers?: Record<string, unknown> | undefined;
|
3632
3635
|
query: {
|
3633
3636
|
amount?: string | undefined;
|
3637
|
+
apr?: number | undefined;
|
3634
3638
|
creator: string;
|
3635
3639
|
distributionChainId: number;
|
3636
3640
|
startTimestamp: number;
|
@@ -3658,6 +3662,7 @@ declare const eden: {
|
|
3658
3662
|
headers?: Record<string, unknown> | undefined;
|
3659
3663
|
query: {
|
3660
3664
|
amount?: string | undefined;
|
3665
|
+
apr?: number | undefined;
|
3661
3666
|
creator: string;
|
3662
3667
|
distributionChainId: number;
|
3663
3668
|
startTimestamp: number;
|
@@ -7579,6 +7584,7 @@ declare const eden: {
|
|
7579
7584
|
get: (options: {
|
7580
7585
|
headers?: Record<string, unknown> | undefined;
|
7581
7586
|
query: {
|
7587
|
+
apr?: number | undefined;
|
7582
7588
|
creator: string;
|
7583
7589
|
campaign: string;
|
7584
7590
|
distributionChainId: number;
|
@@ -7606,6 +7612,7 @@ declare const eden: {
|
|
7606
7612
|
get: (options: {
|
7607
7613
|
headers?: Record<string, unknown> | undefined;
|
7608
7614
|
query: {
|
7615
|
+
apr?: number | undefined;
|
7609
7616
|
creator: string;
|
7610
7617
|
campaign: string;
|
7611
7618
|
distributionChainId: number;
|
@@ -7638,6 +7645,7 @@ declare const eden: {
|
|
7638
7645
|
get: (options: {
|
7639
7646
|
headers?: Record<string, unknown> | undefined;
|
7640
7647
|
query: {
|
7648
|
+
apr?: number | undefined;
|
7641
7649
|
creator: string;
|
7642
7650
|
campaign: string;
|
7643
7651
|
distributionChainId: number;
|
@@ -7659,6 +7667,7 @@ declare const eden: {
|
|
7659
7667
|
headers?: Record<string, unknown> | undefined;
|
7660
7668
|
query: {
|
7661
7669
|
amount?: string | undefined;
|
7670
|
+
apr?: number | undefined;
|
7662
7671
|
creator: string;
|
7663
7672
|
distributionChainId: number;
|
7664
7673
|
startTimestamp: number;
|
@@ -7686,6 +7695,7 @@ declare const eden: {
|
|
7686
7695
|
headers?: Record<string, unknown> | undefined;
|
7687
7696
|
query: {
|
7688
7697
|
amount?: string | undefined;
|
7698
|
+
apr?: number | undefined;
|
7689
7699
|
creator: string;
|
7690
7700
|
distributionChainId: number;
|
7691
7701
|
startTimestamp: number;
|
@@ -13200,6 +13210,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13200
13210
|
body: unknown;
|
13201
13211
|
params: {};
|
13202
13212
|
query: {
|
13213
|
+
apr?: number | undefined;
|
13203
13214
|
creator: string;
|
13204
13215
|
campaign: string;
|
13205
13216
|
distributionChainId: number;
|
@@ -13232,6 +13243,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13232
13243
|
body: unknown;
|
13233
13244
|
params: {};
|
13234
13245
|
query: {
|
13246
|
+
apr?: number | undefined;
|
13235
13247
|
creator: string;
|
13236
13248
|
campaign: string;
|
13237
13249
|
distributionChainId: number;
|
@@ -13276,6 +13288,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13276
13288
|
body: unknown;
|
13277
13289
|
params: {};
|
13278
13290
|
query: {
|
13291
|
+
apr?: number | undefined;
|
13279
13292
|
creator: string;
|
13280
13293
|
campaign: string;
|
13281
13294
|
distributionChainId: number;
|
@@ -13302,6 +13315,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13302
13315
|
params: {};
|
13303
13316
|
query: {
|
13304
13317
|
amount?: string | undefined;
|
13318
|
+
apr?: number | undefined;
|
13305
13319
|
creator: string;
|
13306
13320
|
distributionChainId: number;
|
13307
13321
|
startTimestamp: number;
|
@@ -13336,6 +13350,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13336
13350
|
params: {};
|
13337
13351
|
query: {
|
13338
13352
|
amount?: string | undefined;
|
13353
|
+
apr?: number | undefined;
|
13339
13354
|
creator: string;
|
13340
13355
|
distributionChainId: number;
|
13341
13356
|
startTimestamp: number;
|
@@ -18296,6 +18311,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
18296
18311
|
get: (options: {
|
18297
18312
|
headers?: Record<string, unknown> | undefined;
|
18298
18313
|
query: {
|
18314
|
+
apr?: number | undefined;
|
18299
18315
|
creator: string;
|
18300
18316
|
campaign: string;
|
18301
18317
|
distributionChainId: number;
|
@@ -18323,6 +18339,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
18323
18339
|
get: (options: {
|
18324
18340
|
headers?: Record<string, unknown> | undefined;
|
18325
18341
|
query: {
|
18342
|
+
apr?: number | undefined;
|
18326
18343
|
creator: string;
|
18327
18344
|
campaign: string;
|
18328
18345
|
distributionChainId: number;
|
@@ -18355,6 +18372,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
18355
18372
|
get: (options: {
|
18356
18373
|
headers?: Record<string, unknown> | undefined;
|
18357
18374
|
query: {
|
18375
|
+
apr?: number | undefined;
|
18358
18376
|
creator: string;
|
18359
18377
|
campaign: string;
|
18360
18378
|
distributionChainId: number;
|
@@ -18376,6 +18394,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
18376
18394
|
headers?: Record<string, unknown> | undefined;
|
18377
18395
|
query: {
|
18378
18396
|
amount?: string | undefined;
|
18397
|
+
apr?: number | undefined;
|
18379
18398
|
creator: string;
|
18380
18399
|
distributionChainId: number;
|
18381
18400
|
startTimestamp: number;
|
@@ -18403,6 +18422,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
18403
18422
|
headers?: Record<string, unknown> | undefined;
|
18404
18423
|
query: {
|
18405
18424
|
amount?: string | undefined;
|
18425
|
+
apr?: number | undefined;
|
18406
18426
|
creator: string;
|
18407
18427
|
distributionChainId: number;
|
18408
18428
|
startTimestamp: number;
|
@@ -22324,6 +22344,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
22324
22344
|
get: (options: {
|
22325
22345
|
headers?: Record<string, unknown> | undefined;
|
22326
22346
|
query: {
|
22347
|
+
apr?: number | undefined;
|
22327
22348
|
creator: string;
|
22328
22349
|
campaign: string;
|
22329
22350
|
distributionChainId: number;
|
@@ -22351,6 +22372,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
22351
22372
|
get: (options: {
|
22352
22373
|
headers?: Record<string, unknown> | undefined;
|
22353
22374
|
query: {
|
22375
|
+
apr?: number | undefined;
|
22354
22376
|
creator: string;
|
22355
22377
|
campaign: string;
|
22356
22378
|
distributionChainId: number;
|
@@ -22383,6 +22405,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
22383
22405
|
get: (options: {
|
22384
22406
|
headers?: Record<string, unknown> | undefined;
|
22385
22407
|
query: {
|
22408
|
+
apr?: number | undefined;
|
22386
22409
|
creator: string;
|
22387
22410
|
campaign: string;
|
22388
22411
|
distributionChainId: number;
|
@@ -22404,6 +22427,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
22404
22427
|
headers?: Record<string, unknown> | undefined;
|
22405
22428
|
query: {
|
22406
22429
|
amount?: string | undefined;
|
22430
|
+
apr?: number | undefined;
|
22407
22431
|
creator: string;
|
22408
22432
|
distributionChainId: number;
|
22409
22433
|
startTimestamp: number;
|
@@ -22431,6 +22455,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
22431
22455
|
headers?: Record<string, unknown> | undefined;
|
22432
22456
|
query: {
|
22433
22457
|
amount?: string | undefined;
|
22458
|
+
apr?: number | undefined;
|
22434
22459
|
creator: string;
|
22435
22460
|
distributionChainId: number;
|
22436
22461
|
startTimestamp: number;
|
@@ -295,11 +295,11 @@ export class ClammDynamicData {
|
|
295
295
|
const symbolToken1 = d.campaignParameters.symbolToken1;
|
296
296
|
const prevI = i;
|
297
297
|
try {
|
298
|
-
poolTotalLiquidity =
|
298
|
+
poolTotalLiquidity = BN2Number(poolInterface.decodeFunctionResult(Liquidity[AMMAlgorithmMapping[pool.amm]], result[i++].returnData)[DecodeLiquidity[AMMAlgorithmMapping[pool.amm]]]);
|
299
299
|
sqrtPrice = poolInterface
|
300
300
|
.decodeFunctionResult(PoolState[AMMAlgorithmMapping[pool.amm]], result[i++].returnData)[SqrtPrice[AMMAlgorithmMapping[pool.amm]]].toString();
|
301
|
-
poolBalanceToken0 =
|
302
|
-
poolBalanceToken1 =
|
301
|
+
poolBalanceToken0 = BN2Number(ERC20Interface.decodeFunctionResult("balanceOf", result[i++].returnData)[0], decimalsToken0);
|
302
|
+
poolBalanceToken1 = BN2Number(ERC20Interface.decodeFunctionResult("balanceOf", result[i++].returnData)[0], decimalsToken1);
|
303
303
|
}
|
304
304
|
catch (e) {
|
305
305
|
log.warn(`merklDynamic data - failed to decode state of pool ${pool.address} on ${NETWORK_LABELS[chainId]}`);
|
@@ -321,13 +321,13 @@ export class ClammDynamicData {
|
|
321
321
|
for (const w of pool.alms.filter(a => a.target.toLowerCase() === pool.address.toLowerCase() && a.type !== ALM.A51)) {
|
322
322
|
const prevI = i;
|
323
323
|
try {
|
324
|
-
const totalSupply =
|
325
|
-
const almIdleBalance0 =
|
324
|
+
const totalSupply = BN2Number(ERC20Interface.decodeFunctionResult("totalSupply", result[i++].returnData)[0]);
|
325
|
+
const almIdleBalance0 = BN2Number(ERC20Interface.decodeFunctionResult("balanceOf", result[i++].returnData)[0], d.campaignParameters.decimalsToken0);
|
326
326
|
let almBalance0 = almIdleBalance0;
|
327
|
-
const almIdleBalance1 =
|
327
|
+
const almIdleBalance1 = BN2Number(ERC20Interface.decodeFunctionResult("balanceOf", result[i++].returnData)[0], d.campaignParameters.decimalsToken1);
|
328
328
|
let almBalance1 = almIdleBalance1;
|
329
|
-
let almTotalLiquidity =
|
330
|
-
let almInRangeLiquidity =
|
329
|
+
let almTotalLiquidity = 0;
|
330
|
+
let almInRangeLiquidity = 0;
|
331
331
|
const almPositions = positions?.[pool.amm]?.filter(pos => pos.pool.id === pool.address.toLowerCase() &&
|
332
332
|
[w.address.toLowerCase(), ...[!!w?.owner && w.owner.toLowerCase()]].includes(pos.owner.toLowerCase()));
|
333
333
|
const almPositionsWithAPIType = [];
|
@@ -336,23 +336,22 @@ export class ClammDynamicData {
|
|
336
336
|
const upperTick = Number.parseInt(position.tickUpper);
|
337
337
|
const lowerTick = Number.parseInt(position.tickLower);
|
338
338
|
const [amount0, amount1] = getAmountsForLiquidity(sqrtPrice, lowerTick, upperTick, BigNumber.from(position.liquidity));
|
339
|
-
const balance0 =
|
340
|
-
const balance1 =
|
341
|
-
const totalLiquidity =
|
342
|
-
const inRangeLiquidity = balance0 >
|
343
|
-
almTotalLiquidity
|
344
|
-
almInRangeLiquidity
|
345
|
-
almBalance0
|
346
|
-
almBalance1
|
339
|
+
const balance0 = BN2Number(amount0, decimalsToken0);
|
340
|
+
const balance1 = BN2Number(amount1, decimalsToken1);
|
341
|
+
const totalLiquidity = BN2Number(position.liquidity);
|
342
|
+
const inRangeLiquidity = balance0 > 0 && balance1 > 0 ? (BN2Number(position.liquidity) ?? 0) : 0;
|
343
|
+
almTotalLiquidity += totalLiquidity;
|
344
|
+
almInRangeLiquidity += inRangeLiquidity;
|
345
|
+
almBalance0 += balance0;
|
346
|
+
almBalance1 += balance1;
|
347
347
|
almPositionsWithAPIType.push({
|
348
|
-
balance0
|
349
|
-
balance1
|
348
|
+
balance0,
|
349
|
+
balance1,
|
350
350
|
id: position.id,
|
351
|
-
inRangeLiquidity
|
351
|
+
inRangeLiquidity,
|
352
352
|
lowerTick,
|
353
|
-
totalLiquidity
|
354
|
-
tvl: priceToken0 *
|
355
|
-
priceToken1 * BN2Number(balance1, d.campaignParameters.decimalsToken0),
|
353
|
+
totalLiquidity,
|
354
|
+
tvl: priceToken0 * balance0 + priceToken1 * balance1,
|
356
355
|
upperTick,
|
357
356
|
});
|
358
357
|
}
|
@@ -361,14 +360,13 @@ export class ClammDynamicData {
|
|
361
360
|
almDetails.push({
|
362
361
|
almAPR: 0, // filled later on
|
363
362
|
almAddress: utils.getAddress(w.address),
|
364
|
-
almBalance0
|
365
|
-
almIdleBalance0
|
366
|
-
almIdleBalance1
|
367
|
-
almBalance1
|
368
|
-
almInRangeLiquidity
|
369
|
-
almTVL:
|
370
|
-
|
371
|
-
almTotalLiquidity: BN2Number(almTotalLiquidity),
|
363
|
+
almBalance0,
|
364
|
+
almIdleBalance0,
|
365
|
+
almIdleBalance1,
|
366
|
+
almBalance1,
|
367
|
+
almInRangeLiquidity,
|
368
|
+
almTVL: almBalance0 * priceToken0 + almBalance1 * priceToken1,
|
369
|
+
almTotalLiquidity,
|
372
370
|
forwarderType: Forwarder.CLAMM,
|
373
371
|
label: `${ALMMapping[pool.amm]?.[w.type]} ${w.address}`,
|
374
372
|
origin: w.type,
|
@@ -377,7 +375,7 @@ export class ClammDynamicData {
|
|
377
375
|
sender: utils.getAddress(w.address),
|
378
376
|
target: w.target,
|
379
377
|
owner: utils.getAddress(w.owner ?? w.address),
|
380
|
-
totalSupply
|
378
|
+
totalSupply,
|
381
379
|
type: w.type,
|
382
380
|
});
|
383
381
|
}
|
@@ -567,9 +565,9 @@ export class ClammDynamicData {
|
|
567
565
|
const propToken0 = (BN2Number(c.campaignParameters.weightToken0, 4) / totalWeight) * 100;
|
568
566
|
const propToken1 = (BN2Number(c.campaignParameters.weightToken1, 4) / totalWeight) * 100;
|
569
567
|
let distributionMeanAPR = 0;
|
570
|
-
let blacklistedBalance0 =
|
571
|
-
let blacklistedBalance1 =
|
572
|
-
let blacklistedLiquidity =
|
568
|
+
let blacklistedBalance0 = 0;
|
569
|
+
let blacklistedBalance1 = 0;
|
570
|
+
let blacklistedLiquidity = 0;
|
573
571
|
/**
|
574
572
|
* @dev In case there is a super amm handling some other amm lp positions,
|
575
573
|
* we only need to check the positions associated to this super amm subgraph
|
@@ -622,12 +620,12 @@ export class ClammDynamicData {
|
|
622
620
|
catch {
|
623
621
|
log.warn(`merklDynamic data - failed to handle whitelisted positions of pool ${pool.address} on ${NETWORK_LABELS[chainId]} - ${pos.owner} ${pos.tickLower} ${pos.tickUpper} ${pos.liquidity}`);
|
624
622
|
}
|
625
|
-
blacklistedBalance0
|
626
|
-
blacklistedBalance1
|
623
|
+
blacklistedBalance0 -= BN2Number(amount0, decimalsToken0);
|
624
|
+
blacklistedBalance1 -= BN2Number(amount1, decimalsToken1);
|
627
625
|
if (c.campaignParameters.isOutOfRangeIncentivized
|
628
626
|
? BN2Number(amount0, decimalsToken0) > 0 || BN2Number(amount1, decimalsToken1) > 0
|
629
627
|
: BN2Number(amount0, decimalsToken0) > 0 && BN2Number(amount1, decimalsToken1) > 0)
|
630
|
-
blacklistedLiquidity
|
628
|
+
blacklistedLiquidity -= BN2Number(pos.liquidity);
|
631
629
|
}
|
632
630
|
// Handling the case of a ALM of priority 2 being whitelisted
|
633
631
|
else if (pos.pool.id === pool.address.toLowerCase() &&
|
@@ -649,32 +647,33 @@ export class ClammDynamicData {
|
|
649
647
|
catch {
|
650
648
|
log.warn(`merklDynamic data - failed to handle whitelisted positions of pool ${pool.address} on ${NETWORK_LABELS[chainId]} - ${pos.owner} ${pos.tickLower} ${pos.tickUpper} ${pos.liquidity}`);
|
651
649
|
}
|
652
|
-
blacklistedBalance0
|
653
|
-
|
650
|
+
blacklistedBalance0 -=
|
651
|
+
(BN2Number(amount0, decimalsToken0) * childALM.almBalance0) / almHolding.almBalance0;
|
652
|
+
blacklistedBalance1 -=
|
653
|
+
(BN2Number(amount1, decimalsToken1) * childALM.almBalance1) / almHolding.almBalance1;
|
654
654
|
if (c.campaignParameters.isOutOfRangeIncentivized
|
655
655
|
? BN2Number(amount0, decimalsToken0) > 0 || BN2Number(amount1, decimalsToken1) > 0
|
656
|
-
: BN2Number(amount0, decimalsToken0) > 0 && BN2Number(amount1, decimalsToken1) > 0)
|
657
|
-
blacklistedLiquidity
|
658
|
-
almHolding.almTotalLiquidity
|
659
|
-
}
|
656
|
+
: BN2Number(amount0, decimalsToken0) > 0 && BN2Number(amount1, decimalsToken1) > 0)
|
657
|
+
blacklistedLiquidity -=
|
658
|
+
(BN2Number(pos.liquidity) * childALM.almTotalLiquidity) / almHolding.almTotalLiquidity;
|
660
659
|
}
|
661
660
|
}
|
662
661
|
}
|
663
662
|
});
|
664
663
|
}
|
665
664
|
else if (c.campaignParameters.blacklist.length > 0) {
|
666
|
-
blacklistedBalance0 =
|
667
|
-
blacklistedBalance1 =
|
668
|
-
blacklistedLiquidity =
|
665
|
+
blacklistedBalance0 = 0;
|
666
|
+
blacklistedBalance1 = 0;
|
667
|
+
blacklistedLiquidity = 0;
|
669
668
|
for (const blacklistedAddress of c.campaignParameters.blacklist) {
|
670
669
|
const blackAddressPositions = positions?.[amm]?.filter(pos => pos.pool.id === pool.address.toLowerCase() && pos.owner === blacklistedAddress.toLowerCase());
|
671
670
|
if (!!blackAddressPositions) {
|
672
671
|
for (const position of blackAddressPositions) {
|
673
672
|
const [amount0, amount1] = getAmountsForLiquidity(sqrtPrice, Number.parseInt(position.tickLower), Number.parseInt(position.tickUpper), BigNumber.from(position.liquidity));
|
674
|
-
blacklistedBalance0
|
675
|
-
blacklistedBalance1
|
673
|
+
blacklistedBalance0 += BN2Number(amount0, decimalsToken0);
|
674
|
+
blacklistedBalance1 += BN2Number(amount1, decimalsToken1);
|
676
675
|
if (BN2Number(amount0, decimalsToken0) > 0 && BN2Number(amount1, decimalsToken1) > 0)
|
677
|
-
blacklistedLiquidity
|
676
|
+
blacklistedLiquidity += BN2Number(position.liquidity);
|
678
677
|
}
|
679
678
|
}
|
680
679
|
}
|
@@ -714,9 +713,9 @@ export class ClammDynamicData {
|
|
714
713
|
/**
|
715
714
|
* General APR (@notice potentially with a boost)
|
716
715
|
*/
|
717
|
-
const poolBalanceToken0WithoutBlacklist = Math.max(
|
718
|
-
const poolBalanceToken1WithoutBlacklist = Math.max(
|
719
|
-
const poolLiquidityWithoutBlacklist = Math.max(
|
716
|
+
const poolBalanceToken0WithoutBlacklist = Math.max(poolBalanceToken0 - (blacklistedBalance0 ?? 0), 0.00001);
|
717
|
+
const poolBalanceToken1WithoutBlacklist = Math.max(poolBalanceToken1 - (blacklistedBalance1 ?? 0), 0.00001);
|
718
|
+
const poolLiquidityWithoutBlacklist = Math.max(poolTotalLiquidity - (blacklistedLiquidity ?? 0), 0);
|
720
719
|
const tvl = isStrykeCampaign(amm)
|
721
720
|
? (await axios.get(`https://api.stryke.xyz/clamm/stats/tvl/${pool.address}?chainId=${chainId}`))
|
722
721
|
.data
|
@@ -876,8 +875,6 @@ export class ClammDynamicData {
|
|
876
875
|
]);
|
877
876
|
const rewardToken = rewardTokens[0];
|
878
877
|
distributionMeanAPR = rewardToken.isPoint ? distributionMeanAPR / 365 / 100 : distributionMeanAPR;
|
879
|
-
const poolBalanceToken0Number = BN2Number(poolBalanceToken0, decimalsToken0);
|
880
|
-
const poolBalanceToken1Number = BN2Number(poolBalanceToken1, decimalsToken1);
|
881
878
|
dynamicData.push({
|
882
879
|
...campaign,
|
883
880
|
amm: pool.amm,
|
@@ -887,15 +884,15 @@ export class ClammDynamicData {
|
|
887
884
|
apr: distributionMeanAPR,
|
888
885
|
aprs,
|
889
886
|
aprBreakdowns,
|
890
|
-
blacklistedBalance0
|
891
|
-
blacklistedBalance1
|
892
|
-
blacklistedLiquidity
|
887
|
+
blacklistedBalance0,
|
888
|
+
blacklistedBalance1,
|
889
|
+
blacklistedLiquidity,
|
893
890
|
forwarders: distributionForwarders,
|
894
891
|
isLive,
|
895
892
|
isMock: c.campaignParameters.symbolRewardToken === "aglaMerkl",
|
896
|
-
poolBalanceToken0
|
897
|
-
poolBalanceToken1
|
898
|
-
poolTotalLiquidity
|
893
|
+
poolBalanceToken0,
|
894
|
+
poolBalanceToken1,
|
895
|
+
poolTotalLiquidity,
|
899
896
|
symbolToken0,
|
900
897
|
symbolToken1,
|
901
898
|
tick: getTickAtSqrtRatio(JSBI.BigInt(sqrtPrice)),
|
@@ -903,7 +900,7 @@ export class ClammDynamicData {
|
|
903
900
|
tvl: isStrykeCampaign(pool.amm)
|
904
901
|
? (await axios.get(`https://api.stryke.xyz/clamm/stats/tvl/${pool.address}?chainId=${chainId}`))
|
905
902
|
.data
|
906
|
-
:
|
903
|
+
: poolBalanceToken0 * priceToken0 + poolBalanceToken1 * priceToken1,
|
907
904
|
});
|
908
905
|
}
|
909
906
|
}
|
package/dist/src/index.d.ts
CHANGED
@@ -4429,6 +4429,7 @@ declare const app: Elysia<"", false, {
|
|
4429
4429
|
body: unknown;
|
4430
4430
|
params: {};
|
4431
4431
|
query: {
|
4432
|
+
apr?: number | undefined;
|
4432
4433
|
creator: string;
|
4433
4434
|
campaign: string;
|
4434
4435
|
distributionChainId: number;
|
@@ -4461,6 +4462,7 @@ declare const app: Elysia<"", false, {
|
|
4461
4462
|
body: unknown;
|
4462
4463
|
params: {};
|
4463
4464
|
query: {
|
4465
|
+
apr?: number | undefined;
|
4464
4466
|
creator: string;
|
4465
4467
|
campaign: string;
|
4466
4468
|
distributionChainId: number;
|
@@ -4505,6 +4507,7 @@ declare const app: Elysia<"", false, {
|
|
4505
4507
|
body: unknown;
|
4506
4508
|
params: {};
|
4507
4509
|
query: {
|
4510
|
+
apr?: number | undefined;
|
4508
4511
|
creator: string;
|
4509
4512
|
campaign: string;
|
4510
4513
|
distributionChainId: number;
|
@@ -4531,6 +4534,7 @@ declare const app: Elysia<"", false, {
|
|
4531
4534
|
params: {};
|
4532
4535
|
query: {
|
4533
4536
|
amount?: string | undefined;
|
4537
|
+
apr?: number | undefined;
|
4534
4538
|
creator: string;
|
4535
4539
|
distributionChainId: number;
|
4536
4540
|
startTimestamp: number;
|
@@ -4565,6 +4569,7 @@ declare const app: Elysia<"", false, {
|
|
4565
4569
|
params: {};
|
4566
4570
|
query: {
|
4567
4571
|
amount?: string | undefined;
|
4572
|
+
apr?: number | undefined;
|
4568
4573
|
creator: string;
|
4569
4574
|
distributionChainId: number;
|
4570
4575
|
startTimestamp: number;
|
@@ -18,6 +18,7 @@ export declare const ProgramPayloadController: Elysia<"/program-payload", false,
|
|
18
18
|
body: unknown;
|
19
19
|
params: {};
|
20
20
|
query: {
|
21
|
+
apr?: number | undefined;
|
21
22
|
creator: string;
|
22
23
|
campaign: string;
|
23
24
|
distributionChainId: number;
|
@@ -50,6 +51,7 @@ export declare const ProgramPayloadController: Elysia<"/program-payload", false,
|
|
50
51
|
body: unknown;
|
51
52
|
params: {};
|
52
53
|
query: {
|
54
|
+
apr?: number | undefined;
|
53
55
|
creator: string;
|
54
56
|
campaign: string;
|
55
57
|
distributionChainId: number;
|
@@ -94,6 +96,7 @@ export declare const ProgramPayloadController: Elysia<"/program-payload", false,
|
|
94
96
|
body: unknown;
|
95
97
|
params: {};
|
96
98
|
query: {
|
99
|
+
apr?: number | undefined;
|
97
100
|
creator: string;
|
98
101
|
campaign: string;
|
99
102
|
distributionChainId: number;
|
@@ -120,6 +123,7 @@ export declare const ProgramPayloadController: Elysia<"/program-payload", false,
|
|
120
123
|
params: {};
|
121
124
|
query: {
|
122
125
|
amount?: string | undefined;
|
126
|
+
apr?: number | undefined;
|
123
127
|
creator: string;
|
124
128
|
distributionChainId: number;
|
125
129
|
startTimestamp: number;
|
@@ -154,6 +158,7 @@ export declare const ProgramPayloadController: Elysia<"/program-payload", false,
|
|
154
158
|
params: {};
|
155
159
|
query: {
|
156
160
|
amount?: string | undefined;
|
161
|
+
apr?: number | undefined;
|
157
162
|
creator: string;
|
158
163
|
distributionChainId: number;
|
159
164
|
startTimestamp: number;
|
@@ -8,6 +8,7 @@ export declare const CampaignPayloadInputDto: import("@sinclair/typebox").TObjec
|
|
8
8
|
startTimestamp: import("@sinclair/typebox").TNumber;
|
9
9
|
endTimestamp: import("@sinclair/typebox").TNumber;
|
10
10
|
amount: import("@sinclair/typebox").TString;
|
11
|
+
apr: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
11
12
|
}>;
|
12
13
|
export declare const CampaignDataDto: import("@sinclair/typebox").TObject<{
|
13
14
|
campaignType: import("@sinclair/typebox").TNumber;
|
@@ -62,6 +63,7 @@ export declare const ProgramPayloadInputDto: import("@sinclair/typebox").TObject
|
|
62
63
|
startTimestamp: import("@sinclair/typebox").TNumber;
|
63
64
|
endTimestamp: import("@sinclair/typebox").TNumber;
|
64
65
|
amount: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
66
|
+
apr: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
65
67
|
}>;
|
66
68
|
export declare const CampaignAmountsInputDto: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
|
67
69
|
export type CampaignPayloadInputModel = typeof CampaignPayloadInputDto.static;
|
@@ -150,6 +152,7 @@ export type partialConfigERC20 = {
|
|
150
152
|
blacklist: string[];
|
151
153
|
url?: string;
|
152
154
|
forwarders: ForwarderParameters<Forwarder>[];
|
155
|
+
apr?: number;
|
153
156
|
};
|
154
157
|
export type partialConfigMorpho = {
|
155
158
|
computeChainId?: MerklChainId;
|
@@ -9,6 +9,7 @@ export const CampaignPayloadInputDto = t.Object({
|
|
9
9
|
startTimestamp: t.Numeric({ description: "Start timestamp for the campaign" }),
|
10
10
|
endTimestamp: t.Numeric({ description: "End timestamp for the campaign" }),
|
11
11
|
amount: t.String({ description: "Amount of the reward token to be distributed" }),
|
12
|
+
apr: t.Optional(t.Numeric({ description: "APR for the campaign (Fixed APR campaigns)" })),
|
12
13
|
});
|
13
14
|
export const CampaignDataDto = t.Object({
|
14
15
|
campaignType: t.Numeric({ description: "Type of the campaign 1 : ERC20, 2: CLAMM , ..." }),
|
@@ -63,6 +64,7 @@ export const ProgramPayloadInputDto = t.Object({
|
|
63
64
|
startTimestamp: t.Numeric({ description: "Start timestamp for the campaign" }),
|
64
65
|
endTimestamp: t.Numeric({ description: "End timestamp for the campaign" }),
|
65
66
|
amount: t.Optional(t.String({ description: "Amount of the reward token to be distributed" })),
|
67
|
+
apr: t.Optional(t.Numeric({ description: "APR for the campaign (Fixed APR campaigns)" })),
|
66
68
|
});
|
67
69
|
export const CampaignAmountsInputDto = t.Record(t.String(), t.String());
|
68
70
|
// ---- Template below ----
|
@@ -11,7 +11,8 @@ export declare enum program {
|
|
11
11
|
Swapx = "Swapx",
|
12
12
|
Etherlink = "Etherlink",
|
13
13
|
Angles = "Angles",
|
14
|
-
Ronin = "Ronin"
|
14
|
+
Ronin = "Ronin",
|
15
|
+
TAC = "TAC"
|
15
16
|
}
|
16
17
|
export declare enum roninCampaigns {
|
17
18
|
Katana_WETH_RON_Ronin = "Katana WETH-RON Ronin 0x90f31f1907a4d1443a6aacdc91ac2312f91bafa7",
|
@@ -476,6 +477,11 @@ declare const RoninInterfaceCampaigns: {
|
|
476
477
|
weightToken1: number;
|
477
478
|
};
|
478
479
|
};
|
480
|
+
export declare enum tacCampaigns {
|
481
|
+
TAC_Supply_TACETH = "TAC Supply tacETH 0x294eecec65A0142e84AEdfD8eB2FBEA8c9a9fbad",
|
482
|
+
TAC_Supply_TACBTC = "TAC Supply tacBTC 0x6Bf340dB729d82af1F6443A0Ea0d79647b1c3DDf",
|
483
|
+
TAC_Supply_TACUSD = "TAC Supply tacUSD 0x699e04F98dE2Fc395a7dcBf36B48EC837A976490"
|
484
|
+
}
|
479
485
|
declare const AnglesInterfaceCampaigns: {
|
480
486
|
"0x15E96CDecA34B9DE1B31586c1206206aDb92E69D": {
|
481
487
|
campaignType: any;
|
@@ -1034,7 +1040,51 @@ declare const ZkSyncInterfaceCampaigns: {
|
|
1034
1040
|
declare const PufferInterfaceCampaigns: {
|
1035
1041
|
[key in pufferCampaigns]: partialConfig;
|
1036
1042
|
};
|
1043
|
+
declare const TACInterfaceCampaigns: {
|
1044
|
+
"TAC Supply tacETH 0x294eecec65A0142e84AEdfD8eB2FBEA8c9a9fbad": {
|
1045
|
+
campaignType: any;
|
1046
|
+
computeChainId: any;
|
1047
|
+
distributionChainId: any;
|
1048
|
+
targetToken: string;
|
1049
|
+
rewardToken: string;
|
1050
|
+
hooks: never[];
|
1051
|
+
whitelist: never[];
|
1052
|
+
blacklist: never[];
|
1053
|
+
forwarders: never[];
|
1054
|
+
rewardTokenPricing: boolean;
|
1055
|
+
targetTokenPricing: boolean;
|
1056
|
+
apr: number;
|
1057
|
+
};
|
1058
|
+
"TAC Supply tacBTC 0x6Bf340dB729d82af1F6443A0Ea0d79647b1c3DDf": {
|
1059
|
+
campaignType: any;
|
1060
|
+
computeChainId: any;
|
1061
|
+
distributionChainId: any;
|
1062
|
+
targetToken: string;
|
1063
|
+
rewardToken: string;
|
1064
|
+
hooks: never[];
|
1065
|
+
whitelist: never[];
|
1066
|
+
blacklist: never[];
|
1067
|
+
forwarders: never[];
|
1068
|
+
rewardTokenPricing: boolean;
|
1069
|
+
targetTokenPricing: boolean;
|
1070
|
+
apr: number;
|
1071
|
+
};
|
1072
|
+
"TAC Supply tacUSD 0x699e04F98dE2Fc395a7dcBf36B48EC837A976490": {
|
1073
|
+
campaignType: any;
|
1074
|
+
computeChainId: any;
|
1075
|
+
distributionChainId: any;
|
1076
|
+
targetToken: string;
|
1077
|
+
rewardToken: string;
|
1078
|
+
hooks: never[];
|
1079
|
+
whitelist: never[];
|
1080
|
+
blacklist: never[];
|
1081
|
+
forwarders: never[];
|
1082
|
+
rewardTokenPricing: boolean;
|
1083
|
+
targetTokenPricing: boolean;
|
1084
|
+
apr: number;
|
1085
|
+
};
|
1086
|
+
};
|
1037
1087
|
export declare const MerklInterfaceCampaigns: {
|
1038
|
-
[key in program]: typeof PufferInterfaceCampaigns | typeof ZkSyncInterfaceCampaigns | typeof ModeInterfaceCampaigns | typeof VicunaInterfaceCampaigns | typeof SonicmarketInterfaceCampaigns | typeof ReserveInterfaceCampaigns | typeof BeetsInterfaceCampaigns | typeof CeloInterfaceCampaigns | typeof EtherlinkInterfaceCampaigns | typeof SwapxInterfaceCampaigns | typeof AnglesInterfaceCampaigns | typeof RoninInterfaceCampaigns;
|
1088
|
+
[key in program]: typeof PufferInterfaceCampaigns | typeof ZkSyncInterfaceCampaigns | typeof ModeInterfaceCampaigns | typeof VicunaInterfaceCampaigns | typeof SonicmarketInterfaceCampaigns | typeof ReserveInterfaceCampaigns | typeof BeetsInterfaceCampaigns | typeof CeloInterfaceCampaigns | typeof EtherlinkInterfaceCampaigns | typeof SwapxInterfaceCampaigns | typeof AnglesInterfaceCampaigns | typeof RoninInterfaceCampaigns | typeof TACInterfaceCampaigns;
|
1039
1089
|
};
|
1040
1090
|
export {};
|