@gearbox-protocol/sdk 3.0.0-prevfour.7 → 3.0.0-prevfour.8
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/lib/apy/skyAPY.d.ts +2 -1
- package/lib/apy/skyAPY.js +3 -3
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -2
- package/package.json +1 -1
- package/lib/core/bot.d.ts +0 -12
- package/lib/core/bot.js +0 -23
- package/lib/payload/bot.d.ts +0 -13
- package/lib/payload/bot.js +0 -2
package/lib/apy/skyAPY.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PartialRecord, SupportedToken } from "@gearbox-protocol/sdk-gov";
|
|
2
|
+
import { Address } from "viem";
|
|
2
3
|
type SkyTokens = Extract<SupportedToken, "sUSDS" | "stkUSDS">;
|
|
3
4
|
export type SkyAPYResult = PartialRecord<SkyTokens, number>;
|
|
4
|
-
export declare function getSkyAPY(): Promise<SkyAPYResult>;
|
|
5
|
+
export declare function getSkyAPY(currentTokens: Record<SupportedToken, Address>): Promise<SkyAPYResult>;
|
|
5
6
|
export {};
|
package/lib/apy/skyAPY.js
CHANGED
|
@@ -8,7 +8,7 @@ const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
|
|
|
8
8
|
const axios_1 = __importDefault(require("axios"));
|
|
9
9
|
const getSavingsURL = () => `https://info-sky.blockanalitica.com/save/?format=json`;
|
|
10
10
|
const getFarmingURL = () => `https://info-sky.blockanalitica.com/farms/?format=json`;
|
|
11
|
-
async function getSkyAPY() {
|
|
11
|
+
async function getSkyAPY(currentTokens) {
|
|
12
12
|
try {
|
|
13
13
|
const [savings, farm] = await Promise.all([
|
|
14
14
|
axios_1.default.get(getSavingsURL()),
|
|
@@ -17,8 +17,8 @@ async function getSkyAPY() {
|
|
|
17
17
|
const savingsRate = savings?.data?.ssr_rate || 0;
|
|
18
18
|
const farmRate = farm?.data?.sky_farm.apy || 0;
|
|
19
19
|
return {
|
|
20
|
-
sUSDS: numberToAPY(Number(savingsRate)),
|
|
21
|
-
stkUSDS: numberToAPY(Number(farmRate)),
|
|
20
|
+
[currentTokens.sUSDS]: numberToAPY(Number(savingsRate)),
|
|
21
|
+
[currentTokens.stkUSDS]: numberToAPY(Number(farmRate)),
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
catch (e) {
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./apy";
|
|
2
2
|
export * from "./contracts/contractsRegister";
|
|
3
3
|
export * from "./core/assets";
|
|
4
|
-
export * from "./core/bot";
|
|
5
4
|
export * from "./core/creditAccount";
|
|
6
5
|
export * from "./core/creditManager";
|
|
7
6
|
export * from "./core/creditSession";
|
|
@@ -14,7 +13,6 @@ export * from "./core/strategy";
|
|
|
14
13
|
export * from "./core/transactions";
|
|
15
14
|
export * from "./gearboxRewards";
|
|
16
15
|
export * from "./pathfinder";
|
|
17
|
-
export * from "./payload/bot";
|
|
18
16
|
export * from "./payload/creditAccount";
|
|
19
17
|
export * from "./payload/creditManager";
|
|
20
18
|
export * from "./payload/creditSession";
|
package/lib/index.js
CHANGED
|
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./apy"), exports);
|
|
18
18
|
__exportStar(require("./contracts/contractsRegister"), exports);
|
|
19
19
|
__exportStar(require("./core/assets"), exports);
|
|
20
|
-
__exportStar(require("./core/bot"), exports);
|
|
21
20
|
__exportStar(require("./core/creditAccount"), exports);
|
|
22
21
|
__exportStar(require("./core/creditManager"), exports);
|
|
23
22
|
__exportStar(require("./core/creditSession"), exports);
|
|
@@ -30,7 +29,6 @@ __exportStar(require("./core/strategy"), exports);
|
|
|
30
29
|
__exportStar(require("./core/transactions"), exports);
|
|
31
30
|
__exportStar(require("./gearboxRewards"), exports);
|
|
32
31
|
__exportStar(require("./pathfinder"), exports);
|
|
33
|
-
__exportStar(require("./payload/bot"), exports);
|
|
34
32
|
__exportStar(require("./payload/creditAccount"), exports);
|
|
35
33
|
__exportStar(require("./payload/creditManager"), exports);
|
|
36
34
|
__exportStar(require("./payload/creditSession"), exports);
|
package/package.json
CHANGED
package/lib/core/bot.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Address } from "viem";
|
|
2
|
-
import { BotBaseType, BotDataPayload, BotDetailedType } from "../payload/bot";
|
|
3
|
-
export declare class BotData {
|
|
4
|
-
readonly address: Address;
|
|
5
|
-
readonly baseType: BotBaseType;
|
|
6
|
-
readonly detailedType: BotDetailedType;
|
|
7
|
-
readonly minHealthFactor: bigint;
|
|
8
|
-
readonly maxHealthFactor: bigint;
|
|
9
|
-
readonly premiumScaleFactor: bigint;
|
|
10
|
-
readonly feeScaleFactor: bigint;
|
|
11
|
-
constructor(payload: BotDataPayload);
|
|
12
|
-
}
|
package/lib/core/bot.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BotData = void 0;
|
|
4
|
-
const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
|
|
5
|
-
class BotData {
|
|
6
|
-
address;
|
|
7
|
-
baseType;
|
|
8
|
-
detailedType;
|
|
9
|
-
minHealthFactor;
|
|
10
|
-
maxHealthFactor;
|
|
11
|
-
premiumScaleFactor;
|
|
12
|
-
feeScaleFactor;
|
|
13
|
-
constructor(payload) {
|
|
14
|
-
this.address = payload.address.toLowerCase();
|
|
15
|
-
this.baseType = payload.baseType;
|
|
16
|
-
this.detailedType = payload.detailedType;
|
|
17
|
-
this.minHealthFactor = (0, sdk_gov_1.toBigInt)(payload.minHealthFactor);
|
|
18
|
-
this.maxHealthFactor = (0, sdk_gov_1.toBigInt)(payload.maxHealthFactor);
|
|
19
|
-
this.premiumScaleFactor = (0, sdk_gov_1.toBigInt)(payload.premiumScaleFactor);
|
|
20
|
-
this.feeScaleFactor = (0, sdk_gov_1.toBigInt)(payload.feeScaleFactor);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.BotData = BotData;
|
package/lib/payload/bot.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Address } from "viem";
|
|
2
|
-
export type BotBaseType = "liquidationProtection";
|
|
3
|
-
export type LiquidationBotType = "deleverageBotPegged" | "deleverageBotLV" | "deleverageBotHV";
|
|
4
|
-
export type BotDetailedType = LiquidationBotType;
|
|
5
|
-
export interface BotDataPayload {
|
|
6
|
-
baseType: BotBaseType;
|
|
7
|
-
detailedType: BotDetailedType;
|
|
8
|
-
address: Address;
|
|
9
|
-
minHealthFactor: number;
|
|
10
|
-
maxHealthFactor: number;
|
|
11
|
-
premiumScaleFactor: number;
|
|
12
|
-
feeScaleFactor: number;
|
|
13
|
-
}
|
package/lib/payload/bot.js
DELETED