@defisaver/positions-sdk 0.0.23 → 0.0.25
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/README.md +63 -63
- package/cjs/helpers/curveUsdHelpers/index.js +0 -1
- package/cjs/markets/curveUsd/index.js +15 -15
- package/cjs/spark/index.js +1 -0
- package/cjs/types/curveUsd.d.ts +5 -6
- package/cjs/types/curveUsd.js +5 -5
- package/esm/helpers/curveUsdHelpers/index.js +0 -1
- package/esm/markets/curveUsd/index.js +15 -15
- package/esm/spark/index.js +1 -0
- package/esm/types/curveUsd.d.ts +5 -6
- package/esm/types/curveUsd.js +5 -5
- package/package.json +40 -40
- package/src/aaveV2/index.ts +226 -226
- package/src/aaveV3/index.ts +561 -561
- 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 +275 -275
- package/src/config/contracts.js +673 -673
- package/src/constants/index.ts +3 -3
- package/src/contracts.ts +100 -100
- package/src/curveUsd/index.ts +228 -228
- package/src/exchange/index.ts +17 -17
- package/src/helpers/aaveHelpers/index.ts +134 -134
- package/src/helpers/chickenBondsHelpers/index.ts +23 -23
- package/src/helpers/compoundHelpers/index.ts +181 -181
- package/src/helpers/curveUsdHelpers/index.ts +32 -33
- package/src/helpers/index.ts +5 -5
- package/src/helpers/makerHelpers/index.ts +94 -94
- package/src/helpers/sparkHelpers/index.ts +106 -106
- package/src/index.ts +40 -40
- package/src/liquity/index.ts +116 -116
- package/src/maker/index.ts +101 -101
- package/src/markets/aave/index.ts +80 -80
- package/src/markets/aave/marketAssets.ts +32 -32
- package/src/markets/compound/index.ts +141 -141
- package/src/markets/compound/marketsAssets.ts +46 -46
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/index.ts +3 -3
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +9 -9
- package/src/moneymarket/moneymarketCommonService.ts +75 -75
- package/src/morpho/markets.ts +39 -39
- package/src/morphoAaveV2/index.ts +255 -255
- package/src/morphoAaveV3/index.ts +619 -619
- 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 +34 -34
- package/src/spark/index.ts +422 -421
- package/src/staking/staking.ts +167 -167
- package/src/types/aave.ts +256 -256
- package/src/types/chickenBonds.ts +45 -45
- package/src/types/common.ts +83 -83
- package/src/types/compound.ts +128 -128
- package/src/types/curveUsd.ts +112 -113
- package/src/types/index.ts +6 -6
- package/src/types/liquity.ts +30 -30
- package/src/types/maker.ts +50 -50
- package/src/types/spark.ts +106 -106
- package/yarn-error.log +0 -64
package/README.md
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
# DeFi Saver Positions SDK
|
|
2
|
-
|
|
3
|
-
Supported protocols:
|
|
4
|
-
- [Maker](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/maker)
|
|
5
|
-
- [Spark](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/spark)
|
|
6
|
-
- [CrvUSD](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/curveUsd)
|
|
7
|
-
- [Aave V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/aaveV2)
|
|
8
|
-
- [Aave V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/aaveV3)
|
|
9
|
-
- [Morpho Aave V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/morphoAaveV2)
|
|
10
|
-
- [Morpho Aave V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/morphoAaveV3)
|
|
11
|
-
- [Compound V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV2)
|
|
12
|
-
- [Compound V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV3)
|
|
13
|
-
- [Liquity](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/liquity)
|
|
14
|
-
- [Chicken Bonds](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/chickenBonds)
|
|
15
|
-
|
|
16
|
-
## Setup
|
|
17
|
-
Supported Node version is v10.
|
|
18
|
-
|
|
19
|
-
- run `npm install` (first time)
|
|
20
|
-
- run `npm run build`
|
|
21
|
-
|
|
22
|
-
`build` command will generate contracts and build ejs and esm folders
|
|
23
|
-
|
|
24
|
-
## How to use
|
|
25
|
-
[All available imports](https://github.com/defisaver/defisaver-positions-sdk/blob/main/src/index.ts)
|
|
26
|
-
|
|
27
|
-
This is a Compound V3 example, and every other protocol is similar
|
|
28
|
-
```js
|
|
29
|
-
import Web3 from 'web3';
|
|
30
|
-
import { compoundV3 } from '@defisaver/positions-sdk';
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// every protocol has market data and user data getters
|
|
34
|
-
const {
|
|
35
|
-
getCompoundV3MarketsData,
|
|
36
|
-
getCompoundV3AccountData,
|
|
37
|
-
} = compoundV3;
|
|
38
|
-
|
|
39
|
-
const provider = 'Your RPC provider';
|
|
40
|
-
const web3 = new Web3(provider);
|
|
41
|
-
|
|
42
|
-
const user = '0x123...';
|
|
43
|
-
|
|
44
|
-
const { assetsData } = await getCompoundV3MarketsData(
|
|
45
|
-
web3, // rpc for the network you are using (note: can be tenderly or any other testnet rpc)
|
|
46
|
-
1, // network
|
|
47
|
-
selectedMarket, // market object like in /src/markets/compound/index.ts
|
|
48
|
-
web3, // this must be mainnet rpc - used for getting prices onchain and calculating apys
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
const userData = await getCompoundV3AccountData(
|
|
52
|
-
web3,
|
|
53
|
-
1, // network
|
|
54
|
-
userAddress, // EOA or DSProxy
|
|
55
|
-
'', // proxy address of the user, or just empty string if checking for EOA
|
|
56
|
-
{
|
|
57
|
-
selectedMarket, // market object as in /src/markets/compound/index.ts
|
|
58
|
-
assetsData,
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
More examples found [here](https://github.com/defisaver/defisaver-positions-sdk/tree/main/tests)
|
|
1
|
+
# DeFi Saver Positions SDK
|
|
2
|
+
|
|
3
|
+
Supported protocols:
|
|
4
|
+
- [Maker](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/maker)
|
|
5
|
+
- [Spark](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/spark)
|
|
6
|
+
- [CrvUSD](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/curveUsd)
|
|
7
|
+
- [Aave V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/aaveV2)
|
|
8
|
+
- [Aave V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/aaveV3)
|
|
9
|
+
- [Morpho Aave V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/morphoAaveV2)
|
|
10
|
+
- [Morpho Aave V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/morphoAaveV3)
|
|
11
|
+
- [Compound V2](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV2)
|
|
12
|
+
- [Compound V3](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/compoundV3)
|
|
13
|
+
- [Liquity](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/liquity)
|
|
14
|
+
- [Chicken Bonds](https://github.com/defisaver/defisaver-positions-sdk/tree/main/src/chickenBonds)
|
|
15
|
+
|
|
16
|
+
## Setup
|
|
17
|
+
Supported Node version is v10.
|
|
18
|
+
|
|
19
|
+
- run `npm install` (first time)
|
|
20
|
+
- run `npm run build`
|
|
21
|
+
|
|
22
|
+
`build` command will generate contracts and build ejs and esm folders
|
|
23
|
+
|
|
24
|
+
## How to use
|
|
25
|
+
[All available imports](https://github.com/defisaver/defisaver-positions-sdk/blob/main/src/index.ts)
|
|
26
|
+
|
|
27
|
+
This is a Compound V3 example, and every other protocol is similar
|
|
28
|
+
```js
|
|
29
|
+
import Web3 from 'web3';
|
|
30
|
+
import { compoundV3 } from '@defisaver/positions-sdk';
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
// every protocol has market data and user data getters
|
|
34
|
+
const {
|
|
35
|
+
getCompoundV3MarketsData,
|
|
36
|
+
getCompoundV3AccountData,
|
|
37
|
+
} = compoundV3;
|
|
38
|
+
|
|
39
|
+
const provider = 'Your RPC provider';
|
|
40
|
+
const web3 = new Web3(provider);
|
|
41
|
+
|
|
42
|
+
const user = '0x123...';
|
|
43
|
+
|
|
44
|
+
const { assetsData } = await getCompoundV3MarketsData(
|
|
45
|
+
web3, // rpc for the network you are using (note: can be tenderly or any other testnet rpc)
|
|
46
|
+
1, // network
|
|
47
|
+
selectedMarket, // market object like in /src/markets/compound/index.ts
|
|
48
|
+
web3, // this must be mainnet rpc - used for getting prices onchain and calculating apys
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const userData = await getCompoundV3AccountData(
|
|
52
|
+
web3,
|
|
53
|
+
1, // network
|
|
54
|
+
userAddress, // EOA or DSProxy
|
|
55
|
+
'', // proxy address of the user, or just empty string if checking for EOA
|
|
56
|
+
{
|
|
57
|
+
selectedMarket, // market object as in /src/markets/compound/index.ts
|
|
58
|
+
assetsData,
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
More examples found [here](https://github.com/defisaver/defisaver-positions-sdk/tree/main/tests)
|
|
@@ -5,9 +5,9 @@ const contracts_1 = require("../../contracts");
|
|
|
5
5
|
const types_1 = require("../../types");
|
|
6
6
|
const CRVUSD_WSTETH_MARKET = (networkId) => ({
|
|
7
7
|
chainIds: [1],
|
|
8
|
-
label: '
|
|
8
|
+
label: 'wstETH',
|
|
9
9
|
shortLabel: 'wstETH',
|
|
10
|
-
value: types_1.CrvUSDVersions.
|
|
10
|
+
value: types_1.CrvUSDVersions.wstETH,
|
|
11
11
|
collAsset: 'wstETH',
|
|
12
12
|
baseAsset: 'crvUSD',
|
|
13
13
|
controllerAddress: (0, contracts_1.getConfigContractAddress)('crvUSDwstETHController', networkId),
|
|
@@ -17,9 +17,9 @@ const CRVUSD_WSTETH_MARKET = (networkId) => ({
|
|
|
17
17
|
exports.CRVUSD_WSTETH_MARKET = CRVUSD_WSTETH_MARKET;
|
|
18
18
|
const CRVUSD_ETH_MARKET = (networkId) => ({
|
|
19
19
|
chainIds: [1],
|
|
20
|
-
label: '
|
|
20
|
+
label: 'ETH',
|
|
21
21
|
shortLabel: 'ETH',
|
|
22
|
-
value: types_1.CrvUSDVersions.
|
|
22
|
+
value: types_1.CrvUSDVersions.ETH,
|
|
23
23
|
collAsset: 'ETH',
|
|
24
24
|
baseAsset: 'crvUSD',
|
|
25
25
|
controllerAddress: (0, contracts_1.getConfigContractAddress)('crvUSDETHController', networkId),
|
|
@@ -29,9 +29,9 @@ const CRVUSD_ETH_MARKET = (networkId) => ({
|
|
|
29
29
|
exports.CRVUSD_ETH_MARKET = CRVUSD_ETH_MARKET;
|
|
30
30
|
const CRVUSD_WBTC_MARKET = (networkId) => ({
|
|
31
31
|
chainIds: [1],
|
|
32
|
-
label: '
|
|
32
|
+
label: 'WBTC',
|
|
33
33
|
shortLabel: 'WBTC',
|
|
34
|
-
value: types_1.CrvUSDVersions.
|
|
34
|
+
value: types_1.CrvUSDVersions.WBTC,
|
|
35
35
|
collAsset: 'WBTC',
|
|
36
36
|
baseAsset: 'crvUSD',
|
|
37
37
|
controllerAddress: (0, contracts_1.getConfigContractAddress)('crvUSDWBTCController', networkId),
|
|
@@ -41,9 +41,9 @@ const CRVUSD_WBTC_MARKET = (networkId) => ({
|
|
|
41
41
|
exports.CRVUSD_WBTC_MARKET = CRVUSD_WBTC_MARKET;
|
|
42
42
|
const CRVUSD_TBTC_MARKET = (networkId) => ({
|
|
43
43
|
chainIds: [1],
|
|
44
|
-
label: '
|
|
44
|
+
label: 'tBTC',
|
|
45
45
|
shortLabel: 'tBTC',
|
|
46
|
-
value: types_1.CrvUSDVersions.
|
|
46
|
+
value: types_1.CrvUSDVersions.tBTC,
|
|
47
47
|
collAsset: 'tBTC',
|
|
48
48
|
baseAsset: 'crvUSD',
|
|
49
49
|
controllerAddress: (0, contracts_1.getConfigContractAddress)('crvUSDtBTCController', networkId),
|
|
@@ -53,9 +53,9 @@ const CRVUSD_TBTC_MARKET = (networkId) => ({
|
|
|
53
53
|
exports.CRVUSD_TBTC_MARKET = CRVUSD_TBTC_MARKET;
|
|
54
54
|
const CRVUSD_SFRXETH_MARKET = (networkId) => ({
|
|
55
55
|
chainIds: [1],
|
|
56
|
-
label: '
|
|
56
|
+
label: 'sfrxETH',
|
|
57
57
|
shortLabel: 'sfrxETH',
|
|
58
|
-
value: types_1.CrvUSDVersions.
|
|
58
|
+
value: types_1.CrvUSDVersions.sfrxETH,
|
|
59
59
|
collAsset: 'sfrxETH',
|
|
60
60
|
baseAsset: 'crvUSD',
|
|
61
61
|
controllerAddress: (0, contracts_1.getConfigContractAddress)('crvUSDsfrxETHController', networkId),
|
|
@@ -64,10 +64,10 @@ const CRVUSD_SFRXETH_MARKET = (networkId) => ({
|
|
|
64
64
|
});
|
|
65
65
|
exports.CRVUSD_SFRXETH_MARKET = CRVUSD_SFRXETH_MARKET;
|
|
66
66
|
const CrvUsdMarkets = (networkId) => ({
|
|
67
|
-
[types_1.CrvUSDVersions.
|
|
68
|
-
[types_1.CrvUSDVersions.
|
|
69
|
-
[types_1.CrvUSDVersions.
|
|
70
|
-
[types_1.CrvUSDVersions.
|
|
71
|
-
[types_1.CrvUSDVersions.
|
|
67
|
+
[types_1.CrvUSDVersions.wstETH]: (0, exports.CRVUSD_WSTETH_MARKET)(networkId),
|
|
68
|
+
[types_1.CrvUSDVersions.ETH]: (0, exports.CRVUSD_ETH_MARKET)(networkId),
|
|
69
|
+
[types_1.CrvUSDVersions.WBTC]: (0, exports.CRVUSD_WBTC_MARKET)(networkId),
|
|
70
|
+
[types_1.CrvUSDVersions.tBTC]: (0, exports.CRVUSD_TBTC_MARKET)(networkId),
|
|
71
|
+
[types_1.CrvUSDVersions.sfrxETH]: (0, exports.CRVUSD_SFRXETH_MARKET)(networkId),
|
|
72
72
|
});
|
|
73
73
|
exports.CrvUsdMarkets = CrvUsdMarkets;
|
package/cjs/spark/index.js
CHANGED
|
@@ -105,6 +105,7 @@ const getSparkMarketsData = (web3, network, selectedMarket, mainnetWeb3) => __aw
|
|
|
105
105
|
price: new decimal_js_1.default(market.price.toString()).div(1e8).toString(),
|
|
106
106
|
isolationModeBorrowingEnabled: market.isolationModeBorrowingEnabled,
|
|
107
107
|
isFlashLoanEnabled: market.isFlashLoanEnabled,
|
|
108
|
+
aTokenAddress: market.aTokenAddress,
|
|
108
109
|
eModeCategoryData: {
|
|
109
110
|
label: market.label,
|
|
110
111
|
liquidationBonus: new decimal_js_1.default(market.liquidationBonus).div(10000).toString(),
|
package/cjs/types/curveUsd.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { NetworkNumber } from './common';
|
|
2
2
|
export declare enum CrvUSDVersions {
|
|
3
|
-
'
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'
|
|
3
|
+
'wstETH' = "wstETH",
|
|
4
|
+
'WBTC' = "WBTC",
|
|
5
|
+
'ETH' = "ETH",
|
|
6
|
+
'tBTC' = "tBTC",
|
|
7
|
+
'sfrxETH' = "sfrxETH"
|
|
8
8
|
}
|
|
9
9
|
export declare enum CrvUSDStatus {
|
|
10
10
|
Nonexistant = "Nonexistant",
|
|
@@ -67,7 +67,6 @@ export interface CrvUSDAggregatedPositionData {
|
|
|
67
67
|
borrowedUsd: string;
|
|
68
68
|
borrowed: string;
|
|
69
69
|
safetyRatio: string;
|
|
70
|
-
borrowLimitUsd: string;
|
|
71
70
|
}
|
|
72
71
|
export interface CrvUSDUsedAsset {
|
|
73
72
|
isSupplied: boolean;
|
package/cjs/types/curveUsd.js
CHANGED
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CrvUSDStatus = exports.CrvUSDVersions = void 0;
|
|
4
4
|
var CrvUSDVersions;
|
|
5
5
|
(function (CrvUSDVersions) {
|
|
6
|
-
CrvUSDVersions["
|
|
7
|
-
CrvUSDVersions["
|
|
8
|
-
CrvUSDVersions["
|
|
9
|
-
CrvUSDVersions["
|
|
10
|
-
CrvUSDVersions["
|
|
6
|
+
CrvUSDVersions["wstETH"] = "wstETH";
|
|
7
|
+
CrvUSDVersions["WBTC"] = "WBTC";
|
|
8
|
+
CrvUSDVersions["ETH"] = "ETH";
|
|
9
|
+
CrvUSDVersions["tBTC"] = "tBTC";
|
|
10
|
+
CrvUSDVersions["sfrxETH"] = "sfrxETH";
|
|
11
11
|
})(CrvUSDVersions || (exports.CrvUSDVersions = CrvUSDVersions = {}));
|
|
12
12
|
var CrvUSDStatus;
|
|
13
13
|
(function (CrvUSDStatus) {
|
|
@@ -2,9 +2,9 @@ import { getConfigContractAddress } from '../../contracts';
|
|
|
2
2
|
import { CrvUSDVersions } from '../../types';
|
|
3
3
|
export const CRVUSD_WSTETH_MARKET = (networkId) => ({
|
|
4
4
|
chainIds: [1],
|
|
5
|
-
label: '
|
|
5
|
+
label: 'wstETH',
|
|
6
6
|
shortLabel: 'wstETH',
|
|
7
|
-
value: CrvUSDVersions.
|
|
7
|
+
value: CrvUSDVersions.wstETH,
|
|
8
8
|
collAsset: 'wstETH',
|
|
9
9
|
baseAsset: 'crvUSD',
|
|
10
10
|
controllerAddress: getConfigContractAddress('crvUSDwstETHController', networkId),
|
|
@@ -13,9 +13,9 @@ export const CRVUSD_WSTETH_MARKET = (networkId) => ({
|
|
|
13
13
|
});
|
|
14
14
|
export const CRVUSD_ETH_MARKET = (networkId) => ({
|
|
15
15
|
chainIds: [1],
|
|
16
|
-
label: '
|
|
16
|
+
label: 'ETH',
|
|
17
17
|
shortLabel: 'ETH',
|
|
18
|
-
value: CrvUSDVersions.
|
|
18
|
+
value: CrvUSDVersions.ETH,
|
|
19
19
|
collAsset: 'ETH',
|
|
20
20
|
baseAsset: 'crvUSD',
|
|
21
21
|
controllerAddress: getConfigContractAddress('crvUSDETHController', networkId),
|
|
@@ -24,9 +24,9 @@ export const CRVUSD_ETH_MARKET = (networkId) => ({
|
|
|
24
24
|
});
|
|
25
25
|
export const CRVUSD_WBTC_MARKET = (networkId) => ({
|
|
26
26
|
chainIds: [1],
|
|
27
|
-
label: '
|
|
27
|
+
label: 'WBTC',
|
|
28
28
|
shortLabel: 'WBTC',
|
|
29
|
-
value: CrvUSDVersions.
|
|
29
|
+
value: CrvUSDVersions.WBTC,
|
|
30
30
|
collAsset: 'WBTC',
|
|
31
31
|
baseAsset: 'crvUSD',
|
|
32
32
|
controllerAddress: getConfigContractAddress('crvUSDWBTCController', networkId),
|
|
@@ -35,9 +35,9 @@ export const CRVUSD_WBTC_MARKET = (networkId) => ({
|
|
|
35
35
|
});
|
|
36
36
|
export const CRVUSD_TBTC_MARKET = (networkId) => ({
|
|
37
37
|
chainIds: [1],
|
|
38
|
-
label: '
|
|
38
|
+
label: 'tBTC',
|
|
39
39
|
shortLabel: 'tBTC',
|
|
40
|
-
value: CrvUSDVersions.
|
|
40
|
+
value: CrvUSDVersions.tBTC,
|
|
41
41
|
collAsset: 'tBTC',
|
|
42
42
|
baseAsset: 'crvUSD',
|
|
43
43
|
controllerAddress: getConfigContractAddress('crvUSDtBTCController', networkId),
|
|
@@ -46,9 +46,9 @@ export const CRVUSD_TBTC_MARKET = (networkId) => ({
|
|
|
46
46
|
});
|
|
47
47
|
export const CRVUSD_SFRXETH_MARKET = (networkId) => ({
|
|
48
48
|
chainIds: [1],
|
|
49
|
-
label: '
|
|
49
|
+
label: 'sfrxETH',
|
|
50
50
|
shortLabel: 'sfrxETH',
|
|
51
|
-
value: CrvUSDVersions.
|
|
51
|
+
value: CrvUSDVersions.sfrxETH,
|
|
52
52
|
collAsset: 'sfrxETH',
|
|
53
53
|
baseAsset: 'crvUSD',
|
|
54
54
|
controllerAddress: getConfigContractAddress('crvUSDsfrxETHController', networkId),
|
|
@@ -56,9 +56,9 @@ export const CRVUSD_SFRXETH_MARKET = (networkId) => ({
|
|
|
56
56
|
createCollAssets: ['sfrxETH'],
|
|
57
57
|
});
|
|
58
58
|
export const CrvUsdMarkets = (networkId) => ({
|
|
59
|
-
[CrvUSDVersions.
|
|
60
|
-
[CrvUSDVersions.
|
|
61
|
-
[CrvUSDVersions.
|
|
62
|
-
[CrvUSDVersions.
|
|
63
|
-
[CrvUSDVersions.
|
|
59
|
+
[CrvUSDVersions.wstETH]: CRVUSD_WSTETH_MARKET(networkId),
|
|
60
|
+
[CrvUSDVersions.ETH]: CRVUSD_ETH_MARKET(networkId),
|
|
61
|
+
[CrvUSDVersions.WBTC]: CRVUSD_WBTC_MARKET(networkId),
|
|
62
|
+
[CrvUSDVersions.tBTC]: CRVUSD_TBTC_MARKET(networkId),
|
|
63
|
+
[CrvUSDVersions.sfrxETH]: CRVUSD_SFRXETH_MARKET(networkId),
|
|
64
64
|
});
|
package/esm/spark/index.js
CHANGED
|
@@ -98,6 +98,7 @@ export const getSparkMarketsData = (web3, network, selectedMarket, mainnetWeb3)
|
|
|
98
98
|
price: new Dec(market.price.toString()).div(1e8).toString(),
|
|
99
99
|
isolationModeBorrowingEnabled: market.isolationModeBorrowingEnabled,
|
|
100
100
|
isFlashLoanEnabled: market.isFlashLoanEnabled,
|
|
101
|
+
aTokenAddress: market.aTokenAddress,
|
|
101
102
|
eModeCategoryData: {
|
|
102
103
|
label: market.label,
|
|
103
104
|
liquidationBonus: new Dec(market.liquidationBonus).div(10000).toString(),
|
package/esm/types/curveUsd.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { NetworkNumber } from './common';
|
|
2
2
|
export declare enum CrvUSDVersions {
|
|
3
|
-
'
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'
|
|
3
|
+
'wstETH' = "wstETH",
|
|
4
|
+
'WBTC' = "WBTC",
|
|
5
|
+
'ETH' = "ETH",
|
|
6
|
+
'tBTC' = "tBTC",
|
|
7
|
+
'sfrxETH' = "sfrxETH"
|
|
8
8
|
}
|
|
9
9
|
export declare enum CrvUSDStatus {
|
|
10
10
|
Nonexistant = "Nonexistant",
|
|
@@ -67,7 +67,6 @@ export interface CrvUSDAggregatedPositionData {
|
|
|
67
67
|
borrowedUsd: string;
|
|
68
68
|
borrowed: string;
|
|
69
69
|
safetyRatio: string;
|
|
70
|
-
borrowLimitUsd: string;
|
|
71
70
|
}
|
|
72
71
|
export interface CrvUSDUsedAsset {
|
|
73
72
|
isSupplied: boolean;
|
package/esm/types/curveUsd.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export var CrvUSDVersions;
|
|
2
2
|
(function (CrvUSDVersions) {
|
|
3
|
-
CrvUSDVersions["
|
|
4
|
-
CrvUSDVersions["
|
|
5
|
-
CrvUSDVersions["
|
|
6
|
-
CrvUSDVersions["
|
|
7
|
-
CrvUSDVersions["
|
|
3
|
+
CrvUSDVersions["wstETH"] = "wstETH";
|
|
4
|
+
CrvUSDVersions["WBTC"] = "WBTC";
|
|
5
|
+
CrvUSDVersions["ETH"] = "ETH";
|
|
6
|
+
CrvUSDVersions["tBTC"] = "tBTC";
|
|
7
|
+
CrvUSDVersions["sfrxETH"] = "sfrxETH";
|
|
8
8
|
})(CrvUSDVersions || (CrvUSDVersions = {}));
|
|
9
9
|
export var CrvUSDStatus;
|
|
10
10
|
(function (CrvUSDStatus) {
|
package/package.json
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@defisaver/positions-sdk",
|
|
3
|
-
"version": "0.0.
|
|
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.json",
|
|
10
|
-
"build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
|
|
11
|
-
"build": "npm run generate-contracts && npm run build:cjs && npm run build:esm",
|
|
12
|
-
"dev": "npm run generate-contracts && tsc -p tsconfig.cjs.json --watch",
|
|
13
|
-
"lint": "eslint src/ --fix",
|
|
14
|
-
"generate-contracts": "node scripts/generateContracts.js",
|
|
15
|
-
"test": "mocha tests/*",
|
|
16
|
-
"build-test": "npm run build && mocha tests/*"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [],
|
|
19
|
-
"author": "",
|
|
20
|
-
"license": "ISC",
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"@defisaver/tokens": "^1.5.
|
|
23
|
-
"
|
|
24
|
-
"@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
|
|
25
|
-
"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@defisaver/eslint-config": "^1.0.1",
|
|
29
|
-
"chai": "^4.3.8",
|
|
30
|
-
"dotenv": "^16.3.1",
|
|
31
|
-
"eslint": "^8.49.0",
|
|
32
|
-
"mocha": "^10.2.0",
|
|
33
|
-
"typechain": "^8.3.1",
|
|
34
|
-
"typechain-target-web3-v1-3mihai3": "^6.0.2",
|
|
35
|
-
"typescript": "^5.2.2"
|
|
36
|
-
},
|
|
37
|
-
"peerDependencies": {
|
|
38
|
-
"web3": "^1.10.2"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@defisaver/positions-sdk",
|
|
3
|
+
"version": "0.0.25",
|
|
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.json",
|
|
10
|
+
"build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
|
|
11
|
+
"build": "npm run generate-contracts && npm run build:cjs && npm run build:esm",
|
|
12
|
+
"dev": "npm run generate-contracts && tsc -p tsconfig.cjs.json --watch",
|
|
13
|
+
"lint": "eslint src/ --fix",
|
|
14
|
+
"generate-contracts": "node scripts/generateContracts.js",
|
|
15
|
+
"test": "mocha tests/*",
|
|
16
|
+
"build-test": "npm run build && mocha tests/*"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [],
|
|
19
|
+
"author": "",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@defisaver/tokens": "^1.5.5",
|
|
23
|
+
"@ethersproject/bignumber": "^5.7.0",
|
|
24
|
+
"@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
|
|
25
|
+
"decimal.js": "^10.4.3"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@defisaver/eslint-config": "^1.0.1",
|
|
29
|
+
"chai": "^4.3.8",
|
|
30
|
+
"dotenv": "^16.3.1",
|
|
31
|
+
"eslint": "^8.49.0",
|
|
32
|
+
"mocha": "^10.2.0",
|
|
33
|
+
"typechain": "^8.3.1",
|
|
34
|
+
"typechain-target-web3-v1-3mihai3": "^6.0.2",
|
|
35
|
+
"typescript": "^5.2.2"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"web3": "^1.10.2"
|
|
39
|
+
}
|
|
40
|
+
}
|