@merkl/api 0.20.10 → 0.20.12

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.
@@ -82,11 +82,6 @@ export class EventBasedDynamicData {
82
82
  (fixRewardRate * amount * (moment().unix() - startTimestamp)) / (endTimestamp - startTimestamp) / tvl;
83
83
  }
84
84
  distributionMeanAPR = !distributionMeanAPR || Number.isNaN(distributionMeanAPR) ? 0 : distributionMeanAPR;
85
- const rewardTokens = await TokenService.findManyOrCreate([
86
- { chainId: campaign.chainId, address: campaign.rewardToken },
87
- ]);
88
- const rewardToken = rewardTokens[0];
89
- distributionMeanAPR = rewardToken.isPoint ? distributionMeanAPR / 365 / 100 : distributionMeanAPR;
90
85
  dynamicData.push({
91
86
  ...campaign,
92
87
  apr: distributionMeanAPR,
@@ -1,5 +1,5 @@
1
1
  import type { ProtocolId } from "@/modules/v4/protocol/protocol.model";
2
- import { type Campaign as CampaignEnum, type CampaignParameters, type ChainId } from "@sdk";
2
+ import { type Campaign as CampaignEnum, type CampaignParameters, ChainId } from "@sdk";
3
3
  import type { BigNumberish } from "ethers";
4
4
  import type { MetadataBuilder } from "../interface";
5
5
  type campaignType = CampaignEnum.MORPHO;
@@ -15,7 +15,7 @@ export declare class MorphoMetadata implements MetadataBuilder<campaignType> {
15
15
  depositUrl: string | undefined;
16
16
  explorerAddress: `0x${string}`;
17
17
  }>;
18
- static generateUrl(computeChainId: ChainId, params: CampaignParameters<campaignType>["campaignParameters"], morphoParams: {
18
+ static generateUrl(computeChainId: ChainId, params: CampaignParameters<campaignType>["campaignParameters"], _morphoParams: {
19
19
  nameTargetToken: string;
20
20
  symbolLoanToken: string;
21
21
  symbolBorrowToken: string;
@@ -1,5 +1,5 @@
1
1
  import { OpportunityAction } from "@db/api";
2
- import { BN2Number, MorphoSubCampaignType, NETWORK_LABELS, } from "@sdk";
2
+ import { BN2Number, ChainId, MorphoSubCampaignType, NETWORK_LABELS, } from "@sdk";
3
3
  import { getAddress } from "viem";
4
4
  export class MorphoMetadata {
5
5
  async build(computeChainId, params, subType) {
@@ -16,15 +16,15 @@ export class MorphoMetadata {
16
16
  action: subtype.action,
17
17
  tokens: [{ chainId: computeChainId, address: params.targetToken }],
18
18
  name: subtype.name,
19
- mainProtocol: "morpho",
19
+ mainProtocol: (computeChainId === ChainId.POLYGON ? "compound" : "morpho"),
20
20
  depositUrl: MorphoMetadata.generateUrl(computeChainId, params, morphoParams, subType),
21
21
  explorerAddress: getAddress(params.targetToken),
22
22
  };
23
23
  }
24
- static generateUrl(computeChainId, params, morphoParams, subType) {
24
+ static generateUrl(computeChainId, params, _morphoParams, subType) {
25
25
  switch (subType) {
26
26
  case MorphoSubCampaignType.META: {
27
- if (morphoParams.nameTargetToken.toLowerCase().includes("compound")) {
27
+ if (computeChainId === ChainId.POLYGON) {
28
28
  return `https://www.compound.blue/${params.targetToken?.toLowerCase()}`;
29
29
  }
30
30
  return `https://app.morpho.org/vault?vault=${params.targetToken}&network=${NETWORK_LABELS[computeChainId]?.toLowerCase()}`;