@merkl/api 0.20.63 → 0.20.65
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/database/index.js +5 -1
- package/dist/src/eden/index.d.ts +115 -214
- package/dist/src/engine/dynamicData/implementations/Erc20.js +80 -42
- package/dist/src/engine/erc20SubTypeProcessors/GenericProcessor.d.ts +18 -18
- package/dist/src/engine/erc20SubTypeProcessors/GenericProcessor.js +33 -30
- package/dist/src/engine/erc20SubTypeProcessors/{helpers/tokenType.d.ts → constants.d.ts} +0 -6
- package/dist/src/engine/erc20SubTypeProcessors/factory.d.ts +6 -0
- package/dist/src/engine/erc20SubTypeProcessors/{implementations/processorMapping.js → factory.js} +49 -48
- package/dist/src/engine/erc20SubTypeProcessors/helpers/factoryFinder.d.ts +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/helpers/factoryFinder.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/helpers/hardcoded.d.ts +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/helpers/hardcoded.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/helpers/ownerFinder.d.ts +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/helpers/ownerFinder.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AaveProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AaveProcessor.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AnglesLiquid.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AnglesLiquid.js +1 -5
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AssetProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AssetProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AuraProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AuraProcessor.js +6 -7
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.js +4 -5
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerGaugeProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerGaugeProcessor.js +3 -4
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerPoolProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerPoolProcessor.js +3 -4
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerV3PoolProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerV3PoolProcessor.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BeefyProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BeefyProcessor.js +3 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BunniV2Processor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BunniV2Processor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/CompoundProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/CompoundProcessor.js +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/ERC4626Processor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/ERC4626Processor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EnzymeProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EnzymeProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EqualizerGaugeProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EqualizerGaugeProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerBorrowProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerBorrowProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerLendProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerLendProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/FluidProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/FluidProcessor.js +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/FraxProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/FraxProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/GammaProcessor.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/GammaProcessor.js +1 -4
- package/dist/src/engine/erc20SubTypeProcessors/implementations/GearboxProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/GearboxProcessor.js +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HanjiVaultProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HanjiVaultProcessor.js +4 -5
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HoldStationProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HoldStationProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HourglassProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HourglassProcessor.js +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/MaverickBPProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/MaverickBPProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/MetamorphoProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/MetamorphoProcessor.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/NoLinkVaultProcessor.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/NoLinkVaultProcessor.js +3 -6
- package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleYTProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleYTProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/RadiantProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/RadiantProcessor.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/RfxProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/RfxProcessor.js +5 -6
- package/dist/src/engine/erc20SubTypeProcessors/implementations/Satlayer.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/Satlayer.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraYTProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraYTProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpliceProcessor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpliceProcessor.js +0 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SturdySiloProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SturdySiloProcessor.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TempestVaultProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TempestVaultProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TemplateProcessor.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TemplateProcessor.js +0 -4
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TorosProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TorosProcessor.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/UniswapProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/UniswapProcessor.js +3 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/VicunaProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/VicunaProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/WoofiProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/WoofiProcessor.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/ZkSwapThreePoolProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/ZkSwapThreePoolProcessor.js +7 -7
- package/dist/src/engine/erc20SubTypeProcessors/implementations/curveNPoolProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/curveNPoolProcessor.js +5 -6
- package/dist/src/engine/erc20SubTypeProcessors/implementations/curveProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/curveProcessor.js +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/stakedCurveProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/stakedCurveProcessor.js +3 -4
- package/dist/src/engine/erc20SubTypeProcessors/implementations/xU308Processor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/xU308Processor.js +3 -4
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound1.d.ts +17 -3
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound1.js +52 -62
- package/dist/src/engine/opportunityMetadata/implementations/JsonAirdrop.js +1 -1
- package/dist/src/index.d.ts +23 -50
- package/dist/src/jobs/update-dynamic-data.js +10 -12
- package/dist/src/jobs/update-rpc-calls-cache.js +9 -4
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +23 -50
- package/dist/src/modules/v4/opportunity/opportunity.controller.js +1 -9
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +0 -11
- package/dist/src/modules/v4/opportunity/opportunity.model.js +0 -5
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +2 -2
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +25 -14
- package/dist/src/modules/v4/opportunity/opportunity.service.js +2 -1
- package/dist/src/modules/v4/router.d.ts +23 -50
- package/dist/src/utils/decodeCalls.d.ts +1 -1
- package/dist/src/utils/decodeCalls.js +1 -1
- package/dist/src/utils/encodeCalls.d.ts +2 -2
- package/dist/src/utils/encodeCalls.js +15 -15
- package/dist/src/utils/generateCardName.d.ts +4 -3
- package/dist/src/utils/generateCardName.js +3 -3
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/processorMapping.d.ts +0 -6
- package/dist/src/engine/erc20SubTypeProcessors/subtypesPrices.d.ts +0 -4
- package/dist/src/engine/erc20SubTypeProcessors/subtypesPrices.js +0 -24
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound2.d.ts +0 -4
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound2.js +0 -22
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound3.d.ts +0 -3
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound3.js +0 -22
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound4.d.ts +0 -3
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound4.js +0 -22
- package/dist/src/utils/generateIcons.d.ts +0 -3
- package/dist/src/utils/generateIcons.js +0 -65
- /package/dist/src/engine/erc20SubTypeProcessors/{helpers/tokenType.js → constants.js} +0 -0
package/dist/database/index.js
CHANGED
@@ -2,7 +2,11 @@ import { PrismaClient as ApiPrismaClient } from "@db/api";
|
|
2
2
|
import { PrismaClient as EnginePrismaClient } from "@db/engine";
|
3
3
|
import { drizzle } from "drizzle-orm/prisma/pg";
|
4
4
|
export const apiDbClient = new ApiPrismaClient({
|
5
|
-
datasources: {
|
5
|
+
datasources: {
|
6
|
+
db: {
|
7
|
+
url: `${process.env.DATABASE_API_URL}&connection_limit=${!!process.env.BACKOFFICE_SECRET ? "100" : "10"}&pool_timeout=60`,
|
8
|
+
},
|
9
|
+
},
|
6
10
|
}).$extends(drizzle());
|
7
11
|
export const engineDbClient = new EnginePrismaClient({
|
8
12
|
datasources: {
|
package/dist/src/eden/index.d.ts
CHANGED
@@ -140,20 +140,31 @@ declare const eden: {
|
|
140
140
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
141
141
|
200: {
|
142
142
|
id: string;
|
143
|
-
|
143
|
+
chainId: number;
|
144
144
|
type: string;
|
145
|
-
status: import("@db/api").$Enums.Status;
|
146
|
-
tags: string[];
|
147
145
|
identifier: string;
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
146
|
+
name: string;
|
147
|
+
status: "PAST" | "LIVE" | "SOON";
|
148
|
+
action: any;
|
149
|
+
tokens: ({
|
150
|
+
symbol: string;
|
151
|
+
id: string;
|
152
|
+
name: string | null;
|
153
|
+
icon: string;
|
154
|
+
address: string;
|
155
|
+
chainId: number;
|
156
|
+
decimals: number;
|
157
|
+
verified: boolean;
|
158
|
+
isTest: boolean;
|
159
|
+
isPoint: boolean;
|
160
|
+
isNative: boolean;
|
161
|
+
} & {
|
162
|
+
price?: number | null | undefined;
|
163
|
+
})[];
|
164
|
+
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
|
165
|
+
depositUrl: any;
|
166
|
+
explorerAddress: string | undefined;
|
167
|
+
tags: string[];
|
157
168
|
};
|
158
169
|
}>>;
|
159
170
|
};
|
@@ -456,35 +467,6 @@ declare const eden: {
|
|
456
467
|
};
|
457
468
|
}>>;
|
458
469
|
};
|
459
|
-
patch: (body: {
|
460
|
-
name?: string | undefined;
|
461
|
-
status?: "NONE" | "PAST" | "LIVE" | "SOON" | undefined;
|
462
|
-
tags?: string[] | undefined;
|
463
|
-
}, options: {
|
464
|
-
headers: {
|
465
|
-
authorization: string;
|
466
|
-
};
|
467
|
-
query?: Record<string, unknown> | undefined;
|
468
|
-
fetch?: RequestInit | undefined;
|
469
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
470
|
-
200: {
|
471
|
-
id: string;
|
472
|
-
name: string;
|
473
|
-
type: string;
|
474
|
-
status: import("@db/api").$Enums.Status;
|
475
|
-
tags: string[];
|
476
|
-
identifier: string;
|
477
|
-
action: import("@db/api").$Enums.OpportunityAction;
|
478
|
-
manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
|
479
|
-
chainId: number;
|
480
|
-
depositUrl: string | null;
|
481
|
-
explorerAddress: string | null;
|
482
|
-
mainProtocolId: string | null;
|
483
|
-
tvl: number;
|
484
|
-
apr: number;
|
485
|
-
dailyRewards: number;
|
486
|
-
};
|
487
|
-
}>>;
|
488
470
|
}) & {
|
489
471
|
index: {
|
490
472
|
post: (body: {
|
@@ -4173,20 +4155,31 @@ declare const eden: {
|
|
4173
4155
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
4174
4156
|
200: {
|
4175
4157
|
id: string;
|
4176
|
-
|
4158
|
+
chainId: number;
|
4177
4159
|
type: string;
|
4178
|
-
status: import("@db/api").$Enums.Status;
|
4179
|
-
tags: string[];
|
4180
4160
|
identifier: string;
|
4181
|
-
|
4182
|
-
|
4183
|
-
|
4184
|
-
|
4185
|
-
|
4186
|
-
|
4187
|
-
|
4188
|
-
|
4189
|
-
|
4161
|
+
name: string;
|
4162
|
+
status: "PAST" | "LIVE" | "SOON";
|
4163
|
+
action: any;
|
4164
|
+
tokens: ({
|
4165
|
+
symbol: string;
|
4166
|
+
id: string;
|
4167
|
+
name: string | null;
|
4168
|
+
icon: string;
|
4169
|
+
address: string;
|
4170
|
+
chainId: number;
|
4171
|
+
decimals: number;
|
4172
|
+
verified: boolean;
|
4173
|
+
isTest: boolean;
|
4174
|
+
isPoint: boolean;
|
4175
|
+
isNative: boolean;
|
4176
|
+
} & {
|
4177
|
+
price?: number | null | undefined;
|
4178
|
+
})[];
|
4179
|
+
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
|
4180
|
+
depositUrl: any;
|
4181
|
+
explorerAddress: string | undefined;
|
4182
|
+
tags: string[];
|
4190
4183
|
};
|
4191
4184
|
}>>;
|
4192
4185
|
};
|
@@ -4489,35 +4482,6 @@ declare const eden: {
|
|
4489
4482
|
};
|
4490
4483
|
}>>;
|
4491
4484
|
};
|
4492
|
-
patch: (body: {
|
4493
|
-
name?: string | undefined;
|
4494
|
-
status?: "NONE" | "PAST" | "LIVE" | "SOON" | undefined;
|
4495
|
-
tags?: string[] | undefined;
|
4496
|
-
}, options: {
|
4497
|
-
headers: {
|
4498
|
-
authorization: string;
|
4499
|
-
};
|
4500
|
-
query?: Record<string, unknown> | undefined;
|
4501
|
-
fetch?: RequestInit | undefined;
|
4502
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
4503
|
-
200: {
|
4504
|
-
id: string;
|
4505
|
-
name: string;
|
4506
|
-
type: string;
|
4507
|
-
status: import("@db/api").$Enums.Status;
|
4508
|
-
tags: string[];
|
4509
|
-
identifier: string;
|
4510
|
-
action: import("@db/api").$Enums.OpportunityAction;
|
4511
|
-
manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
|
4512
|
-
chainId: number;
|
4513
|
-
depositUrl: string | null;
|
4514
|
-
explorerAddress: string | null;
|
4515
|
-
mainProtocolId: string | null;
|
4516
|
-
tvl: number;
|
4517
|
-
apr: number;
|
4518
|
-
dailyRewards: number;
|
4519
|
-
};
|
4520
|
-
}>>;
|
4521
4485
|
}) & {
|
4522
4486
|
index: {
|
4523
4487
|
post: (body: {
|
@@ -9042,20 +9006,31 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
9042
9006
|
response: {
|
9043
9007
|
200: {
|
9044
9008
|
id: string;
|
9045
|
-
|
9009
|
+
chainId: number;
|
9046
9010
|
type: string;
|
9047
|
-
status: import("@db/api").$Enums.Status;
|
9048
|
-
tags: string[];
|
9049
9011
|
identifier: string;
|
9050
|
-
|
9051
|
-
|
9052
|
-
|
9053
|
-
|
9054
|
-
|
9055
|
-
|
9056
|
-
|
9057
|
-
|
9058
|
-
|
9012
|
+
name: string;
|
9013
|
+
status: "PAST" | "LIVE" | "SOON";
|
9014
|
+
action: any;
|
9015
|
+
tokens: ({
|
9016
|
+
symbol: string;
|
9017
|
+
id: string;
|
9018
|
+
name: string | null;
|
9019
|
+
icon: string;
|
9020
|
+
address: string;
|
9021
|
+
chainId: number;
|
9022
|
+
decimals: number;
|
9023
|
+
verified: boolean;
|
9024
|
+
isTest: boolean;
|
9025
|
+
isPoint: boolean;
|
9026
|
+
isNative: boolean;
|
9027
|
+
} & {
|
9028
|
+
price?: number | null | undefined;
|
9029
|
+
})[];
|
9030
|
+
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
|
9031
|
+
depositUrl: any;
|
9032
|
+
explorerAddress: string | undefined;
|
9033
|
+
tags: string[];
|
9059
9034
|
};
|
9060
9035
|
};
|
9061
9036
|
};
|
@@ -9939,44 +9914,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
9939
9914
|
};
|
9940
9915
|
};
|
9941
9916
|
};
|
9942
|
-
} & {
|
9943
|
-
opportunities: {
|
9944
|
-
":id": {
|
9945
|
-
patch: {
|
9946
|
-
body: {
|
9947
|
-
name?: string | undefined;
|
9948
|
-
status?: "NONE" | "PAST" | "LIVE" | "SOON" | undefined;
|
9949
|
-
tags?: string[] | undefined;
|
9950
|
-
};
|
9951
|
-
params: {
|
9952
|
-
id: string;
|
9953
|
-
};
|
9954
|
-
query: unknown;
|
9955
|
-
headers: {
|
9956
|
-
authorization: string;
|
9957
|
-
};
|
9958
|
-
response: {
|
9959
|
-
200: {
|
9960
|
-
id: string;
|
9961
|
-
name: string;
|
9962
|
-
type: string;
|
9963
|
-
status: import("@db/api").$Enums.Status;
|
9964
|
-
tags: string[];
|
9965
|
-
identifier: string;
|
9966
|
-
action: import("@db/api").$Enums.OpportunityAction;
|
9967
|
-
manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
|
9968
|
-
chainId: number;
|
9969
|
-
depositUrl: string | null;
|
9970
|
-
explorerAddress: string | null;
|
9971
|
-
mainProtocolId: string | null;
|
9972
|
-
tvl: number;
|
9973
|
-
apr: number;
|
9974
|
-
dailyRewards: number;
|
9975
|
-
};
|
9976
|
-
};
|
9977
|
-
};
|
9978
|
-
};
|
9979
|
-
};
|
9980
9917
|
};
|
9981
9918
|
} & {
|
9982
9919
|
v4: {
|
@@ -14900,20 +14837,31 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
14900
14837
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
14901
14838
|
200: {
|
14902
14839
|
id: string;
|
14903
|
-
|
14840
|
+
chainId: number;
|
14904
14841
|
type: string;
|
14905
|
-
status: import("@db/api").$Enums.Status;
|
14906
|
-
tags: string[];
|
14907
14842
|
identifier: string;
|
14908
|
-
|
14909
|
-
|
14910
|
-
|
14911
|
-
|
14912
|
-
|
14913
|
-
|
14914
|
-
|
14915
|
-
|
14916
|
-
|
14843
|
+
name: string;
|
14844
|
+
status: "PAST" | "LIVE" | "SOON";
|
14845
|
+
action: any;
|
14846
|
+
tokens: ({
|
14847
|
+
symbol: string;
|
14848
|
+
id: string;
|
14849
|
+
name: string | null;
|
14850
|
+
icon: string;
|
14851
|
+
address: string;
|
14852
|
+
chainId: number;
|
14853
|
+
decimals: number;
|
14854
|
+
verified: boolean;
|
14855
|
+
isTest: boolean;
|
14856
|
+
isPoint: boolean;
|
14857
|
+
isNative: boolean;
|
14858
|
+
} & {
|
14859
|
+
price?: number | null | undefined;
|
14860
|
+
})[];
|
14861
|
+
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
|
14862
|
+
depositUrl: any;
|
14863
|
+
explorerAddress: string | undefined;
|
14864
|
+
tags: string[];
|
14917
14865
|
};
|
14918
14866
|
}>>;
|
14919
14867
|
};
|
@@ -15216,35 +15164,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
15216
15164
|
};
|
15217
15165
|
}>>;
|
15218
15166
|
};
|
15219
|
-
patch: (body: {
|
15220
|
-
name?: string | undefined;
|
15221
|
-
status?: "NONE" | "PAST" | "LIVE" | "SOON" | undefined;
|
15222
|
-
tags?: string[] | undefined;
|
15223
|
-
}, options: {
|
15224
|
-
headers: {
|
15225
|
-
authorization: string;
|
15226
|
-
};
|
15227
|
-
query?: Record<string, unknown> | undefined;
|
15228
|
-
fetch?: RequestInit | undefined;
|
15229
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
15230
|
-
200: {
|
15231
|
-
id: string;
|
15232
|
-
name: string;
|
15233
|
-
type: string;
|
15234
|
-
status: import("@db/api").$Enums.Status;
|
15235
|
-
tags: string[];
|
15236
|
-
identifier: string;
|
15237
|
-
action: import("@db/api").$Enums.OpportunityAction;
|
15238
|
-
manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
|
15239
|
-
chainId: number;
|
15240
|
-
depositUrl: string | null;
|
15241
|
-
explorerAddress: string | null;
|
15242
|
-
mainProtocolId: string | null;
|
15243
|
-
tvl: number;
|
15244
|
-
apr: number;
|
15245
|
-
dailyRewards: number;
|
15246
|
-
};
|
15247
|
-
}>>;
|
15248
15167
|
}) & {
|
15249
15168
|
index: {
|
15250
15169
|
post: (body: {
|
@@ -18933,20 +18852,31 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
18933
18852
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
18934
18853
|
200: {
|
18935
18854
|
id: string;
|
18936
|
-
|
18855
|
+
chainId: number;
|
18937
18856
|
type: string;
|
18938
|
-
status: import("@db/api").$Enums.Status;
|
18939
|
-
tags: string[];
|
18940
18857
|
identifier: string;
|
18941
|
-
|
18942
|
-
|
18943
|
-
|
18944
|
-
|
18945
|
-
|
18946
|
-
|
18947
|
-
|
18948
|
-
|
18949
|
-
|
18858
|
+
name: string;
|
18859
|
+
status: "PAST" | "LIVE" | "SOON";
|
18860
|
+
action: any;
|
18861
|
+
tokens: ({
|
18862
|
+
symbol: string;
|
18863
|
+
id: string;
|
18864
|
+
name: string | null;
|
18865
|
+
icon: string;
|
18866
|
+
address: string;
|
18867
|
+
chainId: number;
|
18868
|
+
decimals: number;
|
18869
|
+
verified: boolean;
|
18870
|
+
isTest: boolean;
|
18871
|
+
isPoint: boolean;
|
18872
|
+
isNative: boolean;
|
18873
|
+
} & {
|
18874
|
+
price?: number | null | undefined;
|
18875
|
+
})[];
|
18876
|
+
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
|
18877
|
+
depositUrl: any;
|
18878
|
+
explorerAddress: string | undefined;
|
18879
|
+
tags: string[];
|
18950
18880
|
};
|
18951
18881
|
}>>;
|
18952
18882
|
};
|
@@ -19249,35 +19179,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
19249
19179
|
};
|
19250
19180
|
}>>;
|
19251
19181
|
};
|
19252
|
-
patch: (body: {
|
19253
|
-
name?: string | undefined;
|
19254
|
-
status?: "NONE" | "PAST" | "LIVE" | "SOON" | undefined;
|
19255
|
-
tags?: string[] | undefined;
|
19256
|
-
}, options: {
|
19257
|
-
headers: {
|
19258
|
-
authorization: string;
|
19259
|
-
};
|
19260
|
-
query?: Record<string, unknown> | undefined;
|
19261
|
-
fetch?: RequestInit | undefined;
|
19262
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
19263
|
-
200: {
|
19264
|
-
id: string;
|
19265
|
-
name: string;
|
19266
|
-
type: string;
|
19267
|
-
status: import("@db/api").$Enums.Status;
|
19268
|
-
tags: string[];
|
19269
|
-
identifier: string;
|
19270
|
-
action: import("@db/api").$Enums.OpportunityAction;
|
19271
|
-
manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
|
19272
|
-
chainId: number;
|
19273
|
-
depositUrl: string | null;
|
19274
|
-
explorerAddress: string | null;
|
19275
|
-
mainProtocolId: string | null;
|
19276
|
-
tvl: number;
|
19277
|
-
apr: number;
|
19278
|
-
dailyRewards: number;
|
19279
|
-
};
|
19280
|
-
}>>;
|
19281
19182
|
}) & {
|
19282
19183
|
index: {
|
19283
19184
|
post: (body: {
|
@@ -1,9 +1,6 @@
|
|
1
|
-
import { tokenType } from "@/engine/erc20SubTypeProcessors/
|
2
|
-
import {
|
1
|
+
import { tokenType } from "@/engine/erc20SubTypeProcessors/constants";
|
2
|
+
import { erc20ProcessorFactory } from "@/engine/erc20SubTypeProcessors/factory";
|
3
3
|
import { getTokenTypeRound1 } from "@/engine/erc20SubTypeProcessors/subtypesRound1";
|
4
|
-
import { getTokenTypeRound2 } from "@/engine/erc20SubTypeProcessors/subtypesRound2";
|
5
|
-
import { getTokenTypeRound3 } from "@/engine/erc20SubTypeProcessors/subtypesRound3";
|
6
|
-
import { getTokenTypeRound4 } from "@/engine/erc20SubTypeProcessors/subtypesRound4";
|
7
4
|
import { ComputedValueService } from "@/modules/v4/computedValue";
|
8
5
|
import { TokenRepository } from "@/modules/v4/token/token.repository";
|
9
6
|
import { TokenService } from "@/modules/v4/token/token.service";
|
@@ -16,12 +13,13 @@ export class Erc20DynamicData {
|
|
16
13
|
const pricer = await Pricer.load();
|
17
14
|
// Round 1: Get the high level type for each token (will need to be refined lated with more calls)
|
18
15
|
const callsRounds1 = [];
|
19
|
-
const
|
16
|
+
const tokenTypeDataByCampaign = {};
|
20
17
|
for (const campaign of campaigns) {
|
21
18
|
const typeStruct = {
|
22
19
|
type: tokenType.unknown,
|
23
20
|
calls: [],
|
24
21
|
typeInfo: {},
|
22
|
+
processor: erc20ProcessorFactory(tokenType.unknown, campaign),
|
25
23
|
};
|
26
24
|
const targetToken = campaign.campaignParameters.targetToken;
|
27
25
|
typeStruct.calls = [
|
@@ -62,74 +60,114 @@ export class Erc20DynamicData {
|
|
62
60
|
},
|
63
61
|
];
|
64
62
|
callsRounds1.push(...typeStruct.calls);
|
65
|
-
|
63
|
+
tokenTypeDataByCampaign[campaign.campaignId] = typeStruct;
|
66
64
|
}
|
67
|
-
const resultRound1 = await ChainInteractionService(chainId).fetchState(callsRounds1);
|
65
|
+
const resultRound1 = (await ChainInteractionService(chainId).fetchState(callsRounds1)).map(x => x.returnData);
|
68
66
|
// Round 2: Decode result from round 1 and get some additional info for the types before the final calls
|
69
67
|
const callsRounds2 = [];
|
70
68
|
let i = 0;
|
71
69
|
for (const campaign of campaigns) {
|
72
|
-
const
|
73
|
-
|
70
|
+
const tokenTypeData = tokenTypeDataByCampaign[campaign.campaignId];
|
71
|
+
const callsForCampaign = tokenTypeData.calls.length;
|
72
|
+
const res = getTokenTypeRound1(resultRound1, i, campaign); // TODO use processor
|
73
|
+
tokenTypeData.calls = res.calls;
|
74
|
+
tokenTypeData.typeInfo = res.typeInfo;
|
75
|
+
tokenTypeData.processor = erc20ProcessorFactory(res.type, campaign);
|
74
76
|
i += callsForCampaign;
|
75
|
-
callsRounds2.push(...
|
77
|
+
callsRounds2.push(...tokenTypeDataByCampaign[campaign.campaignId].calls);
|
76
78
|
}
|
77
|
-
const resultRound2 = await ChainInteractionService(chainId).fetchState(callsRounds2);
|
79
|
+
const resultRound2 = (await ChainInteractionService(chainId).fetchState(callsRounds2)).map(x => x.returnData);
|
78
80
|
// Round 3: Decode result from round 2 and get some additional info for the types before the final calls
|
79
81
|
const callsRounds3 = [];
|
80
82
|
let j = 0;
|
81
83
|
for (const campaign of campaigns) {
|
82
|
-
|
83
|
-
const
|
84
|
-
|
84
|
+
const { processor, typeInfo } = tokenTypeDataByCampaign[campaign.campaignId];
|
85
|
+
const tokenTypeData = tokenTypeDataByCampaign[campaign.campaignId];
|
86
|
+
const callsForCampaign = tokenTypeData.calls.length;
|
87
|
+
try {
|
88
|
+
const res = await processor.computeRound2(j, processor.type, typeInfo, resultRound2, campaign);
|
89
|
+
tokenTypeData.calls = res.calls;
|
90
|
+
tokenTypeData.typeInfo = res.typeInfo;
|
91
|
+
}
|
92
|
+
catch {
|
93
|
+
// In case something goes wrong, we set following calls to void an move on
|
94
|
+
tokenTypeData.calls = [];
|
95
|
+
tokenTypeData.typeInfo = typeInfo;
|
96
|
+
}
|
85
97
|
j += callsForCampaign;
|
86
|
-
callsRounds3.push(...
|
98
|
+
callsRounds3.push(...tokenTypeDataByCampaign[campaign.campaignId].calls);
|
87
99
|
}
|
88
|
-
const resultRound3 = await ChainInteractionService(chainId).fetchState(callsRounds3);
|
100
|
+
const resultRound3 = (await ChainInteractionService(chainId).fetchState(callsRounds3)).map(x => x.returnData);
|
89
101
|
// Final round before execute
|
90
|
-
let
|
102
|
+
let callsRounds4 = [];
|
91
103
|
j = 0;
|
92
104
|
for (const campaign of campaigns) {
|
93
|
-
const
|
94
|
-
|
105
|
+
const { processor, typeInfo } = tokenTypeDataByCampaign[campaign.campaignId];
|
106
|
+
const tokenTypeData = tokenTypeDataByCampaign[campaign.campaignId];
|
107
|
+
const callsForCampaign = tokenTypeData.calls.length;
|
108
|
+
try {
|
109
|
+
const res = await processor.computeRound3(j, processor.type, typeInfo, resultRound3);
|
110
|
+
tokenTypeData.calls = res.calls;
|
111
|
+
tokenTypeData.typeInfo = res.typeInfo;
|
112
|
+
}
|
113
|
+
catch {
|
114
|
+
// In case something goes wrong, we set following calls to void an move on
|
115
|
+
tokenTypeData.calls = [];
|
116
|
+
tokenTypeData.typeInfo = typeInfo;
|
117
|
+
}
|
95
118
|
j += callsForCampaign;
|
96
|
-
|
119
|
+
callsRounds4 = callsRounds4.concat(tokenTypeDataByCampaign[campaign.campaignId].calls);
|
97
120
|
}
|
98
121
|
// Round 4: Get the final data
|
99
|
-
const
|
122
|
+
const resultRound4 = (await ChainInteractionService(chainId).fetchState(callsRounds4)).map(x => x.returnData);
|
100
123
|
j = 0;
|
101
124
|
let calls = [];
|
102
125
|
for (const campaign of campaigns) {
|
103
|
-
const
|
104
|
-
|
126
|
+
const { processor, typeInfo } = tokenTypeDataByCampaign[campaign.campaignId];
|
127
|
+
const tokenTypeData = tokenTypeDataByCampaign[campaign.campaignId];
|
128
|
+
const callsForCampaign = tokenTypeData.calls.length;
|
129
|
+
try {
|
130
|
+
const res = await processor.computeRound4(j, processor.type, typeInfo, resultRound4, campaign);
|
131
|
+
tokenTypeData.calls = res.calls;
|
132
|
+
tokenTypeData.typeInfo = res.typeInfo;
|
133
|
+
}
|
134
|
+
catch {
|
135
|
+
// In case something goes wrong, we set following calls to void an move on
|
136
|
+
tokenTypeData.calls = [];
|
137
|
+
tokenTypeData.typeInfo = typeInfo;
|
138
|
+
}
|
105
139
|
j += callsForCampaign;
|
106
|
-
calls = calls.concat(
|
140
|
+
calls = calls.concat(tokenTypeDataByCampaign[campaign.campaignId].calls);
|
107
141
|
}
|
108
|
-
const
|
142
|
+
const resultFinal = (await ChainInteractionService(chainId).fetchState(calls)).map(x => x.returnData);
|
109
143
|
i = 0;
|
110
144
|
const dynamicData = [];
|
111
145
|
for (const campaign of campaigns) {
|
112
|
-
// const priceRewardToken =
|
113
|
-
// (await pricer.get({
|
114
|
-
// address: campaign.rewardToken,
|
115
|
-
// chainId,
|
116
|
-
// symbol: campaign.campaignParameters.symbolRewardToken,
|
117
|
-
// })) ?? 0;
|
118
146
|
const priceRewardToken = await TokenService.getRewardTokenPrice(campaign);
|
119
|
-
|
120
|
-
const
|
121
|
-
|
147
|
+
const { processor, typeInfo } = tokenTypeDataByCampaign[campaign.campaignId];
|
148
|
+
const tokenTypeData = tokenTypeDataByCampaign[campaign.campaignId];
|
149
|
+
const callsForCampaign = tokenTypeData.calls.length;
|
150
|
+
try {
|
151
|
+
const res = await processor.computeRound5(j, processor.type, typeInfo, resultFinal, campaign, pricer);
|
152
|
+
tokenTypeData.calls = res.calls;
|
153
|
+
tokenTypeData.typeInfo = res.typeInfo;
|
154
|
+
}
|
155
|
+
catch {
|
156
|
+
// In case something goes wrong, we set following calls to void an move on
|
157
|
+
tokenTypeData.calls = [];
|
158
|
+
tokenTypeData.typeInfo = typeInfo;
|
159
|
+
}
|
122
160
|
try {
|
123
|
-
if (!!
|
124
|
-
await TokenRepository.updateAddressPrices(campaign.campaignParameters.targetToken,
|
161
|
+
if (!!tokenTypeDataByCampaign[campaign.campaignId]?.typeInfo.priceTargetToken && getEnv() === "prod")
|
162
|
+
await TokenRepository.updateAddressPrices(campaign.campaignParameters.targetToken, tokenTypeDataByCampaign[campaign.campaignId]?.typeInfo.priceTargetToken);
|
125
163
|
}
|
126
164
|
catch (e) {
|
127
165
|
log.warn(`failed to update target token price: ${e}`);
|
128
166
|
}
|
129
167
|
i += callsForCampaign;
|
130
|
-
let whitelistedSupplyTargetToken =
|
168
|
+
let whitelistedSupplyTargetToken = tokenTypeDataByCampaign[campaign.campaignId].typeInfo.whitelistedSupplyTargetToken;
|
131
169
|
const totalSupplyTargetToken = whitelistedSupplyTargetToken;
|
132
|
-
const priceTargetToken =
|
170
|
+
const priceTargetToken = tokenTypeDataByCampaign[campaign.campaignId].typeInfo.priceTargetToken;
|
133
171
|
let lastEligibilityRatio = 1;
|
134
172
|
if (!!campaign.campaignParameters.hooks?.length) {
|
135
173
|
lastEligibilityRatio =
|
@@ -165,15 +203,15 @@ export class Erc20DynamicData {
|
|
165
203
|
apr = getFixedApr(campaign, priceRewardToken, priceTargetToken);
|
166
204
|
}
|
167
205
|
if (campaign.chainId === ChainId.ETHERLINK) {
|
168
|
-
whitelistedSupplyTargetToken =
|
206
|
+
whitelistedSupplyTargetToken = tokenTypeDataByCampaign[campaign.campaignId].typeInfo.totalSupply;
|
169
207
|
}
|
170
208
|
dynamicData.push({
|
171
209
|
...campaign,
|
172
210
|
apr,
|
173
211
|
totalSupplyTargetToken,
|
174
212
|
tvl: whitelistedSupplyTargetToken * priceTargetToken,
|
175
|
-
type:
|
176
|
-
typeInfo
|
213
|
+
type: processor.type,
|
214
|
+
typeInfo,
|
177
215
|
priceRewardToken: priceRewardToken,
|
178
216
|
lastEligibilityRatio,
|
179
217
|
});
|