@merkl/api 0.19.18 → 0.19.20

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.
@@ -137,9 +137,18 @@ export class Erc20DynamicData {
137
137
  field: "averageBoost",
138
138
  }))?.averageBoost ?? 1;
139
139
  }
140
+ const forfeitingBoost = 1;
141
+ if (!!campaign.campaignParameters.hooks?.length) {
142
+ lastEligibilityRatio =
143
+ (await ComputedValueService.findCampaignValue({
144
+ campaignId: `${campaign.campaignId}-${chainId}`,
145
+ field: "forfeitingBoost",
146
+ }))?.forfeitingBoost ?? 1;
147
+ }
140
148
  dynamicData.push({
141
149
  ...campaign,
142
150
  apr: (lastEligibilityRatio *
151
+ forfeitingBoost *
143
152
  (priceRewardToken *
144
153
  BN2Number(campaign.amount, campaign.campaignParameters.decimalsRewardToken) *
145
154
  YEAR *
@@ -188,6 +188,6 @@ export const tokenTypeToProtocol = {
188
188
  [tokenType.hanji_liquidity_vault_token]: { protocol: "Hanji", action: OpportunityAction.POOL },
189
189
  [tokenType.xU308]: { protocol: "Uranium", action: OpportunityAction.HOLD },
190
190
  [tokenType.bunniV2]: { protocol: "Bunni V2", action: OpportunityAction.HOLD },
191
- [tokenType.beratrax_vault]: { protocol: "Beratrax", action: OpportunityAction.POOL },
191
+ [tokenType.beratrax_vault]: { protocol: "BeraTrax", action: OpportunityAction.POOL },
192
192
  [tokenType.beraborrow_gauge]: { protocol: "Beraborrow", action: OpportunityAction.POOL },
193
193
  };
@@ -56,11 +56,15 @@ export class BEXRewardGaugeProcessor extends GenericProcessor {
56
56
  tvlUnderlyingPool += poolTokensinfo[poolToken.token].price * poolTokensinfo[poolToken.token].amountInPool;
57
57
  symbols.push(symbol);
58
58
  }
59
- let adjustedPoolTotalSupply = BN2Number(typeInfo.totalSupplyUnderlyingPoolTokens, 18); //- BN2Number(typeInfo.vaultBalance, 18);
59
+ let adjustedPoolTotalSupply = BN2Number(typeInfo.totalSupplyUnderlyingPoolTokens, 18);
60
60
  if (type === tokenType.beratrax_vault) {
61
- // Weird edge case where the total supply is 80k higher than it should be because they minted stuff on an EOA
61
+ // Weird edge case where a lot of the supply is in a weird contract
62
62
  adjustedPoolTotalSupply -= BN2Number(typeInfo.poolHolderBalance, 18);
63
63
  }
64
+ if (type === tokenType.beraborrow_gauge) {
65
+ // Remove tokens in the vault from the total supply
66
+ adjustedPoolTotalSupply -= BN2Number(typeInfo.vaultBalance, 18);
67
+ }
64
68
  let percentageOfSupplyUnderlyingPoolTokens = 1;
65
69
  if (adjustedPoolTotalSupply > 0) {
66
70
  percentageOfSupplyUnderlyingPoolTokens =