@defisaver/positions-sdk 0.0.201-fluid-dev-10 → 0.0.201-fluid-dev-11
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/aaveV2/index.js +1 -1
- package/cjs/config/contracts.d.ts +87 -6
- package/cjs/config/contracts.js +15 -2
- package/cjs/helpers/liquityV2Helpers/index.js +2 -2
- package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
- package/cjs/liquityV2/index.d.ts +9 -4
- package/cjs/liquityV2/index.js +69 -10
- package/cjs/markets/index.d.ts +1 -1
- package/cjs/markets/index.js +2 -1
- package/cjs/markets/liquityV2/index.d.ts +2 -1
- package/cjs/markets/liquityV2/index.js +12 -1
- package/cjs/markets/spark/marketAssets.js +1 -1
- package/cjs/morphoAaveV2/index.js +1 -1
- package/cjs/morphoAaveV3/index.js +1 -2
- package/cjs/spark/index.js +1 -2
- package/cjs/staking/staking.d.ts +1 -6
- package/cjs/staking/staking.js +20 -23
- package/cjs/types/contracts/generated/LiquityV2StabilityPool.d.ts +223 -0
- package/cjs/types/contracts/generated/LiquityV2StabilityPool.js +5 -0
- package/cjs/types/contracts/generated/LiquityV2View.d.ts +144 -2
- package/cjs/types/contracts/generated/index.d.ts +1 -0
- package/cjs/types/liquityV2.d.ts +1 -0
- package/esm/aaveV2/index.js +2 -2
- package/esm/config/contracts.d.ts +87 -6
- package/esm/config/contracts.js +15 -2
- package/esm/helpers/liquityV2Helpers/index.js +2 -2
- package/esm/helpers/morphoBlueHelpers/index.js +66 -66
- package/esm/liquityV2/index.d.ts +9 -4
- package/esm/liquityV2/index.js +64 -10
- package/esm/markets/index.d.ts +1 -1
- package/esm/markets/index.js +1 -1
- package/esm/markets/liquityV2/index.d.ts +2 -1
- package/esm/markets/liquityV2/index.js +10 -0
- package/esm/markets/spark/marketAssets.js +1 -1
- package/esm/morphoAaveV2/index.js +2 -2
- package/esm/morphoAaveV3/index.js +1 -2
- package/esm/spark/index.js +1 -2
- package/esm/staking/staking.d.ts +1 -6
- package/esm/staking/staking.js +24 -22
- package/esm/types/contracts/generated/LiquityV2StabilityPool.d.ts +223 -0
- package/esm/types/contracts/generated/LiquityV2StabilityPool.js +4 -0
- package/esm/types/contracts/generated/LiquityV2View.d.ts +144 -2
- package/esm/types/contracts/generated/index.d.ts +1 -0
- package/esm/types/liquityV2.d.ts +1 -0
- package/package.json +52 -51
- package/src/aaveV2/index.ts +227 -227
- package/src/aaveV3/index.ts +625 -625
- package/src/assets/index.ts +60 -60
- package/src/chickenBonds/index.ts +123 -123
- package/src/compoundV2/index.ts +220 -220
- package/src/compoundV3/index.ts +291 -291
- package/src/config/contracts.js +1135 -1122
- package/src/constants/index.ts +6 -6
- package/src/contracts.ts +134 -134
- package/src/curveUsd/index.ts +229 -229
- package/src/eulerV2/index.ts +303 -303
- package/src/exchange/index.ts +17 -17
- package/src/fluid/index.ts +343 -343
- package/src/helpers/aaveHelpers/index.ts +198 -198
- 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 +232 -232
- package/src/helpers/fluidHelpers/index.ts +53 -53
- package/src/helpers/index.ts +11 -11
- package/src/helpers/liquityV2Helpers/index.ts +80 -80
- package/src/helpers/llamaLendHelpers/index.ts +53 -53
- package/src/helpers/makerHelpers/index.ts +94 -94
- package/src/helpers/morphoBlueHelpers/index.ts +365 -365
- package/src/helpers/sparkHelpers/index.ts +150 -150
- package/src/index.ts +52 -52
- package/src/liquity/index.ts +116 -116
- package/src/liquityV2/index.ts +295 -228
- 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 +44 -44
- package/src/markets/compound/index.ts +213 -213
- package/src/markets/compound/marketsAssets.ts +82 -82
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/euler/index.ts +26 -26
- package/src/markets/fluid/index.ts +2010 -2010
- package/src/markets/index.ts +27 -27
- package/src/markets/liquityV2/index.ts +55 -44
- package/src/markets/llamaLend/contractAddresses.ts +141 -141
- package/src/markets/llamaLend/index.ts +235 -235
- package/src/markets/morphoBlue/index.ts +895 -895
- 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 -631
- package/src/morphoBlue/index.ts +202 -202
- package/src/multicall/index.ts +33 -33
- package/src/services/priceService.ts +91 -91
- package/src/services/utils.ts +59 -59
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +460 -461
- package/src/staking/staking.ts +220 -220
- package/src/types/aave.ts +271 -271
- package/src/types/chickenBonds.ts +45 -45
- package/src/types/common.ts +84 -84
- package/src/types/compound.ts +131 -131
- package/src/types/contracts/generated/LiquityV2StabilityPool.ts +453 -0
- package/src/types/contracts/generated/LiquityV2View.ts +173 -2
- package/src/types/contracts/generated/index.ts +1 -0
- package/src/types/curveUsd.ts +118 -118
- package/src/types/euler.ts +171 -171
- package/src/types/fluid.ts +264 -264
- package/src/types/index.ts +11 -11
- package/src/types/liquity.ts +30 -30
- package/src/types/liquityV2.ts +119 -118
- package/src/types/llamaLend.ts +155 -155
- package/src/types/maker.ts +50 -50
- package/src/types/morphoBlue.ts +192 -192
- package/src/types/spark.ts +131 -131
- package/cjs/services/dsrService.d.ts +0 -3
- package/cjs/services/dsrService.js +0 -28
- package/esm/services/dsrService.d.ts +0 -3
- package/esm/services/dsrService.js +0 -21
- package/src/services/dsrService.ts +0 -16
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getDsrApy = void 0;
|
|
16
|
-
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
17
|
-
const constants_1 = require("../constants");
|
|
18
|
-
const contracts_1 = require("../contracts");
|
|
19
|
-
const getDsrApy = (web3, network) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
const potContract = (0, contracts_1.PotContract)(web3, network);
|
|
21
|
-
return new decimal_js_1.default(yield potContract.methods.dsr().call())
|
|
22
|
-
.div(new decimal_js_1.default(1e27))
|
|
23
|
-
.pow(constants_1.SECONDS_PER_YEAR)
|
|
24
|
-
.sub(1)
|
|
25
|
-
.mul(100)
|
|
26
|
-
.toString();
|
|
27
|
-
});
|
|
28
|
-
exports.getDsrApy = getDsrApy;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import Dec from 'decimal.js';
|
|
11
|
-
import { SECONDS_PER_YEAR } from '../constants';
|
|
12
|
-
import { PotContract } from '../contracts';
|
|
13
|
-
export const getDsrApy = (web3, network) => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
-
const potContract = PotContract(web3, network);
|
|
15
|
-
return new Dec(yield potContract.methods.dsr().call())
|
|
16
|
-
.div(new Dec(1e27))
|
|
17
|
-
.pow(SECONDS_PER_YEAR)
|
|
18
|
-
.sub(1)
|
|
19
|
-
.mul(100)
|
|
20
|
-
.toString();
|
|
21
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import Dec from 'decimal.js';
|
|
2
|
-
import Web3 from 'web3';
|
|
3
|
-
import { NetworkNumber } from '../types/common';
|
|
4
|
-
import { SECONDS_PER_YEAR } from '../constants';
|
|
5
|
-
import { PotContract } from '../contracts';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export const getDsrApy = async (web3: Web3, network: NetworkNumber) => {
|
|
9
|
-
const potContract = PotContract(web3, network);
|
|
10
|
-
return new Dec(await potContract.methods.dsr().call())
|
|
11
|
-
.div(new Dec(1e27))
|
|
12
|
-
.pow(SECONDS_PER_YEAR)
|
|
13
|
-
.sub(1)
|
|
14
|
-
.mul(100)
|
|
15
|
-
.toString();
|
|
16
|
-
};
|