@pancakeswap/pools 4.0.21 → 5.0.0

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.
Files changed (37) hide show
  1. package/dist/constants/boostedPools/arb.d.ts +3 -0
  2. package/dist/constants/boostedPools/arb.d.ts.map +1 -0
  3. package/dist/constants/boostedPools/index.d.ts +9 -0
  4. package/dist/constants/boostedPools/index.d.ts.map +1 -0
  5. package/dist/constants/contracts.d.ts +1 -1
  6. package/dist/constants/index.d.ts +1 -0
  7. package/dist/constants/index.d.ts.map +1 -1
  8. package/dist/constants/pools/324.d.ts.map +1 -1
  9. package/dist/constants/pools/42161.d.ts.map +1 -1
  10. package/dist/constants/pools/56.d.ts.map +1 -1
  11. package/dist/constants/supportedChains.d.ts +2 -0
  12. package/dist/constants/supportedChains.d.ts.map +1 -1
  13. package/dist/index.d.ts +0 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +148 -130
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs +142 -127
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/queries/index.d.ts +0 -1
  20. package/dist/queries/index.d.ts.map +1 -1
  21. package/dist/utils/boosted/apr/fetchAlpBoostedPoolApr.d.ts +3 -0
  22. package/dist/utils/boosted/apr/fetchAlpBoostedPoolApr.d.ts.map +1 -0
  23. package/dist/utils/boosted/apr/getBoostedPoolApr.d.ts +9 -0
  24. package/dist/utils/boosted/apr/getBoostedPoolApr.d.ts.map +1 -0
  25. package/dist/utils/boosted/checkIsBoostedPool.d.ts +3 -0
  26. package/dist/utils/boosted/checkIsBoostedPool.d.ts.map +1 -0
  27. package/dist/utils/boosted/types.d.ts +10 -0
  28. package/dist/utils/boosted/types.d.ts.map +1 -0
  29. package/dist/utils/index.d.ts +2 -0
  30. package/dist/utils/index.d.ts.map +1 -1
  31. package/dist/utils/isPoolsSupported.d.ts +3 -1
  32. package/dist/utils/isPoolsSupported.d.ts.map +1 -1
  33. package/package.json +7 -7
  34. package/dist/abis/ICake.d.ts +0 -92
  35. package/dist/abis/ICake.d.ts.map +0 -1
  36. package/dist/queries/fetchUserIfo.d.ts +0 -16
  37. package/dist/queries/fetchUserIfo.d.ts.map +0 -1
@@ -0,0 +1,3 @@
1
+ import { BoosterConfig } from '../../utils/boosted/types';
2
+ export declare const arbBoostedPools: BoosterConfig[];
3
+ //# sourceMappingURL=arb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arb.d.ts","sourceRoot":"","sources":["../../../src/constants/boostedPools/arb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAe,MAAM,2BAA2B,CAAA;AAEtE,eAAO,MAAM,eAAe,EAAE,aAAa,EAO1C,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { ChainId } from '@pancakeswap/chains';
2
+ import { BoosterConfig } from '../../utils/boosted/types';
3
+ export type BoostedPoolsConfigByChain<TChainId extends ChainId> = {
4
+ [chainId in TChainId]?: BoosterConfig[];
5
+ };
6
+ export declare const BOOSTED_POOLS_CONFIG_BY_CHAIN: BoostedPoolsConfigByChain<ChainId>;
7
+ export declare const getBoostedPoolsConfig: (chainId: ChainId) => BoosterConfig[] | undefined;
8
+ export declare const getBoostedPoolConfig: (chainId: ChainId, contractAddress: string) => BoosterConfig | undefined;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/boostedPools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEzD,MAAM,MAAM,yBAAyB,CAAC,QAAQ,SAAS,OAAO,IAAI;KAC/D,OAAO,IAAI,QAAQ,CAAC,CAAC,EAAE,aAAa,EAAE;CACxC,CAAA;AAED,eAAO,MAAM,6BAA6B,oCAEH,CAAA;AAEvC,eAAO,MAAM,qBAAqB,YAAa,OAAO,gCAErD,CAAA;AAED,eAAO,MAAM,oBAAoB,YAAa,OAAO,mBAAmB,MAAM,KAAG,aAAa,GAAG,SAGhG,CAAA"}
@@ -6,7 +6,7 @@ export type ContractAddresses<T extends ChainId = SupportedChainId> = {
6
6
  };
