@merkl/api 0.20.62 → 0.20.63
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/engine/dynamicData/factory.js +3 -2
- package/dist/src/engine/dynamicData/implementations/CompoundV3.d.ts +7 -0
- package/dist/src/engine/dynamicData/implementations/CompoundV3.js +69 -0
- package/dist/src/engine/opportunityMetadata/factory.js +3 -2
- package/dist/src/engine/opportunityMetadata/implementations/CompoundV3.d.ts +17 -0
- package/dist/src/engine/opportunityMetadata/implementations/CompoundV3.js +19 -0
- package/dist/src/jobs/update-analytics.d.ts +1 -0
- package/dist/src/jobs/update-analytics.js +21 -0
- package/dist/src/jobs/update-rpc-calls-cache.js +2 -1
- package/dist/src/modules/v4/campaign/campaign.controller.js +5 -3
- package/dist/src/modules/v4/opportunity/opportunity.controller.js +1 -0
- package/dist/src/modules/v4/programPayload/programPayload.model.d.ts +12 -2
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +12 -1
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +24 -13
- package/dist/src/modules/v4/reward/reward.controller.js +5 -3
- package/dist/src/modules/v4/token/token.service.js +1 -2
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +2 -1
@@ -4,6 +4,7 @@ import { AmbiantDynamicData } from "./implementations/Ambiant";
|
|
4
4
|
import { BadgerDynamicData } from "./implementations/Badger";
|
5
5
|
import { ClammDynamicData } from "./implementations/Clamm";
|
6
6
|
import { CompoundDynamicData } from "./implementations/Compound";
|
7
|
+
import { CompoundV3DynamicData } from "./implementations/CompoundV3";
|
7
8
|
import { DolomiteDynamicData } from "./implementations/Dolomite";
|
8
9
|
import { EigenLayerDynamicData } from "./implementations/EigenLayer";
|
9
10
|
import { EncompassingDynamicData } from "./implementations/Encompassing";
|
@@ -27,6 +28,8 @@ const map = {
|
|
27
28
|
[Campaign.BADGER]: new BadgerDynamicData(),
|
28
29
|
[Campaign.CLAMM]: new ClammDynamicData(),
|
29
30
|
[Campaign.COMPOUND]: new CompoundDynamicData(),
|
31
|
+
[Campaign.COMPOUND_V3]: new CompoundV3DynamicData(),
|
32
|
+
[Campaign.COMPOUND_V3_FIXAPR]: new CompoundV3DynamicData(),
|
30
33
|
[Campaign.DOLOMITE]: new DolomiteDynamicData(),
|
31
34
|
[Campaign.EIGENLAYER]: new EigenLayerDynamicData(),
|
32
35
|
[Campaign.ENCOMPASSING]: new EncompassingDynamicData(),
|
@@ -53,8 +56,6 @@ const map = {
|
|
53
56
|
[Campaign.MAVERICK_BP]: new DefaultDynamicData(), // TODO
|
54
57
|
[Campaign.ERC6909]: new DefaultDynamicData(), // TODO
|
55
58
|
[Campaign.ERC6909FIXAPR]: new DefaultDynamicData(), // TODO
|
56
|
-
[Campaign.COMPOUND_V3]: new DefaultDynamicData(), // TODO,
|
57
|
-
[Campaign.COMPOUND_V3_FIXAPR]: new DefaultDynamicData(), // TODO
|
58
59
|
[Campaign.ERC1155]: new DefaultDynamicData(), // TODO
|
59
60
|
[Campaign.ERC1155FIXAPR]: new DefaultDynamicData(), // TODO
|
60
61
|
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { type Campaign, type CampaignParameters, type MerklChainId } from "@sdk";
|
2
|
+
import type { DynamicDataBuilder } from "../interface";
|
3
|
+
type campaignType = Campaign.COMPOUND_V3;
|
4
|
+
export declare class CompoundV3DynamicData implements DynamicDataBuilder<campaignType> {
|
5
|
+
build(chainId: MerklChainId, campaigns: CampaignParameters<campaignType>[]): Promise<CompoundV3CampaignDynamicData[]>;
|
6
|
+
}
|
7
|
+
export {};
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import { TokenService } from "@/modules/v4/token/token.service";
|
2
|
+
import { BN2Number, ChainInteractionService, CompoundV3Interface, CompoundV3SubCampaignType, NULL_ADDRESS, YEAR, } from "@sdk";
|
3
|
+
import { log } from "../../../utils/logger";
|
4
|
+
import { Pricer } from "../../../utils/pricer";
|
5
|
+
export class CompoundV3DynamicData {
|
6
|
+
async build(chainId, campaigns) {
|
7
|
+
const pricer = await Pricer.load();
|
8
|
+
const calls = [];
|
9
|
+
for (const campaign of campaigns) {
|
10
|
+
if (campaign.campaignSubType === CompoundV3SubCampaignType.SUPPLY) {
|
11
|
+
calls.push({
|
12
|
+
allowFailure: true,
|
13
|
+
callData: CompoundV3Interface.encodeFunctionData("totalSupply"),
|
14
|
+
target: campaign.campaignParameters.targetToken,
|
15
|
+
});
|
16
|
+
calls.push({
|
17
|
+
allowFailure: true,
|
18
|
+
callData: CompoundV3Interface.encodeFunctionData("baseToken"),
|
19
|
+
target: campaign.campaignParameters.targetToken,
|
20
|
+
});
|
21
|
+
}
|
22
|
+
}
|
23
|
+
const result = await ChainInteractionService(chainId).fetchState(calls);
|
24
|
+
let i = 0;
|
25
|
+
const dynamicData = [];
|
26
|
+
for (const campaign of campaigns) {
|
27
|
+
let totalSupply;
|
28
|
+
let underlyingToken;
|
29
|
+
if (campaign.campaignSubType === CompoundV3SubCampaignType.SUPPLY) {
|
30
|
+
try {
|
31
|
+
totalSupply = BN2Number(CompoundV3Interface.decodeFunctionResult("totalSupply", result[i++].returnData)[0], campaign.campaignParameters.decimalsTargetToken);
|
32
|
+
underlyingToken = CompoundV3Interface.decodeFunctionResult("baseToken", result[i++].returnData)[0];
|
33
|
+
}
|
34
|
+
catch {
|
35
|
+
log.warn(`Error getting totalSupply for campaign ${campaign.campaignId} and token ${campaign.campaignParameters.targetToken}`);
|
36
|
+
totalSupply = 0.0000001;
|
37
|
+
underlyingToken = NULL_ADDRESS;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
else {
|
41
|
+
totalSupply = 0.0000001;
|
42
|
+
underlyingToken = NULL_ADDRESS;
|
43
|
+
}
|
44
|
+
const priceRewardToken = await TokenService.getRewardTokenPrice(campaign);
|
45
|
+
const priceTargetToken = (await pricer.get({
|
46
|
+
address: underlyingToken,
|
47
|
+
chainId: campaign.computeChainId,
|
48
|
+
// Remove the `c` at the beginning of the symbol and the `v3` at the end
|
49
|
+
symbol: campaign.campaignParameters.symbolTargetToken.slice(1, -2),
|
50
|
+
})) ?? 0;
|
51
|
+
let apr = (priceRewardToken * BN2Number(campaign.amount, campaign.campaignParameters.decimalsRewardToken) * YEAR * 100) /
|
52
|
+
campaign.campaignParameters.duration /
|
53
|
+
(totalSupply * priceTargetToken);
|
54
|
+
const rewardTokens = await TokenService.findManyOrCreate([
|
55
|
+
{ chainId: campaign.chainId, address: campaign.rewardToken },
|
56
|
+
]);
|
57
|
+
const rewardToken = rewardTokens[0];
|
58
|
+
apr = rewardToken.isPoint ? apr / 365 / 100 : apr;
|
59
|
+
dynamicData.push({
|
60
|
+
...campaign,
|
61
|
+
apr,
|
62
|
+
totalSupplyTargetToken: totalSupply,
|
63
|
+
tvl: totalSupply * priceTargetToken,
|
64
|
+
priceRewardToken: priceRewardToken,
|
65
|
+
});
|
66
|
+
}
|
67
|
+
return dynamicData;
|
68
|
+
}
|
69
|
+
}
|
@@ -4,6 +4,7 @@ import { AmbientMetadata } from "./implementations/Ambient";
|
|
4
4
|
import { BadgerMetadata } from "./implementations/Badger";
|
5
5
|
import { ClammMetadata } from "./implementations/Clamm";
|
6
6
|
import { CompoundMetadata } from "./implementations/Compound";
|
7
|
+
import { CompoundV3Metadata } from "./implementations/CompoundV3";
|
7
8
|
import { DefaultMetadata } from "./implementations/Default";
|
8
9
|
import { DolomiteMetadata } from "./implementations/Dolomite";
|
9
10
|
import { EigenLayerMetadata } from "./implementations/EigenLayer";
|
@@ -35,6 +36,8 @@ const map = {
|
|
35
36
|
[Campaign.AJNA]: new AjnaMetadata(),
|
36
37
|
[Campaign.EULER]: new EulerMetadata(),
|
37
38
|
[Campaign.COMPOUND]: new CompoundMetadata(),
|
39
|
+
[Campaign.COMPOUND_V3]: new CompoundV3Metadata(),
|
40
|
+
[Campaign.COMPOUND_V3_FIXAPR]: new CompoundV3Metadata(),
|
38
41
|
[Campaign.ION]: new IonMetadata(),
|
39
42
|
[Campaign.MORPHO]: new MorphoMetadata(),
|
40
43
|
[Campaign.HYPERDRIVELOGFIXPROCESSOR]: new HyperdriveMetadata(),
|
@@ -56,8 +59,6 @@ const map = {
|
|
56
59
|
[Campaign.MAVERICK_BP]: new DefaultMetadata(), // TODO
|
57
60
|
[Campaign.ERC6909]: new DefaultMetadata(), // TODO
|
58
61
|
[Campaign.ERC6909FIXAPR]: new DefaultMetadata(), // TODO
|
59
|
-
[Campaign.COMPOUND_V3]: new DefaultMetadata(), // TODO,
|
60
|
-
[Campaign.COMPOUND_V3_FIXAPR]: new DefaultMetadata(), // TODO
|
61
62
|
[Campaign.ERC1155]: new DefaultMetadata(), // TODO
|
62
63
|
[Campaign.ERC1155FIXAPR]: new DefaultMetadata(), // TODO
|
63
64
|
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { type Campaign as CampaignEnum, type CampaignParameters, type ChainId } from "@sdk";
|
2
|
+
import type { ProtocolId } from "../../../modules/v4/protocol/protocol.model";
|
3
|
+
import type { MetadataBuilder } from "../interface";
|
4
|
+
type campaignType = CampaignEnum.COMPOUND_V3;
|
5
|
+
export declare class CompoundV3Metadata implements MetadataBuilder<campaignType> {
|
6
|
+
build(computeChainId: ChainId, params: CampaignParameters<campaignType>["campaignParameters"], subType: CampaignParameters<campaignType>["campaignSubType"]): Promise<{
|
7
|
+
action: "LEND" | "BORROW";
|
8
|
+
name: string;
|
9
|
+
tokens: {
|
10
|
+
chainId: ChainId;
|
11
|
+
address: any;
|
12
|
+
}[];
|
13
|
+
mainProtocol: ProtocolId;
|
14
|
+
depositUrl: undefined;
|
15
|
+
}>;
|
16
|
+
}
|
17
|
+
export {};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { OpportunityAction } from "@db/api";
|
2
|
+
import { CompoundV3SubCampaignType } from "@sdk";
|
3
|
+
export class CompoundV3Metadata {
|
4
|
+
async build(computeChainId, params, subType) {
|
5
|
+
const symbolUnderlyingToken = params.symbolTargetToken.slice(1, -2);
|
6
|
+
return {
|
7
|
+
action: subType === CompoundV3SubCampaignType.SUPPLY ? OpportunityAction.LEND : OpportunityAction.BORROW,
|
8
|
+
name: [
|
9
|
+
subType === CompoundV3SubCampaignType.SUPPLY
|
10
|
+
? `Supply ${symbolUnderlyingToken} on`
|
11
|
+
: `Borrow ${symbolUnderlyingToken} on`,
|
12
|
+
"Compound V3",
|
13
|
+
].join(" "),
|
14
|
+
tokens: [{ chainId: computeChainId, address: params.targetToken }],
|
15
|
+
mainProtocol: "compound",
|
16
|
+
depositUrl: undefined, // TODO, shall depend on compFork
|
17
|
+
};
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { CacheService } from "@/modules/v4/cache";
|
2
|
+
import { TTLPresets } from "@/modules/v4/cache/cache.model";
|
3
|
+
import { RewardService } from "@/modules/v4/reward";
|
4
|
+
import { log } from "@/utils/logger";
|
5
|
+
const main = async () => {
|
6
|
+
const today = new Date();
|
7
|
+
const firstDayOfMonth = new Date(today.getFullYear(), today.getMonth(), 1).getTime() / 1000;
|
8
|
+
const promises = [
|
9
|
+
CacheService.set(TTLPresets.DAY_1, RewardService.getTotalDistributed, firstDayOfMonth).then(() => log.info("Total Distributed cache updated successfully")),
|
10
|
+
CacheService.set(TTLPresets.DAY_1, RewardService.getTotalDistributedByChains, firstDayOfMonth).then(() => log.info("Total Distributed by Chains cache updated successfully")),
|
11
|
+
CacheService.set(TTLPresets.DAY_1, RewardService.getTotalDistributedByType, firstDayOfMonth).then(() => log.info("Total Distributed by Type cache updated successfully")),
|
12
|
+
CacheService.set(TTLPresets.DAY_1, RewardService.getTotalDistributedByOpportunities, firstDayOfMonth).then(() => log.info("Total Distributed by Opportunities cache updated successfully")),
|
13
|
+
];
|
14
|
+
await Promise.all(promises);
|
15
|
+
};
|
16
|
+
main()
|
17
|
+
.then(() => process.exit(0))
|
18
|
+
.catch(err => {
|
19
|
+
console.error(err);
|
20
|
+
process.exit(1);
|
21
|
+
});
|
@@ -3,7 +3,8 @@ import { TTLPresets } from "@/modules/v4/cache/cache.model";
|
|
3
3
|
import { ChainService } from "@/modules/v4/chain/chain.service";
|
4
4
|
import { MerklRootRepository } from "@/modules/v4/merklRoot/merklRoot.repository";
|
5
5
|
import { OpportunityService } from "@/modules/v4/opportunity";
|
6
|
-
import {
|
6
|
+
import { log } from "@/utils/logger";
|
7
|
+
import { NETWORK_LABELS } from "@sdk";
|
7
8
|
const main = async () => {
|
8
9
|
try {
|
9
10
|
const chains = await ChainService.getSupportedIds();
|
@@ -5,6 +5,8 @@ import { ChainUniqueDto } from "@/modules/v4/chain/chain.model";
|
|
5
5
|
import { Campaign } from "@sdk";
|
6
6
|
import Elysia, { t } from "elysia";
|
7
7
|
import { throwOnUnsupportedChainId } from "src/utils/throw";
|
8
|
+
import { CacheService } from "../cache";
|
9
|
+
import { TTLPresets } from "../cache/cache.model";
|
8
10
|
import { DynamicDataService } from "../dynamicData/dynamicData.service";
|
9
11
|
import { OpportunityConvertorService } from "../opportunity/opportunity.converter";
|
10
12
|
import { CampaignResourceDto, CreateCampaignDto, GetCampaignQueryDto, RemoveManualOverrideDto, UpdateCampaignCreatorDto, UpdateCampaignDto, UpdateMetaDataCampaignDto, } from "./campaign.model";
|
@@ -149,6 +151,6 @@ export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { t
|
|
149
151
|
beforeHandle: BackOfficeGuard,
|
150
152
|
detail: { hide: true },
|
151
153
|
})
|
152
|
-
.get("count/by-chains", async ({ query }) => await CampaignService.countByChains
|
153
|
-
.get("/count/by-types", async ({ query }) => await CampaignService.countByType
|
154
|
-
.get("/count/by-protocols", async ({ query }) => await CampaignService.countByProtocol
|
154
|
+
.get("count/by-chains", async ({ query }) => await CacheService.wrap(TTLPresets.DAY_1, CampaignService.countByChains, query))
|
155
|
+
.get("/count/by-types", async ({ query }) => await CacheService.wrap(TTLPresets.DAY_1, CampaignService.countByType, query))
|
156
|
+
.get("/count/by-protocols", async ({ query }) => await CacheService.wrap(TTLPresets.DAY_1, CampaignService.countByProtocol, query));
|
@@ -33,6 +33,7 @@ export const OpportunityController = new Elysia({
|
|
33
33
|
params: OpportunityUniqueDto,
|
34
34
|
body: OpportunityDeleteOverrideDto,
|
35
35
|
beforeHandle: BackOfficeGuard,
|
36
|
+
detail: { hide: true },
|
36
37
|
})
|
37
38
|
// ─── Tries to reparse An Opportunity ─────────────────────────────────
|
38
39
|
.post("/:id", async ({ params }) => {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Campaign, CompFork, CompoundSubCampaignType, Forwarder, ForwarderParameters, HOOK, HookParameters, MerklChainId, MorphoSubCampaignType } from "@sdk";
|
1
|
+
import type { Campaign, CompFork, CompoundSubCampaignType, CompoundV3SubCampaignType, Forwarder, ForwarderParameters, HOOK, HookParameters, MerklChainId, MorphoSubCampaignType } from "@sdk";
|
2
2
|
export declare const CampaignPayloadInputDto: import("@sinclair/typebox").TObject<{
|
3
3
|
campaign: import("@sinclair/typebox").TString;
|
4
4
|
program: import("@sinclair/typebox").TString;
|
@@ -154,6 +154,16 @@ export type partialConfigERC20 = {
|
|
154
154
|
forwarders: ForwarderParameters<Forwarder>[];
|
155
155
|
apr?: number;
|
156
156
|
};
|
157
|
+
export type partialConfigCompoundV3 = {
|
158
|
+
computeChainId?: MerklChainId;
|
159
|
+
hooks?: (HookParameters<HOOK> | string)[];
|
160
|
+
campaignType: Campaign;
|
161
|
+
targetToken: string;
|
162
|
+
whitelist: string[];
|
163
|
+
blacklist: string[];
|
164
|
+
url?: string;
|
165
|
+
subCampaignType: CompoundV3SubCampaignType;
|
166
|
+
};
|
157
167
|
export type partialConfigMorpho = {
|
158
168
|
computeChainId?: MerklChainId;
|
159
169
|
hooks?: (HookParameters<HOOK> | string)[];
|
@@ -200,7 +210,7 @@ export type partialConfigAirdrop = {
|
|
200
210
|
hooks?: (HookParameters<HOOK> | string)[];
|
201
211
|
campaignType: Campaign;
|
202
212
|
};
|
203
|
-
export type partialConfig = partialConfigERC20 | partialConfigMorpho | partialConfigCLAMM | partialConfigIonic | partialConfigAirdrop;
|
213
|
+
export type partialConfig = partialConfigERC20 | partialConfigMorpho | partialConfigCLAMM | partialConfigIonic | partialConfigCompoundV3 | partialConfigAirdrop;
|
204
214
|
export declare const safeTemplate: {
|
205
215
|
version: string;
|
206
216
|
chainId: string;
|
@@ -18,7 +18,8 @@ export declare enum roninCampaigns {
|
|
18
18
|
Katana_WETH_RON_Ronin = "Katana WETH-RON Ronin 0x90f31f1907a4d1443a6aacdc91ac2312f91bafa7",
|
19
19
|
Katana_AXS_RON_Ronin = "Katana AXS-RON Ronin 0x3230b903e8a5d6e46b5a5028470dd33e7b673722",
|
20
20
|
Katana_USDC_RON_Ronin = "Katana USDC-RON Ronin 0x392d372f2a51610e9ac5b741379d5631ca9a1c7f",
|
21
|
-
Katana_LRON_RON_Ronin = "Katana LRON-RON Ronin 0x0fbe1a7f0f006a4a4d817b2aa922889612758ce8"
|
21
|
+
Katana_LRON_RON_Ronin = "Katana LRON-RON Ronin 0x0fbe1a7f0f006a4a4d817b2aa922889612758ce8",
|
22
|
+
Supply_WETH_Compound_Ronin = "Supply WETH Compound Ronin 0x4006ed4097ee51c09a04c3b0951d28ccf19e6dfe"
|
22
23
|
}
|
23
24
|
export declare enum anglesCampaigns {
|
24
25
|
Angles_supply_in_angles_liquid = "0x15E96CDecA34B9DE1B31586c1206206aDb92E69D",
|
@@ -476,6 +477,16 @@ declare const RoninInterfaceCampaigns: {
|
|
476
477
|
weightToken0: number;
|
477
478
|
weightToken1: number;
|
478
479
|
};
|
480
|
+
"Supply WETH Compound Ronin 0x4006ed4097ee51c09a04c3b0951d28ccf19e6dfe": {
|
481
|
+
campaignType: any;
|
482
|
+
computeChainId: any;
|
483
|
+
hooks: never[];
|
484
|
+
targetToken: string;
|
485
|
+
whitelist: never[];
|
486
|
+
blacklist: never[];
|
487
|
+
url: string;
|
488
|
+
subCampaignType: any;
|
489
|
+
};
|
479
490
|
};
|
480
491
|
export declare enum tacCampaigns {
|
481
492
|
TAC_Supply_TACETH = "TAC Supply tacETH 0x294eecec65A0142e84AEdfD8eB2FBEA8c9a9fbad",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { BalanceCallType, Campaign, ChainId, CompFork, CompoundSubCampaignType, ComputeScoreMethod, Forwarder, HOOK, MorphoSubCampaignType, StandardType, boostingFunction, boostingReferralFunction, contractStateBoost, defaultBoost, defaultReferralBoost, selectionRaffleMethod, } from "@sdk";
|
1
|
+
import { BalanceCallType, Campaign, ChainId, CompFork, CompoundSubCampaignType, CompoundV3SubCampaignType, ComputeScoreMethod, Forwarder, HOOK, MorphoSubCampaignType, StandardType, boostingFunction, boostingReferralFunction, contractStateBoost, defaultBoost, defaultReferralBoost, selectionRaffleMethod, } from "@sdk";
|
2
2
|
import { id } from "ethers/lib/utils";
|
3
3
|
export var program;
|
4
4
|
(function (program) {
|
@@ -22,6 +22,7 @@ export var roninCampaigns;
|
|
22
22
|
roninCampaigns["Katana_AXS_RON_Ronin"] = "Katana AXS-RON Ronin 0x3230b903e8a5d6e46b5a5028470dd33e7b673722";
|
23
23
|
roninCampaigns["Katana_USDC_RON_Ronin"] = "Katana USDC-RON Ronin 0x392d372f2a51610e9ac5b741379d5631ca9a1c7f";
|
24
24
|
roninCampaigns["Katana_LRON_RON_Ronin"] = "Katana LRON-RON Ronin 0x0fbe1a7f0f006a4a4d817b2aa922889612758ce8";
|
25
|
+
roninCampaigns["Supply_WETH_Compound_Ronin"] = "Supply WETH Compound Ronin 0x4006ed4097ee51c09a04c3b0951d28ccf19e6dfe";
|
25
26
|
})(roninCampaigns || (roninCampaigns = {}));
|
26
27
|
export var anglesCampaigns;
|
27
28
|
(function (anglesCampaigns) {
|
@@ -502,9 +503,9 @@ const RoninInterfaceCampaigns = {
|
|
502
503
|
url: "https://app.roninchain.com/liquidity/v3/0x90f31f1907a4d1443a6aacdc91ac2312f91bafa7",
|
503
504
|
forwarders: [],
|
504
505
|
isOutOfRangeIncentivized: false,
|
505
|
-
weightFees:
|
506
|
-
weightToken0:
|
507
|
-
weightToken1:
|
506
|
+
weightFees: 1500,
|
507
|
+
weightToken0: 1500,
|
508
|
+
weightToken1: 7000,
|
508
509
|
},
|
509
510
|
[roninCampaigns.Katana_AXS_RON_Ronin]: {
|
510
511
|
campaignType: Campaign.CLAMM,
|
@@ -516,9 +517,9 @@ const RoninInterfaceCampaigns = {
|
|
516
517
|
url: "https://app.roninchain.com/liquidity/v3/0x3230b903e8a5d6e46b5a5028470dd33e7b673722",
|
517
518
|
forwarders: [],
|
518
519
|
isOutOfRangeIncentivized: false,
|
519
|
-
weightFees:
|
520
|
-
weightToken0:
|
521
|
-
weightToken1:
|
520
|
+
weightFees: 1000,
|
521
|
+
weightToken0: 3500,
|
522
|
+
weightToken1: 5500,
|
522
523
|
},
|
523
524
|
[roninCampaigns.Katana_USDC_RON_Ronin]: {
|
524
525
|
campaignType: Campaign.CLAMM,
|
@@ -530,9 +531,9 @@ const RoninInterfaceCampaigns = {
|
|
530
531
|
url: "https://app.roninchain.com/liquidity/v3/0x392d372f2a51610e9ac5b741379d5631ca9a1c7f",
|
531
532
|
forwarders: [],
|
532
533
|
isOutOfRangeIncentivized: false,
|
533
|
-
weightFees:
|
534
|
-
weightToken0:
|
535
|
-
weightToken1:
|
534
|
+
weightFees: 1000,
|
535
|
+
weightToken0: 2500,
|
536
|
+
weightToken1: 6500,
|
536
537
|
},
|
537
538
|
[roninCampaigns.Katana_LRON_RON_Ronin]: {
|
538
539
|
campaignType: Campaign.CLAMM,
|
@@ -544,9 +545,19 @@ const RoninInterfaceCampaigns = {
|
|
544
545
|
url: "https://app.roninchain.com/liquidity/v3/0x0fbe1a7f0f006a4a4d817b2aa922889612758ce8",
|
545
546
|
forwarders: [],
|
546
547
|
isOutOfRangeIncentivized: false,
|
547
|
-
weightFees:
|
548
|
-
weightToken0:
|
549
|
-
weightToken1:
|
548
|
+
weightFees: 1000,
|
549
|
+
weightToken0: 4500,
|
550
|
+
weightToken1: 4500,
|
551
|
+
},
|
552
|
+
[roninCampaigns.Supply_WETH_Compound_Ronin]: {
|
553
|
+
campaignType: Campaign.COMPOUND_V3,
|
554
|
+
computeChainId: ChainId.RONIN,
|
555
|
+
hooks: [],
|
556
|
+
targetToken: "0x4006eD4097Ee51c09A04c3B0951D28CCf19e6DFE",
|
557
|
+
whitelist: [],
|
558
|
+
blacklist: [],
|
559
|
+
url: "",
|
560
|
+
subCampaignType: CompoundV3SubCampaignType.SUPPLY,
|
550
561
|
},
|
551
562
|
};
|
552
563
|
export var tacCampaigns;
|
@@ -6,6 +6,8 @@ import { TokenService } from "@/modules/v4/token/token.service";
|
|
6
6
|
import bigintToString from "@/utils/bigintToString";
|
7
7
|
import { throwOnInvalidRequiredAddress, throwOnUnsupportedChainId } from "@/utils/throw";
|
8
8
|
import Elysia, { t } from "elysia";
|
9
|
+
import { CacheService } from "../cache";
|
10
|
+
import { TTLPresets } from "../cache/cache.model";
|
9
11
|
import { CampaignIdDto, CampaignIdWithoutPageDto, CampaignRewardsDto, CreateManyBreakdownDto, CreateManyRewardDto, RegisterClaimsDto, TokenIdDto, } from "./reward.model";
|
10
12
|
import { RewardService } from "./reward.service";
|
11
13
|
// ─── Rewards Controller ──────────────────────────────────────────────────────
|
@@ -131,6 +133,6 @@ export const RewardController = new Elysia({ prefix: "/rewards", detail: { tags:
|
|
131
133
|
})
|
132
134
|
.get("/total/distributed", async ({ query }) => await RewardService.getTotalDistributed(query.since.getTime() / 1000))
|
133
135
|
.get("/total/distributed/by-opportunities", async ({ query }) => JSON.stringify(bigintToString(Array.from((await RewardService.getTotalDistributedByOpportunities(query.since.getTime() / 1000)).entries()))))
|
134
|
-
.get("/total/distributed/by-chains", async ({ query }) => await RewardService.getTotalDistributedByChains
|
135
|
-
.get("/total/distributed/by-types", async ({ query }) => await RewardService.getTotalDistributedByType
|
136
|
-
.get("/total/distributed/by-protocols", async ({ query }) => await RewardService.getTotalDistributedByProtocol
|
136
|
+
.get("/total/distributed/by-chains", async ({ query }) => await CacheService.wrap(TTLPresets.DAY_1, RewardService.getTotalDistributedByChains, query.since.getTime() / 1000))
|
137
|
+
.get("/total/distributed/by-types", async ({ query }) => await CacheService.wrap(TTLPresets.DAY_1, RewardService.getTotalDistributedByType, query.since.getTime() / 1000))
|
138
|
+
.get("/total/distributed/by-protocols", async ({ query }) => await CacheService.wrap(TTLPresets.DAY_1, RewardService.getTotalDistributedByProtocol, query.since.getTime() / 1000));
|
@@ -297,8 +297,7 @@ export class TokenService {
|
|
297
297
|
});
|
298
298
|
}
|
299
299
|
catch (err) {
|
300
|
-
|
301
|
-
console.error(err);
|
300
|
+
log.error("Failed to create price source.", err);
|
302
301
|
}
|
303
302
|
}
|
304
303
|
return await TokenService.update(token.id, {
|