@gearbox-protocol/sdk 3.0.0-next.243 → 3.0.0-next.244

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.
@@ -38,6 +38,9 @@ const NORMAL_TO_LAMA = {
38
38
  stkcvxcrvUSDTWBTCWETH: "3be97c90-d4a8-42b3-a0d0-2906ae4e9d27",
39
39
  stkcvxcrvUSDUSDC: "755fcec6-f4fd-4150-9184-60f099206694",
40
40
  stkcvxcrvUSDUSDT: "a3ffd3fe-b21c-44eb-94d5-22c80057a600",
41
+ PT_sUSDe_26DEC2024: "992d00f3-d43f-44fe-8b62-987e8610c9a8",
42
+ PT_ezETH_26DEC2024: "76953dd9-3132-49ad-ae88-b551c5b5c774",
43
+ PT_eETH_26DEC2024: "7bafc0e5-3789-4920-944f-d734d3ef0cef",
41
44
  },
42
45
  Optimism: { rETH: "d4b3c522-6127-4b89-bedf-83641cdcd2eb" },
43
46
  Arbitrum: {
@@ -1,6 +1,6 @@
1
1
  import { LPTokens, PartialRecord, SupportedToken } from "@gearbox-protocol/sdk-gov";
2
- type ExtraFarmTokens = Extract<SupportedToken, "STETH" | "rETH" | "osETH" | "cbETH" | "wstETH" | "weETH" | "ezETH" | "sfrxETH" | "USDe" | "rsETH" | "rswETH" | "pufETH" | "pzETH" | "rstETH" | "steakLRT" | "amphrETH" | "LBTC" | "Re7LRT">;
3
- type ExtraTokensWithAPY = Extract<ExtraFarmTokens, "STETH" | "rETH" | "osETH" | "cbETH" | "wstETH" | "sfrxETH" | "pzETH" | "ezETH" | "Re7LRT" | "rsETH" | "weETH" | "rswETH" | "rstETH" | "steakLRT" | "amphrETH" | "pufETH">;
2
+ type ExtraFarmTokens = Extract<SupportedToken, "STETH" | "rETH" | "osETH" | "cbETH" | "wstETH" | "weETH" | "ezETH" | "sfrxETH" | "USDe" | "rsETH" | "rswETH" | "pufETH" | "pzETH" | "rstETH" | "steakLRT" | "amphrETH" | "LBTC" | "Re7LRT" | "PT_ezETH_26DEC2024" | "PT_eETH_26DEC2024" | "PT_sUSDe_26DEC2024" | "PT_eBTC_26DEC2024" | "PT_LBTC_27MAR2025">;
3
+ type ExtraTokensWithAPY = Extract<ExtraFarmTokens, "STETH" | "rETH" | "osETH" | "cbETH" | "wstETH" | "sfrxETH" | "pzETH" | "ezETH" | "Re7LRT" | "rsETH" | "weETH" | "rswETH" | "rstETH" | "steakLRT" | "amphrETH" | "pufETH" | "PT_ezETH_26DEC2024" | "PT_eETH_26DEC2024" | "PT_sUSDe_26DEC2024">;
4
4
  type LRTAndLSTTokens = Exclude<ExtraFarmTokens, "USDe">;
5
5
  export declare const isExtraFarmToken: (t: unknown) => t is ExtraFarmTokens;
6
6
  export declare const isLRT_LSTToken: (t: unknown) => t is LRTAndLSTTokens;
@@ -12,4 +12,5 @@ export declare const isFarmToken: (t: unknown) => t is AllLPTokens;
12
12
  export * from "./curveAPY";
13
13
  export * from "./defiLamaAPY";
14
14
  export * from "./lidoAPY";
15
+ export * from "./skyAPY";
15
16
  export * from "./yearnAPY";
package/lib/apy/index.js CHANGED
@@ -35,6 +35,11 @@ const EXTRA_FARM_TOKENS = {
35
35
  amphrETH: true,
36
36
  LBTC: true,
37
37
  Re7LRT: true,
38
+ PT_ezETH_26DEC2024: true,
39
+ PT_eETH_26DEC2024: true,
40
+ PT_sUSDe_26DEC2024: true,
41
+ PT_eBTC_26DEC2024: true,
42
+ PT_LBTC_27MAR2025: true,
38
43
  };
39
44
  const isExtraFarmToken = (t) => {
40
45
  if (typeof t !== "string")
@@ -59,6 +64,9 @@ const EXTRA_TOKENS_WITH_APY = {
59
64
  steakLRT: true,
60
65
  amphrETH: true,
61
66
  pufETH: true,
67
+ PT_ezETH_26DEC2024: true,
68
+ PT_eETH_26DEC2024: true,
69
+ PT_sUSDe_26DEC2024: true,
62
70
  };
63
71
  const isExtraTokenWithAPY = (t) => {
64
72
  if (typeof t !== "string")
@@ -86,4 +94,5 @@ exports.isFarmToken = isFarmToken;
86
94
  __exportStar(require("./curveAPY"), exports);
87
95
  __exportStar(require("./defiLamaAPY"), exports);
88
96
  __exportStar(require("./lidoAPY"), exports);
97
+ __exportStar(require("./skyAPY"), exports);
89
98
  __exportStar(require("./yearnAPY"), exports);
@@ -0,0 +1,5 @@
1
+ import { PartialRecord, SupportedToken } from "@gearbox-protocol/sdk-gov";
2
+ type SkyTokens = Extract<SupportedToken, "sUSDS" | "stkUSDS">;
3
+ export type SkyAPYResult = PartialRecord<SkyTokens, number>;
4
+ export declare function getSkyAPY(): Promise<SkyAPYResult>;
5
+ export {};
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getSkyAPY = void 0;
7
+ const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
8
+ const axios_1 = __importDefault(require("axios"));
9
+ const getSavingsURL = () => `https://info-sky.blockanalitica.com/save/?format=json`;
10
+ const getFarmingURL = () => `https://info-sky.blockanalitica.com/farms/?format=json`;
11
+ async function getSkyAPY() {
12
+ try {
13
+ const [savings, farm] = await Promise.all([
14
+ axios_1.default.get(getSavingsURL()),
15
+ axios_1.default.get(getFarmingURL()),
16
+ ]);
17
+ const savingsRate = savings?.data?.ssr_rate || 0;
18
+ const farmRate = farm?.data?.sky_farm.apy || 0;
19
+ return {
20
+ sUSDS: numberToAPY(Number(savingsRate)),
21
+ stkUSDS: numberToAPY(Number(farmRate)),
22
+ };
23
+ }
24
+ catch (e) {
25
+ return {};
26
+ }
27
+ }
28
+ exports.getSkyAPY = getSkyAPY;
29
+ function numberToAPY(baseApy) {
30
+ return Math.round(baseApy * Number(sdk_gov_1.PERCENTAGE_FACTOR) * Number(sdk_gov_1.PERCENTAGE_DECIMALS));
31
+ }
@@ -22,7 +22,7 @@ async function getYearnAPY(network) {
22
22
  const { apr: apy } = data || {};
23
23
  const { netAPR } = apy || {};
24
24
  const netApy = netAPR || 0;
25
- const r = Math.round(netApy * Number(sdk_gov_1.PERCENTAGE_FACTOR) * Number(sdk_gov_1.PERCENTAGE_DECIMALS));
25
+ const r = numberToAPY(netApy);
26
26
  acc[yearnSymbol] = r;
27
27
  return acc;
28
28
  }, {});
@@ -33,3 +33,6 @@ async function getYearnAPY(network) {
33
33
  }
34
34
  }
35
35
  exports.getYearnAPY = getYearnAPY;
36
+ function numberToAPY(baseApy) {
37
+ return Math.round(baseApy * Number(sdk_gov_1.PERCENTAGE_FACTOR) * Number(sdk_gov_1.PERCENTAGE_DECIMALS));
38
+ }
@@ -7,6 +7,12 @@ const ALIASES = {
7
7
  dUSDC_eV3: "dUSDC.eV3",
8
8
  sdUSDC_eV3: "sdUSDC.eV3",
9
9
  sdWETHV3_OLD: "sdWETHV3 Old",
10
+ PT_rsETH_26SEP2024: "p.rsETH(26.09.24)",
11
+ PT_sUSDe_26DEC2024: "p.sUSDe(26.12.24)",
12
+ PT_eETH_26DEC2024: "p.eETH(26.12.24)",
13
+ PT_ezETH_26DEC2024: "p.ezETH(26.12.24)",
14
+ PT_eBTC_26DEC2024: "p.eBTC(26.12.24)",
15
+ PT_LBTC_27MAR2025: "p.LBTC(27.03.25)",
10
16
  };
11
17
  class TokenData {
12
18
  title;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "3.0.0-next.243",
3
+ "version": "3.0.0-next.244",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",