@gearbox-protocol/sdk 2.1.35 → 2.1.37
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/curveAPY.js +2 -1
- package/lib/apy/yearnAPY.js +1 -1
- package/lib/contracts/adapters.d.ts +1 -24
- package/lib/contracts/adapters.js +15 -26
- package/lib/contracts/contracts.d.ts +1 -112
- package/lib/contracts/contracts.js +15 -652
- package/lib/contracts/protocols.d.ts +1 -12
- package/lib/contracts/protocols.js +15 -14
- package/lib/contracts/utilsContracts.d.ts +1 -7
- package/lib/contracts/utilsContracts.js +15 -26
- package/lib/tokens/aave.d.ts +1 -20
- package/lib/tokens/aave.js +15 -60
- package/lib/tokens/balancer.d.ts +1 -12
- package/lib/tokens/balancer.js +15 -34
- package/lib/tokens/compound.d.ts +1 -11
- package/lib/tokens/compound.js +15 -36
- package/lib/tokens/convex.d.ts +1 -30
- package/lib/tokens/convex.js +15 -260
- package/lib/tokens/curveLP.d.ts +1 -27
- package/lib/tokens/curveLP.js +15 -139
- package/lib/tokens/decimals.d.ts +1 -2
- package/lib/tokens/decimals.js +15 -113
- package/lib/tokens/gear.d.ts +1 -14
- package/lib/tokens/gear.js +15 -45
- package/lib/tokens/index.d.ts +3 -0
- package/lib/tokens/index.js +19 -0
- package/lib/tokens/normal.d.ts +1 -9
- package/lib/tokens/normal.js +15 -192
- package/lib/tokens/quoted.d.ts +1 -3
- package/lib/tokens/quoted.js +15 -5
- package/lib/tokens/token.d.ts +1 -25
- package/lib/tokens/token.js +15 -303
- package/lib/tokens/tokenData.d.ts +1 -4
- package/lib/tokens/tokenData.js +16 -16
- package/lib/tokens/tokenType.d.ts +1 -15
- package/lib/tokens/tokenType.js +15 -17
- package/lib/tokens/yearn.d.ts +1 -26
- package/lib/tokens/yearn.js +15 -50
- package/package.json +2 -1
- package/lib/tokens/tokens.spec.d.ts +0 -1
- package/lib/tokens/tokens.spec.js +0 -151
package/lib/apy/curveAPY.js
CHANGED
|
@@ -26,7 +26,8 @@ const APY_DICTIONARY = {
|
|
|
26
26
|
crvUSDUSDC: "factory-crvusd-0",
|
|
27
27
|
crvUSDUSDT: "factory-crvusd-1",
|
|
28
28
|
crvUSDFRAX: "factory-crvusd-4",
|
|
29
|
-
crvUSDETHCRV: "factory-tricrypto-4",
|
|
29
|
+
crvUSDETHCRV: "factory-tricrypto-4",
|
|
30
|
+
rETH_f: "factory-crypto-210", // 0x0f3159811670c117c372428D4E69AC32325e4D0F
|
|
30
31
|
};
|
|
31
32
|
const CRV_APY_RESPONSE_DECIMALS = 100;
|
|
32
33
|
// const CRYPTO = "https://api.curve.fi/api/getPools/ethereum/crypto";
|
package/lib/apy/yearnAPY.js
CHANGED
|
@@ -10,7 +10,7 @@ const yearn_1 = require("../tokens/yearn");
|
|
|
10
10
|
const formatter_1 = require("../utils/formatter");
|
|
11
11
|
const mappers_1 = require("../utils/mappers");
|
|
12
12
|
const RESPONSE_DECIMALS = 1;
|
|
13
|
-
const URL = "https://api.
|
|
13
|
+
const URL = "https://api.yexporter.io/v1/chains/1/vaults/all";
|
|
14
14
|
const transformSymbol = (s) => s.replaceAll("_", "-").toLowerCase();
|
|
15
15
|
async function getYearnAPY() {
|
|
16
16
|
try {
|
|
@@ -1,24 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
ABSTRACT = 0,
|
|
3
|
-
UNISWAP_V2_ROUTER = 1,
|
|
4
|
-
UNISWAP_V3_ROUTER = 2,
|
|
5
|
-
CURVE_V1_EXCHANGE_ONLY = 3,
|
|
6
|
-
YEARN_V2 = 4,
|
|
7
|
-
CURVE_V1_2ASSETS = 5,
|
|
8
|
-
CURVE_V1_3ASSETS = 6,
|
|
9
|
-
CURVE_V1_4ASSETS = 7,
|
|
10
|
-
CURVE_V1_STECRV_POOL = 8,
|
|
11
|
-
CURVE_V1_WRAPPER = 9,
|
|
12
|
-
CONVEX_V1_BASE_REWARD_POOL = 10,
|
|
13
|
-
CONVEX_V1_BOOSTER = 11,
|
|
14
|
-
CONVEX_V1_CLAIM_ZAP = 12,
|
|
15
|
-
LIDO_V1 = 13,
|
|
16
|
-
UNIVERSAL = 14,
|
|
17
|
-
LIDO_WSTETH_V1 = 15,
|
|
18
|
-
BALANCER_VAULT = 16,
|
|
19
|
-
AAVE_V2_LENDING_POOL = 17,
|
|
20
|
-
AAVE_V2_WRAPPED_ATOKEN = 18,
|
|
21
|
-
COMPOUND_V2_CERC20 = 19,
|
|
22
|
-
COMPOUND_V2_CETHER = 20,
|
|
23
|
-
ERC4626_VAULT = 21
|
|
24
|
-
}
|
|
1
|
+
export * from "@gearbox-protocol/sdk-gov/lib/contracts/adapters";
|
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports
|
|
4
|
-
var AdapterInterface;
|
|
5
|
-
(function (AdapterInterface) {
|
|
6
|
-
AdapterInterface[AdapterInterface["ABSTRACT"] = 0] = "ABSTRACT";
|
|
7
|
-
AdapterInterface[AdapterInterface["UNISWAP_V2_ROUTER"] = 1] = "UNISWAP_V2_ROUTER";
|
|
8
|
-
AdapterInterface[AdapterInterface["UNISWAP_V3_ROUTER"] = 2] = "UNISWAP_V3_ROUTER";
|
|
9
|
-
AdapterInterface[AdapterInterface["CURVE_V1_EXCHANGE_ONLY"] = 3] = "CURVE_V1_EXCHANGE_ONLY";
|
|
10
|
-
AdapterInterface[AdapterInterface["YEARN_V2"] = 4] = "YEARN_V2";
|
|
11
|
-
AdapterInterface[AdapterInterface["CURVE_V1_2ASSETS"] = 5] = "CURVE_V1_2ASSETS";
|
|
12
|
-
AdapterInterface[AdapterInterface["CURVE_V1_3ASSETS"] = 6] = "CURVE_V1_3ASSETS";
|
|
13
|
-
AdapterInterface[AdapterInterface["CURVE_V1_4ASSETS"] = 7] = "CURVE_V1_4ASSETS";
|
|
14
|
-
AdapterInterface[AdapterInterface["CURVE_V1_STECRV_POOL"] = 8] = "CURVE_V1_STECRV_POOL";
|
|
15
|
-
AdapterInterface[AdapterInterface["CURVE_V1_WRAPPER"] = 9] = "CURVE_V1_WRAPPER";
|
|
16
|
-
AdapterInterface[AdapterInterface["CONVEX_V1_BASE_REWARD_POOL"] = 10] = "CONVEX_V1_BASE_REWARD_POOL";
|
|
17
|
-
AdapterInterface[AdapterInterface["CONVEX_V1_BOOSTER"] = 11] = "CONVEX_V1_BOOSTER";
|
|
18
|
-
AdapterInterface[AdapterInterface["CONVEX_V1_CLAIM_ZAP"] = 12] = "CONVEX_V1_CLAIM_ZAP";
|
|
19
|
-
AdapterInterface[AdapterInterface["LIDO_V1"] = 13] = "LIDO_V1";
|
|
20
|
-
AdapterInterface[AdapterInterface["UNIVERSAL"] = 14] = "UNIVERSAL";
|
|
21
|
-
AdapterInterface[AdapterInterface["LIDO_WSTETH_V1"] = 15] = "LIDO_WSTETH_V1";
|
|
22
|
-
AdapterInterface[AdapterInterface["BALANCER_VAULT"] = 16] = "BALANCER_VAULT";
|
|
23
|
-
AdapterInterface[AdapterInterface["AAVE_V2_LENDING_POOL"] = 17] = "AAVE_V2_LENDING_POOL";
|
|
24
|
-
AdapterInterface[AdapterInterface["AAVE_V2_WRAPPED_ATOKEN"] = 18] = "AAVE_V2_WRAPPED_ATOKEN";
|
|
25
|
-
AdapterInterface[AdapterInterface["COMPOUND_V2_CERC20"] = 19] = "COMPOUND_V2_CERC20";
|
|
26
|
-
AdapterInterface[AdapterInterface["COMPOUND_V2_CETHER"] = 20] = "COMPOUND_V2_CETHER";
|
|
27
|
-
AdapterInterface[AdapterInterface["ERC4626_VAULT"] = 21] = "ERC4626_VAULT";
|
|
28
|
-
})(AdapterInterface = exports.AdapterInterface || (exports.AdapterInterface = {}));
|
|
17
|
+
__exportStar(require("@gearbox-protocol/sdk-gov/lib/contracts/adapters"), exports);
|
|
@@ -1,112 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { AaveV2LPToken } from "../tokens/aave";
|
|
3
|
-
import { ConvexStakedPhantomToken } from "../tokens/convex";
|
|
4
|
-
import type { CurveLPToken } from "../tokens/curveLP";
|
|
5
|
-
import { NormalToken } from "../tokens/normal";
|
|
6
|
-
import type { YearnLPToken } from "../tokens/yearn";
|
|
7
|
-
import { AdapterInterface } from "./adapters";
|
|
8
|
-
import { Protocols } from "./protocols";
|
|
9
|
-
export type UniswapV2Contract = "UNISWAP_V2_ROUTER" | "SUSHISWAP_ROUTER";
|
|
10
|
-
export type CurvePoolContract = "CURVE_3CRV_POOL" | "CURVE_FRAX_USDC_POOL" | "CURVE_STETH_GATEWAY" | "CURVE_FRAX_POOL" | "CURVE_LUSD_POOL" | "CURVE_GUSD_POOL" | "CURVE_SUSD_POOL" | "CURVE_SUSD_DEPOSIT" | "CURVE_OHMFRAXBP_POOL" | "CURVE_CRVETH_POOL" | "CURVE_CVXETH_POOL" | "CURVE_3CRYPTO_POOL" | "CURVE_MIM_POOL" | "CURVE_LDOETH_POOL" | "CURVE_CRVUSD_USDC_POOL" | "CURVE_CRVUSD_USDT_POOL" | "CURVE_CRVUSD_FRAX_POOL" | "CURVE_TRI_CRV_POOL";
|
|
11
|
-
export type YearnVaultContract = "YEARN_DAI_VAULT" | "YEARN_USDC_VAULT" | "YEARN_WETH_VAULT" | "YEARN_WBTC_VAULT" | "YEARN_CURVE_FRAX_VAULT" | "YEARN_CURVE_STETH_VAULT";
|
|
12
|
-
export type ConvexPoolContract = "CONVEX_3CRV_POOL" | "CONVEX_FRAX_USDC_POOL" | "CONVEX_GUSD_POOL" | "CONVEX_SUSD_POOL" | "CONVEX_STECRV_POOL" | "CONVEX_FRAX3CRV_POOL" | "CONVEX_LUSD3CRV_POOL" | "CONVEX_OHMFRAXBP_POOL" | "CONVEX_MIM3CRV_POOL" | "CONVEX_CRVETH_POOL" | "CONVEX_CVXETH_POOL" | "CONVEX_3CRYPTO_POOL" | "CONVEX_LDOETH_POOL";
|
|
13
|
-
export type AaveV2PoolContract = "AAVE_V2_DAI_POOL" | "AAVE_V2_USDC_POOL" | "AAVE_V2_USDT_POOL" | "AAVE_V2_WETH_POOL";
|
|
14
|
-
export type AaveV2TokenWrapperContract = "AAVE_V2_DAI_TOKEN_WRAPPER" | "AAVE_V2_USDC_TOKEN_WRAPPER" | "AAVE_V2_USDT_TOKEN_WRAPPER" | "AAVE_V2_WETH_TOKEN_WRAPPER";
|
|
15
|
-
export type CompoundV2PoolContract = "COMPOUND_V2_DAI_POOL" | "COMPOUND_V2_USDC_POOL" | "COMPOUND_V2_USDT_POOL" | "COMPOUND_V2_ETH_POOL" | "COMPOUND_V2_LINK_POOL";
|
|
16
|
-
export type SupportedContract = UniswapV2Contract | "UNISWAP_V3_ROUTER" | CurvePoolContract | "CURVE_GEAR_POOL" | YearnVaultContract | "CONVEX_BOOSTER" | ConvexPoolContract | "CONVEX_CLAIM_ZAP" | "LIDO_STETH_GATEWAY" | "LIDO_WSTETH" | "UNIVERSAL_ADAPTER" | "BALANCER_VAULT" | AaveV2PoolContract | AaveV2TokenWrapperContract | CompoundV2PoolContract;
|
|
17
|
-
export declare const contractsByNetwork: Record<NetworkType, Record<SupportedContract, string>>;
|
|
18
|
-
export declare const UNISWAP_V3_QUOTER = "NOT DEPLOYED";
|
|
19
|
-
export interface BaseContractParams {
|
|
20
|
-
name: string;
|
|
21
|
-
}
|
|
22
|
-
type UniswapV2Params = {
|
|
23
|
-
protocol: Protocols.Uniswap | Protocols.Sushiswap;
|
|
24
|
-
type: AdapterInterface.UNISWAP_V2_ROUTER;
|
|
25
|
-
} & BaseContractParams;
|
|
26
|
-
type UniswapV3Params = {
|
|
27
|
-
protocol: Protocols.Uniswap;
|
|
28
|
-
type: AdapterInterface.UNISWAP_V3_ROUTER;
|
|
29
|
-
quoter: string;
|
|
30
|
-
} & BaseContractParams;
|
|
31
|
-
export type CurveParams = {
|
|
32
|
-
protocol: Protocols.Curve;
|
|
33
|
-
type: AdapterInterface.CURVE_V1_2ASSETS | AdapterInterface.CURVE_V1_3ASSETS | AdapterInterface.CURVE_V1_4ASSETS | AdapterInterface.CURVE_V1_WRAPPER;
|
|
34
|
-
version: number;
|
|
35
|
-
lpToken: CurveLPToken;
|
|
36
|
-
tokens: Array<NormalToken | CurveLPToken>;
|
|
37
|
-
underlyings?: Array<NormalToken>;
|
|
38
|
-
wrapper?: CurvePoolContract;
|
|
39
|
-
} & BaseContractParams;
|
|
40
|
-
export type CurveSteCRVPoolParams = {
|
|
41
|
-
protocol: Protocols.Curve;
|
|
42
|
-
type: AdapterInterface.CURVE_V1_STECRV_POOL;
|
|
43
|
-
version: number;
|
|
44
|
-
pool: Record<NetworkType, string>;
|
|
45
|
-
tokens: ["WETH", "STETH"];
|
|
46
|
-
lpToken: "steCRV";
|
|
47
|
-
} & BaseContractParams;
|
|
48
|
-
export type CurveGEARPoolParams = {
|
|
49
|
-
protocol: Protocols.Curve;
|
|
50
|
-
type: AdapterInterface.CURVE_V1_2ASSETS;
|
|
51
|
-
version: number;
|
|
52
|
-
pool: Record<NetworkType, string>;
|
|
53
|
-
tokens: ["GEAR", "WETH"];
|
|
54
|
-
lpToken: "GEAR";
|
|
55
|
-
} & BaseContractParams;
|
|
56
|
-
export type YearnParams = {
|
|
57
|
-
protocol: Protocols.Yearn;
|
|
58
|
-
type: AdapterInterface.YEARN_V2;
|
|
59
|
-
shareToken: YearnLPToken;
|
|
60
|
-
} & BaseContractParams;
|
|
61
|
-
type ConvexParams = {
|
|
62
|
-
protocol: Protocols.Convex;
|
|
63
|
-
type: AdapterInterface.CONVEX_V1_BOOSTER | AdapterInterface.CONVEX_V1_CLAIM_ZAP;
|
|
64
|
-
} & BaseContractParams;
|
|
65
|
-
interface ConvexExtraPoolParams {
|
|
66
|
-
rewardToken: NormalToken;
|
|
67
|
-
poolAddress: Record<NetworkType, string>;
|
|
68
|
-
}
|
|
69
|
-
export type ConvexPoolParams = {
|
|
70
|
-
protocol: Protocols.Convex;
|
|
71
|
-
type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL;
|
|
72
|
-
stakedToken: ConvexStakedPhantomToken;
|
|
73
|
-
extraRewards: Array<ConvexExtraPoolParams>;
|
|
74
|
-
} & BaseContractParams;
|
|
75
|
-
export type LidoParams = {
|
|
76
|
-
protocol: Protocols.Lido;
|
|
77
|
-
type: AdapterInterface.LIDO_V1;
|
|
78
|
-
oracle: Record<NetworkType, string>;
|
|
79
|
-
lpToken: "steCRV";
|
|
80
|
-
} & BaseContractParams;
|
|
81
|
-
export type LidoWsthETHParams = {
|
|
82
|
-
protocol: Protocols.Lido;
|
|
83
|
-
type: AdapterInterface.LIDO_WSTETH_V1;
|
|
84
|
-
} & BaseContractParams;
|
|
85
|
-
export type UniversalParams = {
|
|
86
|
-
protocol: Protocols.Gearbox;
|
|
87
|
-
type: AdapterInterface.UNIVERSAL;
|
|
88
|
-
} & BaseContractParams;
|
|
89
|
-
export type BalancerParams = {
|
|
90
|
-
protocol: Protocols.Balancer;
|
|
91
|
-
type: AdapterInterface.BALANCER_VAULT;
|
|
92
|
-
} & BaseContractParams;
|
|
93
|
-
export type AaveV2Params = {
|
|
94
|
-
protocol: Protocols.AaveV2;
|
|
95
|
-
type: AdapterInterface.AAVE_V2_LENDING_POOL;
|
|
96
|
-
underlying: NormalToken;
|
|
97
|
-
} & BaseContractParams;
|
|
98
|
-
export type WrapperAaveV2Params = {
|
|
99
|
-
protocol: Protocols.AaveV2;
|
|
100
|
-
type: AdapterInterface.AAVE_V2_WRAPPED_ATOKEN;
|
|
101
|
-
underlying: AaveV2LPToken;
|
|
102
|
-
} & BaseContractParams;
|
|
103
|
-
export type CompoundV2Params = {
|
|
104
|
-
protocol: Protocols.CompoundV2;
|
|
105
|
-
type: AdapterInterface.COMPOUND_V2_CERC20 | AdapterInterface.COMPOUND_V2_CETHER;
|
|
106
|
-
underlying: NormalToken;
|
|
107
|
-
} & BaseContractParams;
|
|
108
|
-
export type ContractParams = UniswapV2Params | UniswapV3Params | CurveParams | CurveSteCRVPoolParams | CurveGEARPoolParams | YearnParams | ConvexParams | ConvexPoolParams | LidoParams | LidoWsthETHParams | UniversalParams | BalancerParams | AaveV2Params | WrapperAaveV2Params | CompoundV2Params;
|
|
109
|
-
export declare const contractParams: Record<SupportedContract, ContractParams>;
|
|
110
|
-
export declare const contractsByAddress: Record<string, SupportedContract>;
|
|
111
|
-
export declare const isSupportedContract: (t: unknown) => t is SupportedContract;
|
|
112
|
-
export {};
|
|
1
|
+
export * from "@gearbox-protocol/sdk-gov/lib/contracts/contracts";
|