7
7
  export declare const ICAKE: {
8
8
  readonly 56: "0x3C458828D1622F5f4d526eb0d24Da8C4Eb8F07b1";
9
- readonly 97: "0x";
9
+ readonly 97: "0x5FB0b7a782c2f192493d86922dD3873b6392C8e8";
10
10
  readonly 1: "0x";
11
11
  readonly 42161: "0x";
12
12
  readonly 421613: "0x";
@@ -1,4 +1,5 @@
1
1
  export * from './pools';
2
+ export * from './boostedPools';
2
3
  export * from './contracts';
3
4
  export * from './supportedChains';
4
5
  export declare const BSC_BLOCK_TIME = 3;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AAEjC,eAAO,MAAM,cAAc,IAAI,CAAA;AAE/B,eAAO,MAAM,cAAc,QAAkC,CAAA;AAC7D,eAAO,MAAM,eAAe,QAAuB,CAAA;AAEnD,eAAO,MAAM,eAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AAEjC,eAAO,MAAM,cAAc,IAAI,CAAA;AAE/B,eAAO,MAAM,cAAc,QAAkC,CAAA;AAC7D,eAAO,MAAM,eAAe,QAAuB,CAAA;AAEnD,eAAO,MAAM,eAAe,WAAW,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"324.d.ts","sourceRoot":"","sources":["../../../src/constants/pools/324.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAA;AAE1D,eAAO,MAAM,SAAS,EAAE,cAAc,EAenC,CAAA;AAGH,eAAO,MAAM,aAAa,EAAE,cAAc,EAAO,CAAA;AAEjD,eAAO,MAAM,KAAK,EAAE,cAAc,EAAqC,CAAA"}
1
+ {"version":3,"file":"324.d.ts","sourceRoot":"","sources":["../../../src/constants/pools/324.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAA;AAE1D,eAAO,MAAM,SAAS,EAAE,cAAc,EAAO,CAAA;AAS7C,eAAO,MAAM,aAAa,EAAE,cAAc,EAgBvC,CAAA;AAEH,eAAO,MAAM,KAAK,EAAE,cAAc,EAAqC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"42161.d.ts","sourceRoot":"","sources":["../../../src/constants/pools/42161.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAA;AAE1D,eAAO,MAAM,SAAS,EAAE,cAAc,EAenC,CAAA;AAGH,eAAO,MAAM,aAAa,EAAE,cAAc,EAgBvC,CAAA;AAEH,eAAO,MAAM,KAAK,EAAE,cAAc,EAAqC,CAAA"}
1
+ {"version":3,"file":"42161.d.ts","sourceRoot":"","sources":["../../../src/constants/pools/42161.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAA;AAE1D,eAAO,MAAM,SAAS,EAAE,cAAc,EAenC,CAAA;AAGH,eAAO,MAAM,aAAa,EAAE,cAAc,EAyBvC,CAAA;AAEH,eAAO,MAAM,KAAK,EAAE,cAAc,EAAqC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"56.d.ts","sourceRoot":"","sources":["../../../src/constants/pools/56.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAA;AAE1D,eAAO,MAAM,SAAS,EAAE,cAAc,EA8EnC,CAAA;AA80FH,eAAO,MAAM,KAAK,EAAE,cAAc,EAAqC,CAAA"}
1
+ {"version":3,"file":"56.d.ts","sourceRoot":"","sources":["../../../src/constants/pools/56.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAA;AAE1D,eAAO,MAAM,SAAS,EAAE,cAAc,EAmDnC,CAAA;AAy2FH,eAAO,MAAM,KAAK,EAAE,cAAc,EAAqC,CAAA"}
@@ -1,4 +1,6 @@
1
1
  import { ChainId } from '@pancakeswap/chains';
2
2
  export declare const SUPPORTED_CHAIN_IDS: readonly [ChainId.BSC, ChainId.BSC_TESTNET, ChainId.ETHEREUM, ChainId.ARBITRUM_ONE, ChainId.ARBITRUM_GOERLI, ChainId.ZKSYNC, ChainId.ZKSYNC_TESTNET, ChainId.LINEA_TESTNET, ChainId.BASE_TESTNET, ChainId.POLYGON_ZKEVM_TESTNET];
3
3
  export type SupportedChainId = (typeof SUPPORTED_CHAIN_IDS)[number];
4
+ export declare const CAKE_VAULT_SUPPORTED_CHAINS: readonly [ChainId.BSC, ChainId.BSC_TESTNET];
5
+ export type CakeVaultSupportedChainId = (typeof CAKE_VAULT_SUPPORTED_CHAINS)[number];
4
6
  //# sourceMappingURL=supportedChains.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"supportedChains.d.ts","sourceRoot":"","sources":["../../src/constants/supportedChains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE7C,eAAO,MAAM,mBAAmB,kOAWtB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA"}
1
+ {"version":3,"file":"supportedChains.d.ts","sourceRoot":"","sources":["../../src/constants/supportedChains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE7C,eAAO,MAAM,mBAAmB,kOAWtB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEnE,eAAO,MAAM,2BAA2B,6CAA8C,CAAA;AAEtF,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,6 @@ export * from './constants';
2
2
  export * from './types';
3
3
  export * from './queries';
4
4
  export * from './utils';
5
- export * from './abis/ICake';
6
5
  export * from './abis/ICakeFlexibleSideVaultV2';
7
6
  export * from './abis/ICakeVaultV2';
8
7
  export * from './abis/ISmartChef';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AAGvB,cAAc,cAAc,CAAA;AAC5B,cAAc,iCAAiC,CAAA;AAC/C,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AAGvB,cAAc,iCAAiC,CAAA;AAC/C,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"}
package/dist/index.js CHANGED
@@ -162,16 +162,14 @@ var livePools2 = [
162
162
  poolCategory: "Core" /* CORE */,
163
163
  tokenPerBlock: "0.1118",
164
164
  version: 3
165
- },
166
- {
167
- sousId: 360,
168
- stakingToken: tokens.bscTokens.cake,
169
- earningToken: tokens.bscTokens.axl,
170
- contractAddress: "0x32f0414a4e970a3edd9e7db367A43348F25D74cD",
171
- poolCategory: "Core" /* CORE */,
172
- tokenPerBlock: "0.05358",
173
- version: 3
174
- },
165
+ }
166
+ ].map((p) => ({
167
+ ...p,
168
+ contractAddress: viem.getAddress(p.contractAddress),
169
+ stakingToken: p.stakingToken.serialize,
170
+ earningToken: p.earningToken.serialize
171
+ }));
172
+ var finishedPools2 = [
175
173
  {
176
174
  sousId: 359,
177
175
  stakingToken: tokens.bscTokens.cake,
@@ -189,14 +187,16 @@ var livePools2 = [
189
187
  poolCategory: "Core" /* CORE */,
190
188
  tokenPerBlock: "0.02314",
191
189
  version: 3
192
- }
193
- ].map((p) => ({
194
- ...p,
195
- contractAddress: viem.getAddress(p.contractAddress),
196
- stakingToken: p.stakingToken.serialize,
197
- earningToken: p.earningToken.serialize
198
- }));
199
- var finishedPools2 = [
190
+ },
191
+ {
192
+ sousId: 360,
193
+ stakingToken: tokens.bscTokens.cake,
194
+ earningToken: tokens.bscTokens.axl,
195
+ contractAddress: "0x32f0414a4e970a3edd9e7db367A43348F25D74cD",
196
+ poolCategory: "Core" /* CORE */,
197
+ tokenPerBlock: "0.05358",
198
+ version: 3
199
+ },
200
200
  {
201
201
  sousId: 357,
202
202
  stakingToken: tokens.bscTokens.cake,
@@ -3087,15 +3087,15 @@ var finishedPools2 = [
3087
3087
  }));
3088
3088
  var pools2 = [...livePools2, ...finishedPools2];
3089
3089
  var livePools3 = [
3090
- // {
3091
- // sousId: 0,
3092
- // stakingToken: bscTestnetTokens.cake2,
3093
- // earningToken: bscTestnetTokens.cake2,
3094
- // contractAddress: '0x4c650FB471fe4e0f476fD3437C3411B1122c4e3B',
3095
- // poolCategory: PoolCategory.CORE,
3096
- // tokenPerBlock: '0.01',
3097
- // isFinished: false,
3098
- // },
3090
+ {
3091
+ sousId: 0,
3092
+ stakingToken: tokens.bscTestnetTokens.cake2,
3093
+ earningToken: tokens.bscTestnetTokens.cake2,
3094
+ contractAddress: "0xf6B427A2Df6E24600e3e3c62634B7c478826619D",
3095
+ poolCategory: "Core" /* CORE */,
3096
+ tokenPerBlock: "0.01",
3097
+ isFinished: false
3098
+ },
3099
3099
  {
3100
3100
  sousId: 1,
3101
3101
  stakingToken: tokens.bscTestnetTokens.cake2,
@@ -3154,12 +3154,12 @@ var finishedPools3 = [];
3154
3154
  var pools3 = [...livePools3, ...finishedPools3];
3155
3155
  var livePools4 = [
3156
3156
  {
3157
- sousId: 2,
3157
+ sousId: 3,
3158
3158
  stakingToken: tokens.arbitrumTokens.alp,
3159
3159
  earningToken: tokens.arbitrumTokens.cake,
3160
- contractAddress: "0x0639c5715EC308E16f089c96C0C109302d76FA81",
3160
+ contractAddress: "0x85146C0c5968d9640121eebd13030c99298f87b3",
3161
3161
  poolCategory: "Core" /* CORE */,
3162
- tokenPerSecond: "0.01177",
3162
+ tokenPerSecond: "0.00615",
3163
3163
  version: 3
3164
3164
  }
3165
3165
  ].map((p) => ({
@@ -3169,6 +3169,15 @@ var livePools4 = [
3169
3169
  earningToken: p.earningToken.serialize
3170
3170
  }));
3171
3171
  var finishedPools4 = [
3172
+ {
3173
+ sousId: 2,
3174
+ stakingToken: tokens.arbitrumTokens.alp,
3175
+ earningToken: tokens.arbitrumTokens.cake,
3176
+ contractAddress: "0x0639c5715EC308E16f089c96C0C109302d76FA81",
3177
+ poolCategory: "Core" /* CORE */,
3178
+ tokenPerSecond: "0.01177",
3179
+ version: 3
3180
+ },
3172
3181
  {
3173
3182
  sousId: 1,
3174
3183
  stakingToken: tokens.arbitrumTokens.alp,
@@ -3247,7 +3256,8 @@ var finishedPools5 = [
3247
3256
  earningToken: p.earningToken.serialize
3248
3257
  }));
3249
3258
  var pools5 = [...livePools5, ...finishedPools5];
3250
- var livePools6 = [
3259
+ var livePools6 = [];
3260
+ var finishedPools6 = [
3251
3261
  {
3252
3262
  sousId: 1,
3253
3263
  stakingToken: tokens.zksyncTokens.cake,
@@ -3259,11 +3269,11 @@ var livePools6 = [
3259
3269
  }
3260
3270
  ].map((p) => ({
3261
3271
  ...p,
3272
+ isFinished: true,
3262
3273
  contractAddress: viem.getAddress(p.contractAddress),
3263
3274
  stakingToken: p.stakingToken.serialize,
3264
3275
  earningToken: p.earningToken.serialize
3265
3276
  }));
3266
- var finishedPools6 = [];
3267
3277
  var pools6 = [...livePools6, ...finishedPools6];
3268
3278
  var livePools7 = [
3269
3279
  {
@@ -3472,11 +3482,15 @@ var SUPPORTED_CHAIN_IDS = [
3472
3482
  chains.ChainId.BASE_TESTNET,
3473
3483
  chains.ChainId.POLYGON_ZKEVM_TESTNET
3474
3484
  ];
3485
+ var CAKE_VAULT_SUPPORTED_CHAINS = [chains.ChainId.BSC, chains.ChainId.BSC_TESTNET];
3475
3486
 
3476
3487
  // src/utils/isPoolsSupported.ts
3477
3488
  function isPoolsSupported(chainId) {
3478
3489
  return SUPPORTED_CHAIN_IDS.includes(chainId);
3479
3490
  }
3491
+ function isCakeVaultSupported(chainId) {
3492
+ return !!chainId && CAKE_VAULT_SUPPORTED_CHAINS.includes(chainId);
3493
+ }
3480
3494
 
3481
3495
  // src/constants/pools/index.ts
3482
3496
  var POOLS_CONFIG_BY_CHAIN = {
@@ -3526,9 +3540,30 @@ var UNLOCK_FREE_DURATION = 604800;
3526
3540
  var ONE_WEEK_DEFAULT = 604800;
3527
3541
  var BOOST_WEIGHT = 20000000000000n;
3528
3542
  var DURATION_FACTOR = 31536000n;
3543
+
3544
+ // src/constants/boostedPools/arb.ts
3545
+ var arbBoostedPools = [
3546
+ {
3547
+ boosterType: 0 /* ALP */,
3548
+ contractAddress: "0x85146C0c5968d9640121eebd13030c99298f87b3",
3549
+ tooltipsText: "Fee APY include the transaction fees shared in the ALP pool, funding rates for positions held, and liquidation income, and will be reflected in the growth of the ALP price. Stake APY is the return for staking ALP. Both Annualized using compound interest, for reference purposes only."
3550
+ }
3551
+ ];
3552
+
3553
+ // src/constants/boostedPools/index.ts
3554
+ var BOOSTED_POOLS_CONFIG_BY_CHAIN = {
3555
+ [chains.ChainId.ARBITRUM_ONE]: arbBoostedPools
3556
+ };
3557
+ var getBoostedPoolsConfig = (chainId) => {
3558
+ return BOOSTED_POOLS_CONFIG_BY_CHAIN[chainId];
3559
+ };
3560
+ var getBoostedPoolConfig = (chainId, contractAddress) => {
3561
+ const pool = getBoostedPoolsConfig(chainId);
3562
+ return pool?.find((i) => i?.contractAddress?.toLowerCase() === contractAddress.toLowerCase());
3563
+ };
3529
3564
  var ICAKE = {
3530
3565
  [chains.ChainId.BSC]: "0x3C458828D1622F5f4d526eb0d24Da8C4Eb8F07b1",
3531
- [chains.ChainId.BSC_TESTNET]: "0x",
3566
+ [chains.ChainId.BSC_TESTNET]: "0x5FB0b7a782c2f192493d86922dD3873b6392C8e8",
3532
3567
  [chains.ChainId.ETHEREUM]: "0x",
3533
3568
  [chains.ChainId.ARBITRUM_ONE]: "0x",
3534
3569
  [chains.ChainId.ARBITRUM_GOERLI]: "0x",
@@ -4974,6 +5009,79 @@ function getPoolContractBySousId({ chainId, sousId, signer, publicClient }) {
4974
5009
  return getSmartChefChefV2Contract({ address: contractAddress, signer, publicClient });
4975
5010
  }
4976
5011
 
5012
+ // src/utils/boosted/checkIsBoostedPool.ts
5013
+ var checkIsBoostedPool = (contract, chainId) => {
5014
+ const list = getBoostedPoolsConfig(chainId);
5015
+ const isBoosted = list?.find((i) => i?.contractAddress?.toLowerCase() === contract.toLowerCase());
5016
+ return isBoosted !== void 0;
5017
+ };
5018
+ var WEEK = 7;
5019
+ var YEAR = 365;
5020
+ var CONTRACT_ADDRESS = "0xB3879E95a4B8e3eE570c232B19d520821F540E48";
5021
+ var API_URL = "https://perp.pancakeswap.finance/bapi/futures/v1/public/future/apx/fee/info?chain=ARB";
5022
+ var fetchAlpBoostedPoolApr = async (client) => {
5023
+ try {
5024
+ const [totalValue] = await client.multicall({
5025
+ contracts: [
5026
+ {
5027
+ abi: [
5028
+ {
5029
+ inputs: [],
5030
+ name: "totalValue",
5031
+ outputs: [
5032
+ {
5033
+ components: [
5034
+ { internalType: "address", name: "tokenAddress", type: "address" },
5035
+ { internalType: "int256", name: "value", type: "int256" },
5036
+ { internalType: "uint8", name: "decimals", type: "uint8" },
5037
+ { internalType: "int256", name: "valueUsd", type: "int256" },
5038
+ { internalType: "uint16", name: "targetWeight", type: "uint16" },
5039
+ { internalType: "uint16", name: "feeBasisPoints", type: "uint16" },
5040
+ { internalType: "uint16", name: "taxBasisPoints", type: "uint16" },
5041
+ { internalType: "bool", name: "dynamicFee", type: "bool" }
5042
+ ],
5043
+ internalType: "struct IVault.LpItem[]",
5044
+ name: "lpItems",
5045
+ type: "tuple[]"
5046
+ }
5047
+ ],
5048
+ stateMutability: "view",
5049
+ type: "function"
5050
+ }
5051
+ ],
5052
+ address: CONTRACT_ADDRESS,
5053
+ functionName: "totalValue"
5054
+ }
5055
+ ],
5056
+ allowFailure: false
5057
+ });
5058
+ const totalValueUsd = totalValue.map((i) => new BigNumber7__default.default(i.valueUsd.toString()).div(1e18).toNumber()).reduce((a, b) => a + b, 0);
5059
+ const response = await fetch(API_URL);
5060
+ const result = await response.json();
5061
+ const { alpFundingFee, alpTradingFee, alpLipFee } = result.data;
5062
+ const apr = new BigNumber7__default.default(alpFundingFee).plus(alpTradingFee).plus(alpLipFee);
5063
+ const totalApr = apr.div(totalValueUsd.toString()).div(WEEK);
5064
+ const apy = totalApr.plus(1).exponentiatedBy(YEAR).minus(1).times(100);
5065
+ return apy.toNumber();
5066
+ } catch (error) {
5067
+ console.info("Fetch ALP boosted fee error: ", error);
5068
+ return 0;
5069
+ }
5070
+ };
5071
+
5072
+ // src/utils/boosted/apr/getBoostedPoolApr.ts
5073
+ var getBoostedPoolApr = async ({ client, contractAddress, chainId }) => {
5074
+ const pool = chainId && getBoostedPoolConfig(chainId, contractAddress);
5075
+ if (!contractAddress || !chainId || !pool) {
5076
+ return 0;
5077
+ }
5078
+ if (pool?.boosterType === 0 /* ALP */) {
5079
+ const result = await fetchAlpBoostedPoolApr(client);
5080
+ return result;
5081
+ }
5082
+ return 0;
5083
+ };
5084
+
4977
5085
  // src/queries/fetchPools.ts
4978
5086
  var getLivePoolsWithEnd = async (chainId) => {
4979
5087
  const poolsConfig = getPoolsConfig(chainId);
@@ -5330,99 +5438,6 @@ var fetchUserPendingRewards = async ({ account, chainId, provider }) => {
5330
5438
  return fromPairs2__default.default(nonMasterPools.map((pool, index) => [pool.sousId, new BigNumber7__default.default(res[index].toString()).toJSON()]));
5331
5439
  };
5332
5440
 
5333
- // src/abis/ICake.ts
5334
- var iCakeABI = [
5335
- {
5336
- inputs: [],
5337
- name: "MIN_CEILING_DURATION",
5338
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
5339
- stateMutability: "view",
5340
- type: "function"
5341
- },
5342
- {
5343
- inputs: [],
5344
- name: "admin",
5345
- outputs: [{ internalType: "address", name: "", type: "address" }],
5346
- stateMutability: "view",
5347
- type: "function"
5348
- },
5349
- {
5350
- inputs: [],
5351
- name: "cakePool",
5352
- outputs: [{ internalType: "contract ICaKePool", name: "", type: "address" }],
5353
- stateMutability: "view",
5354
- type: "function"
5355
- },
5356
- {
5357
- inputs: [],
5358
- name: "ceiling",
5359
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
5360
- stateMutability: "view",
5361
- type: "function"
5362
- },
5363
- {
5364
- inputs: [{ internalType: "address", name: "_user", type: "address" }],
5365
- name: "getUserCredit",
5366
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
5367
- stateMutability: "view",
5368
- type: "function"
5369
- },
5370
- {
5371
- inputs: [],
5372
- name: "owner",
5373
- outputs: [{ internalType: "address", name: "", type: "address" }],
5374
- stateMutability: "view",
5375
- type: "function"
5376
- },
5377
- { inputs: [], name: "renounceOwnership", outputs: [], stateMutability: "nonpayable", type: "function" },
5378
- {
5379
- inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
5380
- name: "transferOwnership",
5381
- outputs: [],
5382
- stateMutability: "nonpayable",
5383
- type: "function"
5384
- },
5385
- {
5386
- inputs: [{ internalType: "uint256", name: "_newCeiling", type: "uint256" }],
5387
- name: "updateCeiling",
5388
- outputs: [],
5389
- stateMutability: "nonpayable",
5390
- type: "function"
5391
- }
5392
- ];
5393
-
5394
- // src/queries/fetchUserIfo.ts
5395
- var getIfoCreditAddressContract = (chainId, provider, walletClient) => {
5396
- const address = getContractAddress(ICAKE, chainId);
5397
- if (!address || address === "0x") {
5398
- throw new Error(`ICAKE not supported on chain ${chainId}`);
5399
- }
5400
- return viem.getContract({ abi: iCakeABI, address, publicClient: provider({ chainId }), walletClient });
5401
- };
5402
- var fetchPublicIfoData = async (chainId, provider) => {
5403
- try {
5404
- const ifoCreditAddressContract = getIfoCreditAddressContract(chainId, provider);
5405
- const ceiling = await ifoCreditAddressContract.read.ceiling();
5406
- return {
5407
- ceiling: new BigNumber7__default.default(ceiling.toString()).toJSON()
5408
- };
5409
- } catch (error) {
5410
- return {
5411
- ceiling: BIG_ZERO.toJSON()
5412
- };
5413
- }
5414
- };
5415
- var fetchUserIfoCredit = async ({ account, chainId, provider }) => {
5416
- try {
5417
- const ifoCreditAddressContract = getIfoCreditAddressContract(chainId, provider);
5418
- const credit = await ifoCreditAddressContract.read.getUserCredit([account]);
5419
- return new BigNumber7__default.default(credit.toString()).toJSON();
5420
- } catch (error) {
5421
- console.error(error);
5422
- return BIG_ZERO.toJSON();
5423
- }
5424
- };
5425
-
5426
5441
  // src/abis/ICakeVaultV2.ts
5427
5442
  var cakeVaultV2ABI = [
5428
5443
  {
@@ -6645,10 +6660,12 @@ var fetchFlexibleSideVaultUser = async ({
6645
6660
 
6646
6661
  exports.BLOCKS_PER_DAY = BLOCKS_PER_DAY;
6647
6662
  exports.BLOCKS_PER_YEAR = BLOCKS_PER_YEAR;
6663
+ exports.BOOSTED_POOLS_CONFIG_BY_CHAIN = BOOSTED_POOLS_CONFIG_BY_CHAIN;
6648
6664
  exports.BOOST_WEIGHT = BOOST_WEIGHT;
6649
6665
  exports.BSC_BLOCK_TIME = BSC_BLOCK_TIME;
6650
6666
  exports.CAKE_FLEXIBLE_SIDE_VAULT = CAKE_FLEXIBLE_SIDE_VAULT;
6651
6667
  exports.CAKE_VAULT = CAKE_VAULT;
6668
+ exports.CAKE_VAULT_SUPPORTED_CHAINS = CAKE_VAULT_SUPPORTED_CHAINS;
6652
6669
  exports.DURATION_FACTOR = DURATION_FACTOR;
6653
6670
  exports.ICAKE = ICAKE;
6654
6671
  exports.LIVE_POOLS_CONFIG_BY_CHAIN = LIVE_POOLS_CONFIG_BY_CHAIN;
@@ -6662,6 +6679,7 @@ exports.UNLOCK_FREE_DURATION = UNLOCK_FREE_DURATION;
6662
6679
  exports.VaultKey = VaultKey;
6663
6680
  exports.cakeFlexibleSideVaultV2ABI = cakeFlexibleSideVaultV2ABI;
6664
6681
  exports.cakeVaultV2ABI = cakeVaultV2ABI;
6682
+ exports.checkIsBoostedPool = checkIsBoostedPool;
6665
6683
  exports.fetchFlexibleSideVaultUser = fetchFlexibleSideVaultUser;
6666
6684
  exports.fetchPoolsAllowance = fetchPoolsAllowance;
6667
6685
  exports.fetchPoolsProfileRequirement = fetchPoolsProfileRequirement;
@@ -6670,18 +6688,18 @@ exports.fetchPoolsStakingLimitsByBlock = fetchPoolsStakingLimitsByBlock;
6670
6688
  exports.fetchPoolsTimeLimits = fetchPoolsTimeLimits;
6671
6689
  exports.fetchPoolsTotalStaking = fetchPoolsTotalStaking;
6672
6690
  exports.fetchPublicFlexibleSideVaultData = fetchPublicFlexibleSideVaultData;
6673
- exports.fetchPublicIfoData = fetchPublicIfoData;
6674
6691
  exports.fetchPublicVaultData = fetchPublicVaultData;
6675
6692
  exports.fetchUserBalances = fetchUserBalances;
6676
- exports.fetchUserIfoCredit = fetchUserIfoCredit;
6677
6693
  exports.fetchUserPendingRewards = fetchUserPendingRewards;
6678
6694
  exports.fetchUserStakeBalances = fetchUserStakeBalances;
6679
6695
  exports.fetchVaultFees = fetchVaultFees;
6680
6696
  exports.fetchVaultUser = fetchVaultUser;
6697
+ exports.getBoostedPoolApr = getBoostedPoolApr;
6698
+ exports.getBoostedPoolConfig = getBoostedPoolConfig;
6699
+ exports.getBoostedPoolsConfig = getBoostedPoolsConfig;
6681
6700
  exports.getCakeFlexibleSideVaultAddress = getCakeFlexibleSideVaultAddress;
6682
6701
  exports.getCakeVaultAddress = getCakeVaultAddress;
6683
6702
  exports.getContractAddress = getContractAddress;
6684
- exports.getIfoCreditAddressContract = getIfoCreditAddressContract;
6685
6703
  exports.getLivePoolsConfig = getLivePoolsConfig;
6686
6704
  exports.getPoolAprByTokenPerBlock = getPoolAprByTokenPerBlock;
6687
6705
  exports.getPoolAprByTokenPerSecond = getPoolAprByTokenPerSecond;
@@ -6690,7 +6708,7 @@ exports.getPoolsConfig = getPoolsConfig;
6690
6708
  exports.getSmartChefChefV2Contract = getSmartChefChefV2Contract;
6691
6709
  exports.getSousChefBNBContract = getSousChefBNBContract;
6692
6710
  exports.getSousChefV2Contract = getSousChefV2Contract;
6693
- exports.iCakeABI = iCakeABI;
6711
+ exports.isCakeVaultSupported = isCakeVaultSupported;
6694
6712
  exports.isLegacyPool = isLegacyPool;
6695
6713
  exports.isPoolsSupported = isPoolsSupported;
6696
6714
  exports.isUpgradedPool = isUpgradedPool;