@defisaver/positions-sdk 0.0.166-dev2-liquity-v2 → 0.0.166-dev3
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/.mocharc.json +4 -4
- package/.nvmrc +1 -1
- package/README.md +69 -69
- package/cjs/config/contracts.d.ts +32 -3
- package/cjs/config/contracts.js +3 -3
- package/cjs/contracts.d.ts +1 -1
- package/cjs/contracts.js +2 -2
- package/cjs/eulerV2/index.d.ts +41 -0
- package/cjs/eulerV2/index.js +214 -0
- package/cjs/helpers/eulerHelpers/index.d.ts +27 -0
- package/cjs/helpers/eulerHelpers/index.js +232 -0
- package/cjs/helpers/index.d.ts +1 -1
- package/cjs/helpers/index.js +2 -2
- package/cjs/index.d.ts +2 -2
- package/cjs/index.js +3 -3
- package/cjs/markets/euler/index.d.ts +8 -0
- package/cjs/markets/euler/index.js +30 -0
- package/cjs/markets/index.d.ts +1 -1
- package/cjs/markets/index.js +3 -3
- package/cjs/services/utils.d.ts +2 -0
- package/cjs/services/utils.js +4 -1
- package/cjs/types/contracts/generated/EulerV2View.d.ts +345 -0
- package/cjs/types/contracts/generated/index.d.ts +1 -1
- package/cjs/types/euler.d.ts +147 -0
- package/cjs/types/euler.js +14 -0
- package/cjs/types/index.d.ts +1 -1
- package/cjs/types/index.js +1 -1
- package/esm/config/contracts.d.ts +32 -3
- package/esm/config/contracts.js +3 -3
- package/esm/contracts.d.ts +1 -1
- package/esm/contracts.js +1 -1
- package/esm/eulerV2/index.d.ts +41 -0
- package/esm/eulerV2/index.js +206 -0
- package/esm/helpers/eulerHelpers/index.d.ts +27 -0
- package/esm/helpers/eulerHelpers/index.js +219 -0
- package/esm/helpers/index.d.ts +1 -1
- package/esm/helpers/index.js +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +2 -2
- package/esm/markets/euler/index.d.ts +8 -0
- package/esm/markets/euler/index.js +24 -0
- package/esm/markets/index.d.ts +1 -1
- package/esm/markets/index.js +1 -1
- package/esm/services/utils.d.ts +2 -0
- package/esm/services/utils.js +2 -0
- package/esm/types/contracts/generated/EulerV2View.d.ts +345 -0
- package/esm/types/contracts/generated/index.d.ts +1 -1
- package/esm/types/euler.d.ts +147 -0
- package/esm/types/euler.js +11 -0
- package/esm/types/index.d.ts +1 -1
- package/esm/types/index.js +1 -1
- package/package.json +49 -49
- package/src/aaveV2/index.ts +227 -227
- package/src/aaveV3/index.ts +590 -590
- package/src/assets/index.ts +60 -60
- package/src/chickenBonds/index.ts +123 -123
- package/src/compoundV2/index.ts +219 -219
- package/src/compoundV3/index.ts +281 -281
- package/src/config/contracts.js +1040 -1040
- package/src/constants/index.ts +6 -6
- package/src/contracts.ts +130 -130
- package/src/curveUsd/index.ts +229 -229
- package/src/eulerV2/index.ts +297 -0
- package/src/exchange/index.ts +17 -17
- package/src/helpers/aaveHelpers/index.ts +194 -194
- package/src/helpers/chickenBondsHelpers/index.ts +23 -23
- package/src/helpers/compoundHelpers/index.ts +246 -246
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/eulerHelpers/index.ts +231 -0
- package/src/helpers/index.ts +9 -9
- package/src/helpers/llamaLendHelpers/index.ts +53 -53
- package/src/helpers/makerHelpers/index.ts +94 -94
- package/src/helpers/morphoBlueHelpers/index.ts +115 -115
- package/src/helpers/sparkHelpers/index.ts +150 -150
- package/src/index.ts +48 -48
- package/src/liquity/index.ts +116 -116
- package/src/llamaLend/index.ts +275 -275
- package/src/maker/index.ts +117 -117
- package/src/markets/aave/index.ts +152 -152
- package/src/markets/aave/marketAssets.ts +46 -46
- package/src/markets/compound/index.ts +173 -173
- package/src/markets/compound/marketsAssets.ts +64 -64
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/euler/index.ts +27 -0
- package/src/markets/index.ts +24 -23
- package/src/markets/llamaLend/contractAddresses.ts +141 -141
- package/src/markets/llamaLend/index.ts +235 -235
- package/src/markets/morphoBlue/index.ts +728 -728
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +10 -10
- package/src/moneymarket/moneymarketCommonService.ts +80 -80
- package/src/morphoAaveV2/index.ts +256 -256
- package/src/morphoAaveV3/index.ts +630 -630
- package/src/morphoBlue/index.ts +171 -171
- package/src/multicall/index.ts +22 -22
- package/src/services/dsrService.ts +15 -15
- package/src/services/priceService.ts +21 -21
- package/src/services/utils.ts +57 -54
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +424 -424
- package/src/staking/staking.ts +218 -218
- package/src/types/aave.ts +262 -262
- package/src/types/chickenBonds.ts +45 -45
- package/src/types/common.ts +84 -84
- package/src/types/compound.ts +129 -129
- package/src/types/contracts/generated/EulerV2View.ts +446 -0
- package/src/types/contracts/generated/index.ts +1 -1
- package/src/types/curveUsd.ts +118 -118
- package/src/types/euler.ts +170 -0
- package/src/types/index.ts +10 -10
- package/src/types/liquity.ts +30 -30
- package/src/types/llamaLend.ts +155 -155
- package/src/types/maker.ts +50 -50
- package/src/types/morphoBlue.ts +146 -146
- package/src/types/spark.ts +127 -127
- package/cjs/helpers/liquityV2Helpers/index.d.ts +0 -12
- package/cjs/helpers/liquityV2Helpers/index.js +0 -61
- package/cjs/liquityV2/index.d.ts +0 -10
- package/cjs/liquityV2/index.js +0 -98
- package/cjs/markets/liquityV2/index.d.ts +0 -8
- package/cjs/markets/liquityV2/index.js +0 -34
- package/cjs/types/contracts/generated/LiquityV2View.d.ts +0 -222
- package/cjs/types/liquityV2.d.ts +0 -81
- package/cjs/types/liquityV2.js +0 -8
- package/esm/helpers/liquityV2Helpers/index.d.ts +0 -12
- package/esm/helpers/liquityV2Helpers/index.js +0 -53
- package/esm/liquityV2/index.d.ts +0 -10
- package/esm/liquityV2/index.js +0 -90
- package/esm/markets/liquityV2/index.d.ts +0 -8
- package/esm/markets/liquityV2/index.js +0 -28
- package/esm/types/contracts/generated/LiquityV2View.d.ts +0 -222
- package/esm/types/liquityV2.d.ts +0 -81
- package/esm/types/liquityV2.js +0 -5
- package/src/helpers/liquityV2Helpers/index.ts +0 -78
- package/src/liquityV2/index.ts +0 -115
- package/src/markets/liquityV2/index.ts +0 -31
- package/src/types/contracts/generated/LiquityV2View.ts +0 -280
- package/src/types/liquityV2.ts +0 -87
- /package/cjs/types/contracts/generated/{LiquityV2View.js → EulerV2View.js} +0 -0
- /package/esm/types/contracts/generated/{LiquityV2View.js → EulerV2View.js} +0 -0
|
@@ -26,6 +26,7 @@ export type { CompoundLoanInfo } from "./CompoundLoanInfo";
|
|
|
26
26
|
export type { Comptroller } from "./Comptroller";
|
|
27
27
|
export type { ETHPriceFeed } from "./ETHPriceFeed";
|
|
28
28
|
export type { Erc20 } from "./Erc20";
|
|
29
|
+
export type { EulerV2View } from "./EulerV2View";
|
|
29
30
|
export type { FeedRegistry } from "./FeedRegistry";
|
|
30
31
|
export type { GHO } from "./GHO";
|
|
31
32
|
export type { GhoDiscountRateStrategy } from "./GhoDiscountRateStrategy";
|
|
@@ -34,7 +35,6 @@ export type { IVariableDebtToken } from "./IVariableDebtToken";
|
|
|
34
35
|
export type { LendingPoolAddressesProvider } from "./LendingPoolAddressesProvider";
|
|
35
36
|
export type { Lido } from "./Lido";
|
|
36
37
|
export type { LiquityActivePool } from "./LiquityActivePool";
|
|
37
|
-
export type { LiquityV2View } from "./LiquityV2View";
|
|
38
38
|
export type { LiquityView } from "./LiquityView";
|
|
39
39
|
export type { LlamaLendControllerAbi } from "./LlamaLendControllerAbi";
|
|
40
40
|
export type { LlamaLendView } from "./LlamaLendView";
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { MMPositionData, NetworkNumber } from './common';
|
|
2
|
+
export declare enum EulerV2Versions {
|
|
3
|
+
eUSDC2 = "eUSDC-2",
|
|
4
|
+
eWETH2 = "eWETH-2"
|
|
5
|
+
}
|
|
6
|
+
export declare enum EulerV2VaultType {
|
|
7
|
+
Escrow = "Escrow",
|
|
8
|
+
Governed = "Governed",
|
|
9
|
+
Ungoverned = "Ungoverned"
|
|
10
|
+
}
|
|
11
|
+
export interface EulerV2Market {
|
|
12
|
+
chainIds: NetworkNumber[];
|
|
13
|
+
label: string;
|
|
14
|
+
shortLabel: string;
|
|
15
|
+
asset: string;
|
|
16
|
+
value: EulerV2Versions;
|
|
17
|
+
secondLabel: string;
|
|
18
|
+
marketAddress: string;
|
|
19
|
+
}
|
|
20
|
+
export interface EulerV2PositionData extends MMPositionData {
|
|
21
|
+
ratio: string;
|
|
22
|
+
minRatio: string;
|
|
23
|
+
borrowedUsd: string;
|
|
24
|
+
borrowLimitUsd: string;
|
|
25
|
+
incentiveUsd: string;
|
|
26
|
+
totalInterestUsd: string;
|
|
27
|
+
isSubscribedToAutomation?: boolean;
|
|
28
|
+
automationResubscribeRequired?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface EulerV2AssetData {
|
|
31
|
+
vaultAddress: string;
|
|
32
|
+
vaultSymbol: string;
|
|
33
|
+
sortIndex?: number;
|
|
34
|
+
liquidationRatio: string;
|
|
35
|
+
cash: string;
|
|
36
|
+
supplyCap: string;
|
|
37
|
+
assetAddress: string;
|
|
38
|
+
decimals: string;
|
|
39
|
+
symbol: string;
|
|
40
|
+
price: string;
|
|
41
|
+
borrowCap: string;
|
|
42
|
+
canBeBorrowed: boolean;
|
|
43
|
+
canBeSupplied: boolean;
|
|
44
|
+
incentiveSupplyApy?: string;
|
|
45
|
+
incentiveSupplyToken?: string;
|
|
46
|
+
totalBorrow: string;
|
|
47
|
+
collateralFactor: string;
|
|
48
|
+
borrowRate: string;
|
|
49
|
+
supplyRate: string;
|
|
50
|
+
utilization: string;
|
|
51
|
+
}
|
|
52
|
+
export interface EulerV2UsedAsset {
|
|
53
|
+
isSupplied: boolean;
|
|
54
|
+
isBorrowed: boolean;
|
|
55
|
+
supplied: string;
|
|
56
|
+
suppliedUsd: string;
|
|
57
|
+
borrowed: string;
|
|
58
|
+
borrowedUsd: string;
|
|
59
|
+
symbol: string;
|
|
60
|
+
collateral: boolean;
|
|
61
|
+
vaultAddress: string;
|
|
62
|
+
}
|
|
63
|
+
export interface EulerV2MarketInfoData {
|
|
64
|
+
name: string;
|
|
65
|
+
symbol: string;
|
|
66
|
+
decimals: string;
|
|
67
|
+
vaultAddress: string;
|
|
68
|
+
irm: string;
|
|
69
|
+
creator: string;
|
|
70
|
+
governorAdmin: string;
|
|
71
|
+
unitOfAccount: string;
|
|
72
|
+
unitOfAccountUsdPrice: string;
|
|
73
|
+
isInUSD: boolean;
|
|
74
|
+
oracle: string;
|
|
75
|
+
collaterals: string[];
|
|
76
|
+
isEscrow: boolean;
|
|
77
|
+
isGoverned: boolean;
|
|
78
|
+
vaultType: EulerV2VaultType;
|
|
79
|
+
}
|
|
80
|
+
export type EulerV2AssetsData = {
|
|
81
|
+
[key: string]: EulerV2AssetData;
|
|
82
|
+
};
|
|
83
|
+
export type EulerV2UsedAssets = {
|
|
84
|
+
[key: string]: EulerV2UsedAsset;
|
|
85
|
+
};
|
|
86
|
+
export interface EulerV2CollateralInfo {
|
|
87
|
+
lltv: string;
|
|
88
|
+
borrowLtv: string;
|
|
89
|
+
totalBorrows: string;
|
|
90
|
+
cash: string;
|
|
91
|
+
supplyCap: string;
|
|
92
|
+
}
|
|
93
|
+
export interface EulerV2MarketData {
|
|
94
|
+
name: string;
|
|
95
|
+
symbol: string;
|
|
96
|
+
decimals: number;
|
|
97
|
+
totalSupplyShares: string;
|
|
98
|
+
cash: string;
|
|
99
|
+
totalBorrows: string;
|
|
100
|
+
totalAssets: string;
|
|
101
|
+
supplyCap: string;
|
|
102
|
+
borrowCap: string;
|
|
103
|
+
collaterals: string[];
|
|
104
|
+
badDebtSocializationEnabled: boolean;
|
|
105
|
+
unitOfAccount: string;
|
|
106
|
+
oracle: string;
|
|
107
|
+
assetPrice: string;
|
|
108
|
+
interestRate: string;
|
|
109
|
+
irm: string;
|
|
110
|
+
creator: string;
|
|
111
|
+
governorAdmin: string;
|
|
112
|
+
interestFee: string;
|
|
113
|
+
}
|
|
114
|
+
export interface EulerV2FullMarketData {
|
|
115
|
+
marketData: EulerV2MarketInfoData;
|
|
116
|
+
assetsData: EulerV2AssetsData;
|
|
117
|
+
}
|
|
118
|
+
export interface EulerV2AccountData {
|
|
119
|
+
owner: string;
|
|
120
|
+
inLockDownMode: boolean;
|
|
121
|
+
inPermitDisabledMode: boolean;
|
|
122
|
+
borrowVault: string;
|
|
123
|
+
borrowAmountInUnit: string;
|
|
124
|
+
collaterals: string[];
|
|
125
|
+
collateralAmountsInUnit: string[];
|
|
126
|
+
}
|
|
127
|
+
export interface EulerV2AggregatedPositionData {
|
|
128
|
+
suppliedUsd: string;
|
|
129
|
+
suppliedCollateralUsd: string;
|
|
130
|
+
borrowedUsd: string;
|
|
131
|
+
borrowLimitUsd: string;
|
|
132
|
+
liquidationLimitUsd: string;
|
|
133
|
+
leftToBorrowUsd: string;
|
|
134
|
+
ratio: string;
|
|
135
|
+
collRatio: string;
|
|
136
|
+
netApy: string;
|
|
137
|
+
incentiveUsd: string;
|
|
138
|
+
totalInterestUsd: string;
|
|
139
|
+
liqRatio: string;
|
|
140
|
+
liqPercent: string;
|
|
141
|
+
leveragedType: string;
|
|
142
|
+
leveragedAsset?: string;
|
|
143
|
+
leveragedLsdAssetRatio?: string;
|
|
144
|
+
liquidationPrice?: string;
|
|
145
|
+
minRatio: string;
|
|
146
|
+
minDebt: string;
|
|
147
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export var EulerV2Versions;
|
|
2
|
+
(function (EulerV2Versions) {
|
|
3
|
+
EulerV2Versions["eUSDC2"] = "eUSDC-2";
|
|
4
|
+
EulerV2Versions["eWETH2"] = "eWETH-2";
|
|
5
|
+
})(EulerV2Versions || (EulerV2Versions = {}));
|
|
6
|
+
export var EulerV2VaultType;
|
|
7
|
+
(function (EulerV2VaultType) {
|
|
8
|
+
EulerV2VaultType["Escrow"] = "Escrow";
|
|
9
|
+
EulerV2VaultType["Governed"] = "Governed";
|
|
10
|
+
EulerV2VaultType["Ungoverned"] = "Ungoverned";
|
|
11
|
+
})(EulerV2VaultType || (EulerV2VaultType = {}));
|
package/esm/types/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export * from './compound';
|
|
|
3
3
|
export * from './spark';
|
|
4
4
|
export * from './curveUsd';
|
|
5
5
|
export * from './liquity';
|
|
6
|
-
export * from './liquityV2';
|
|
7
6
|
export * from './maker';
|
|
8
7
|
export * from './chickenBonds';
|
|
9
8
|
export * from './morphoBlue';
|
|
10
9
|
export * from './llamaLend';
|
|
10
|
+
export * from './euler';
|
package/esm/types/index.js
CHANGED
|
@@ -3,8 +3,8 @@ export * from './compound';
|
|
|
3
3
|
export * from './spark';
|
|
4
4
|
export * from './curveUsd';
|
|
5
5
|
export * from './liquity';
|
|
6
|
-
export * from './liquityV2';
|
|
7
6
|
export * from './maker';
|
|
8
7
|
export * from './chickenBonds';
|
|
9
8
|
export * from './morphoBlue';
|
|
10
9
|
export * from './llamaLend';
|
|
10
|
+
export * from './euler';
|
package/package.json
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@defisaver/positions-sdk",
|
|
3
|
-
"version": "0.0.166-
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "./cjs/index.js",
|
|
6
|
-
"module": "./esm/index.js",
|
|
7
|
-
"types": "./esm/index.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"build:esm": "rm -rf esm && tsc -p tsconfig.esm.json",
|
|
10
|
-
"build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
|
|
11
|
-
"build": "npm run lint && npm run generate-contracts && npm run build:cjs && npm run build:esm",
|
|
12
|
-
"dev": "npm run generate-contracts && tsc -p tsconfig.json --watch",
|
|
13
|
-
"lint": "eslint src/ --fix",
|
|
14
|
-
"lint-check": "eslint src/",
|
|
15
|
-
"generate-contracts": "node scripts/generateContracts.js",
|
|
16
|
-
"test": "mocha tests
|
|
17
|
-
"test-single": "mocha ./tests/$npm_config_name.ts",
|
|
18
|
-
"test:debugger": "mocha --inspect-brk tests/*",
|
|
19
|
-
"build-test": "npm run build && npm run test",
|
|
20
|
-
"version-bump": "git commit -am \"Version bump to $(npm version patch | cut -c 2-)\""
|
|
21
|
-
},
|
|
22
|
-
"keywords": [],
|
|
23
|
-
"author": "",
|
|
24
|
-
"license": "ISC",
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"@defisaver/tokens": "^1.5.45
|
|
27
|
-
"@ethersproject/bignumber": "^5.7.0",
|
|
28
|
-
"@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
|
|
29
|
-
"decimal.js": "^10.4.3"
|
|
30
|
-
},
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"@defisaver/eslint-config": "^1.0.1",
|
|
33
|
-
"@types/chai": "^5.0.0",
|
|
34
|
-
"@types/mocha": "^10.0.9",
|
|
35
|
-
"@types/web3": "^1.0.20",
|
|
36
|
-
"chai": "^4.3.8",
|
|
37
|
-
"dotenv": "^16.3.1",
|
|
38
|
-
"eslint": "^8.49.0",
|
|
39
|
-
"eslint-plugin-import": "^2.31.0",
|
|
40
|
-
"mocha": "^10.2.0",
|
|
41
|
-
"ts-node": "^10.9.2",
|
|
42
|
-
"typechain": "^8.3.1",
|
|
43
|
-
"typechain-target-web3-v1-3mihai3": "^6.0.2",
|
|
44
|
-
"typescript": "^5.2.2"
|
|
45
|
-
},
|
|
46
|
-
"peerDependencies": {
|
|
47
|
-
"web3": "^1.10.2"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@defisaver/positions-sdk",
|
|
3
|
+
"version": "0.0.166-dev3",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "./cjs/index.js",
|
|
6
|
+
"module": "./esm/index.js",
|
|
7
|
+
"types": "./esm/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build:esm": "rm -rf esm && tsc -p tsconfig.esm.json",
|
|
10
|
+
"build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
|
|
11
|
+
"build": "npm run lint && npm run generate-contracts && npm run build:cjs && npm run build:esm",
|
|
12
|
+
"dev": "npm run generate-contracts && tsc -p tsconfig.json --watch",
|
|
13
|
+
"lint": "eslint src/ --fix",
|
|
14
|
+
"lint-check": "eslint src/",
|
|
15
|
+
"generate-contracts": "node scripts/generateContracts.js",
|
|
16
|
+
"test": "mocha tests/*",
|
|
17
|
+
"test-single": "mocha ./tests/$npm_config_name.ts",
|
|
18
|
+
"test:debugger": "mocha --inspect-brk tests/*",
|
|
19
|
+
"build-test": "npm run build && npm run test",
|
|
20
|
+
"version-bump": "git commit -am \"Version bump to $(npm version patch | cut -c 2-)\""
|
|
21
|
+
},
|
|
22
|
+
"keywords": [],
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@defisaver/tokens": "^1.5.45",
|
|
27
|
+
"@ethersproject/bignumber": "^5.7.0",
|
|
28
|
+
"@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
|
|
29
|
+
"decimal.js": "^10.4.3"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@defisaver/eslint-config": "^1.0.1",
|
|
33
|
+
"@types/chai": "^5.0.0",
|
|
34
|
+
"@types/mocha": "^10.0.9",
|
|
35
|
+
"@types/web3": "^1.0.20",
|
|
36
|
+
"chai": "^4.3.8",
|
|
37
|
+
"dotenv": "^16.3.1",
|
|
38
|
+
"eslint": "^8.49.0",
|
|
39
|
+
"eslint-plugin-import": "^2.31.0",
|
|
40
|
+
"mocha": "^10.2.0",
|
|
41
|
+
"ts-node": "^10.9.2",
|
|
42
|
+
"typechain": "^8.3.1",
|
|
43
|
+
"typechain-target-web3-v1-3mihai3": "^6.0.2",
|
|
44
|
+
"typescript": "^5.2.2"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"web3": "^1.10.2"
|
|
48
|
+
}
|
|
49
|
+
}
|