impermax-sdk 2.1.568 → 2.1.570
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.
|
@@ -6,3 +6,5 @@ export declare const LIQUIDATION_FEE_FACTORIES: Factory[];
|
|
|
6
6
|
export declare const V2_FACTORIES: Factory[];
|
|
7
7
|
export declare const STABLE_FACTORIES: Factory[];
|
|
8
8
|
export declare const V3_FACTORIES: Factory[];
|
|
9
|
+
export declare const FLASH_ALLOCATE_FACTORIES: Factory[];
|
|
10
|
+
export declare const SWAP_AND_CLOSE_FACTORIES: Factory[];
|
package/lib/config/factories.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.V3_FACTORIES = exports.STABLE_FACTORIES = exports.V2_FACTORIES = exports.LIQUIDATION_FEE_FACTORIES = exports.OLD_KINK_MULTIPLIER_FACTORIES = exports.BORROW_FEE_FACTORIES = exports.SOLIDEX_FACTORIES = void 0;
|
|
3
|
+
exports.SWAP_AND_CLOSE_FACTORIES = exports.FLASH_ALLOCATE_FACTORIES = exports.V3_FACTORIES = exports.STABLE_FACTORIES = exports.V2_FACTORIES = exports.LIQUIDATION_FEE_FACTORIES = exports.OLD_KINK_MULTIPLIER_FACTORIES = exports.BORROW_FEE_FACTORIES = exports.SOLIDEX_FACTORIES = void 0;
|
|
4
4
|
const types_1 = require("./types");
|
|
5
5
|
exports.SOLIDEX_FACTORIES = [
|
|
6
6
|
types_1.Factory.SOLV1_2,
|
|
@@ -32,3 +32,9 @@ exports.STABLE_FACTORIES = [
|
|
|
32
32
|
exports.V3_FACTORIES = [
|
|
33
33
|
types_1.Factory.V3
|
|
34
34
|
];
|
|
35
|
+
exports.FLASH_ALLOCATE_FACTORIES = [
|
|
36
|
+
types_1.Factory.V3
|
|
37
|
+
];
|
|
38
|
+
exports.SWAP_AND_CLOSE_FACTORIES = [
|
|
39
|
+
types_1.Factory.V3
|
|
40
|
+
];
|
package/lib/config/whitelist.js
CHANGED
|
@@ -117,6 +117,8 @@ exports.WHITELISTED_PAIRS = {
|
|
|
117
117
|
"0xFd6b42A3da0e755d647D1eBF522E7D4368D7fEf7",
|
|
118
118
|
"0xB8e831D4eb4Ce93ffca9Ff4A8fe2c3f9bF99628A",
|
|
119
119
|
"0xb5E2500f93Bc2DD3163E191EBc6F3B2f5B1E8b7f",
|
|
120
|
+
"0xc612250083ad9a3b1b07616f7832d0ba11cef227",
|
|
121
|
+
"0xe2a738197977c3135796ae45b3b847f1126489e0",
|
|
120
122
|
// Scale
|
|
121
123
|
"0x4Cafce8b0Ca0Ba9d3490Ce9b67048139f698a5f8",
|
|
122
124
|
"0x965c3f8Dc3aa446b268aB3Bca4d7E82b788FfE96",
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const offchainPoolToken_1 = __importDefault(require("../offchainPoolToken"));
|
|
8
8
|
const borrowableEntity_1 = require("../../utils/borrowable/borrowableEntity");
|
|
9
|
+
const factories_1 = require("../../config/factories");
|
|
9
10
|
class OffchainBorrowable extends offchainPoolToken_1.default {
|
|
10
11
|
async createBorrowableObject(lockStateChange = false, useMaxFlashAllocate = false) {
|
|
11
12
|
const { kinkBorrowRate } = await this._calculateBorrowRate();
|
|
@@ -288,6 +289,9 @@ class OffchainBorrowable extends offchainPoolToken_1.default {
|
|
|
288
289
|
return lastExchangeRate * accrueFactor;
|
|
289
290
|
}
|
|
290
291
|
async getMaxFlashAllocate() {
|
|
292
|
+
const factory = this.lendingPool.getFactory();
|
|
293
|
+
if (!factories_1.FLASH_ALLOCATE_FACTORIES.includes(factory))
|
|
294
|
+
return null;
|
|
291
295
|
const vaults = await this.getOffchain().getVaultsLinkedToBorrowable(this);
|
|
292
296
|
let bestAmount = 0;
|
|
293
297
|
let bestVault = null;
|