@venusprotocol/isolated-pools 3.0.0 → 3.1.0-dev.1
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/deployments/bscmainnet/JumpRateModelV2_base0bps_slope1250bps_jump25000bps_kink8000bps.json +519 -0
- package/deployments/bscmainnet/JumpRateModelV2_base200bps_slope1750bps_jump25000bps_kink8000bps.json +519 -0
- package/deployments/bscmainnet/solcInputs/cc4a40f102671d2570e0434d3962d0c4.json +360 -0
- package/deployments/bscmainnet.json +642 -4
- package/deployments/bscmainnet_addresses.json +2 -0
- package/deployments/ethereum/JumpRateModelV2_base0bps_slope1250bps_jump25000bps_kink8000bps.json +519 -0
- package/deployments/ethereum/solcInputs/cc4a40f102671d2570e0434d3962d0c4.json +360 -0
- package/deployments/ethereum.json +319 -0
- package/deployments/ethereum_addresses.json +1 -0
- package/deployments/opbnbmainnet/JumpRateModelV2_base0bps_slope1250bps_jump25000bps_kink8000bps.json +519 -0
- package/deployments/opbnbmainnet/solcInputs/cc4a40f102671d2570e0434d3962d0c4.json +360 -0
- package/deployments/opbnbmainnet.json +319 -0
- package/deployments/opbnbmainnet_addresses.json +1 -0
- package/dist/deploy/019-deploy-ir-models.d.ts +3 -0
- package/dist/deploy/019-deploy-ir-models.js +59 -0
- package/dist/deployments/bscmainnet.json +642 -4
- package/dist/deployments/ethereum.json +319 -0
- package/dist/deployments/opbnbmainnet.json +319 -0
- package/dist/helpers/deploymentConfig.js +15 -15
- package/package.json +1 -1
|
@@ -2380,6 +2380,325 @@
|
|
|
2380
2380
|
}
|
|
2381
2381
|
]
|
|
2382
2382
|
},
|
|
2383
|
+
"JumpRateModelV2_base0bps_slope1250bps_jump25000bps_kink8000bps": {
|
|
2384
|
+
"address": "0x0E43acCbe2f38A0e98C6979bE5b803f813ce8be5",
|
|
2385
|
+
"abi": [
|
|
2386
|
+
{
|
|
2387
|
+
"inputs": [
|
|
2388
|
+
{
|
|
2389
|
+
"internalType": "uint256",
|
|
2390
|
+
"name": "blocksPerYear_",
|
|
2391
|
+
"type": "uint256"
|
|
2392
|
+
},
|
|
2393
|
+
{
|
|
2394
|
+
"internalType": "uint256",
|
|
2395
|
+
"name": "baseRatePerYear",
|
|
2396
|
+
"type": "uint256"
|
|
2397
|
+
},
|
|
2398
|
+
{
|
|
2399
|
+
"internalType": "uint256",
|
|
2400
|
+
"name": "multiplierPerYear",
|
|
2401
|
+
"type": "uint256"
|
|
2402
|
+
},
|
|
2403
|
+
{
|
|
2404
|
+
"internalType": "uint256",
|
|
2405
|
+
"name": "jumpMultiplierPerYear",
|
|
2406
|
+
"type": "uint256"
|
|
2407
|
+
},
|
|
2408
|
+
{
|
|
2409
|
+
"internalType": "uint256",
|
|
2410
|
+
"name": "kink_",
|
|
2411
|
+
"type": "uint256"
|
|
2412
|
+
},
|
|
2413
|
+
{
|
|
2414
|
+
"internalType": "contract IAccessControlManagerV8",
|
|
2415
|
+
"name": "accessControlManager_",
|
|
2416
|
+
"type": "address"
|
|
2417
|
+
}
|
|
2418
|
+
],
|
|
2419
|
+
"stateMutability": "nonpayable",
|
|
2420
|
+
"type": "constructor"
|
|
2421
|
+
},
|
|
2422
|
+
{
|
|
2423
|
+
"inputs": [
|
|
2424
|
+
{
|
|
2425
|
+
"internalType": "address",
|
|
2426
|
+
"name": "sender",
|
|
2427
|
+
"type": "address"
|
|
2428
|
+
},
|
|
2429
|
+
{
|
|
2430
|
+
"internalType": "address",
|
|
2431
|
+
"name": "calledContract",
|
|
2432
|
+
"type": "address"
|
|
2433
|
+
},
|
|
2434
|
+
{
|
|
2435
|
+
"internalType": "string",
|
|
2436
|
+
"name": "methodSignature",
|
|
2437
|
+
"type": "string"
|
|
2438
|
+
}
|
|
2439
|
+
],
|
|
2440
|
+
"name": "Unauthorized",
|
|
2441
|
+
"type": "error"
|
|
2442
|
+
},
|
|
2443
|
+
{
|
|
2444
|
+
"anonymous": false,
|
|
2445
|
+
"inputs": [
|
|
2446
|
+
{
|
|
2447
|
+
"indexed": false,
|
|
2448
|
+
"internalType": "uint256",
|
|
2449
|
+
"name": "baseRatePerBlock",
|
|
2450
|
+
"type": "uint256"
|
|
2451
|
+
},
|
|
2452
|
+
{
|
|
2453
|
+
"indexed": false,
|
|
2454
|
+
"internalType": "uint256",
|
|
2455
|
+
"name": "multiplierPerBlock",
|
|
2456
|
+
"type": "uint256"
|
|
2457
|
+
},
|
|
2458
|
+
{
|
|
2459
|
+
"indexed": false,
|
|
2460
|
+
"internalType": "uint256",
|
|
2461
|
+
"name": "jumpMultiplierPerBlock",
|
|
2462
|
+
"type": "uint256"
|
|
2463
|
+
},
|
|
2464
|
+
{
|
|
2465
|
+
"indexed": false,
|
|
2466
|
+
"internalType": "uint256",
|
|
2467
|
+
"name": "kink",
|
|
2468
|
+
"type": "uint256"
|
|
2469
|
+
}
|
|
2470
|
+
],
|
|
2471
|
+
"name": "NewInterestParams",
|
|
2472
|
+
"type": "event"
|
|
2473
|
+
},
|
|
2474
|
+
{
|
|
2475
|
+
"inputs": [],
|
|
2476
|
+
"name": "accessControlManager",
|
|
2477
|
+
"outputs": [
|
|
2478
|
+
{
|
|
2479
|
+
"internalType": "contract IAccessControlManagerV8",
|
|
2480
|
+
"name": "",
|
|
2481
|
+
"type": "address"
|
|
2482
|
+
}
|
|
2483
|
+
],
|
|
2484
|
+
"stateMutability": "view",
|
|
2485
|
+
"type": "function"
|
|
2486
|
+
},
|
|
2487
|
+
{
|
|
2488
|
+
"inputs": [],
|
|
2489
|
+
"name": "baseRatePerBlock",
|
|
2490
|
+
"outputs": [
|
|
2491
|
+
{
|
|
2492
|
+
"internalType": "uint256",
|
|
2493
|
+
"name": "",
|
|
2494
|
+
"type": "uint256"
|
|
2495
|
+
}
|
|
2496
|
+
],
|
|
2497
|
+
"stateMutability": "view",
|
|
2498
|
+
"type": "function"
|
|
2499
|
+
},
|
|
2500
|
+
{
|
|
2501
|
+
"inputs": [],
|
|
2502
|
+
"name": "blocksPerYear",
|
|
2503
|
+
"outputs": [
|
|
2504
|
+
{
|
|
2505
|
+
"internalType": "uint256",
|
|
2506
|
+
"name": "",
|
|
2507
|
+
"type": "uint256"
|
|
2508
|
+
}
|
|
2509
|
+
],
|
|
2510
|
+
"stateMutability": "view",
|
|
2511
|
+
"type": "function"
|
|
2512
|
+
},
|
|
2513
|
+
{
|
|
2514
|
+
"inputs": [
|
|
2515
|
+
{
|
|
2516
|
+
"internalType": "uint256",
|
|
2517
|
+
"name": "cash",
|
|
2518
|
+
"type": "uint256"
|
|
2519
|
+
},
|
|
2520
|
+
{
|
|
2521
|
+
"internalType": "uint256",
|
|
2522
|
+
"name": "borrows",
|
|
2523
|
+
"type": "uint256"
|
|
2524
|
+
},
|
|
2525
|
+
{
|
|
2526
|
+
"internalType": "uint256",
|
|
2527
|
+
"name": "reserves",
|
|
2528
|
+
"type": "uint256"
|
|
2529
|
+
},
|
|
2530
|
+
{
|
|
2531
|
+
"internalType": "uint256",
|
|
2532
|
+
"name": "badDebt",
|
|
2533
|
+
"type": "uint256"
|
|
2534
|
+
}
|
|
2535
|
+
],
|
|
2536
|
+
"name": "getBorrowRate",
|
|
2537
|
+
"outputs": [
|
|
2538
|
+
{
|
|
2539
|
+
"internalType": "uint256",
|
|
2540
|
+
"name": "",
|
|
2541
|
+
"type": "uint256"
|
|
2542
|
+
}
|
|
2543
|
+
],
|
|
2544
|
+
"stateMutability": "view",
|
|
2545
|
+
"type": "function"
|
|
2546
|
+
},
|
|
2547
|
+
{
|
|
2548
|
+
"inputs": [
|
|
2549
|
+
{
|
|
2550
|
+
"internalType": "uint256",
|
|
2551
|
+
"name": "cash",
|
|
2552
|
+
"type": "uint256"
|
|
2553
|
+
},
|
|
2554
|
+
{
|
|
2555
|
+
"internalType": "uint256",
|
|
2556
|
+
"name": "borrows",
|
|
2557
|
+
"type": "uint256"
|
|
2558
|
+
},
|
|
2559
|
+
{
|
|
2560
|
+
"internalType": "uint256",
|
|
2561
|
+
"name": "reserves",
|
|
2562
|
+
"type": "uint256"
|
|
2563
|
+
},
|
|
2564
|
+
{
|
|
2565
|
+
"internalType": "uint256",
|
|
2566
|
+
"name": "reserveFactorMantissa",
|
|
2567
|
+
"type": "uint256"
|
|
2568
|
+
},
|
|
2569
|
+
{
|
|
2570
|
+
"internalType": "uint256",
|
|
2571
|
+
"name": "badDebt",
|
|
2572
|
+
"type": "uint256"
|
|
2573
|
+
}
|
|
2574
|
+
],
|
|
2575
|
+
"name": "getSupplyRate",
|
|
2576
|
+
"outputs": [
|
|
2577
|
+
{
|
|
2578
|
+
"internalType": "uint256",
|
|
2579
|
+
"name": "",
|
|
2580
|
+
"type": "uint256"
|
|
2581
|
+
}
|
|
2582
|
+
],
|
|
2583
|
+
"stateMutability": "view",
|
|
2584
|
+
"type": "function"
|
|
2585
|
+
},
|
|
2586
|
+
{
|
|
2587
|
+
"inputs": [],
|
|
2588
|
+
"name": "isInterestRateModel",
|
|
2589
|
+
"outputs": [
|
|
2590
|
+
{
|
|
2591
|
+
"internalType": "bool",
|
|
2592
|
+
"name": "",
|
|
2593
|
+
"type": "bool"
|
|
2594
|
+
}
|
|
2595
|
+
],
|
|
2596
|
+
"stateMutability": "pure",
|
|
2597
|
+
"type": "function"
|
|
2598
|
+
},
|
|
2599
|
+
{
|
|
2600
|
+
"inputs": [],
|
|
2601
|
+
"name": "jumpMultiplierPerBlock",
|
|
2602
|
+
"outputs": [
|
|
2603
|
+
{
|
|
2604
|
+
"internalType": "uint256",
|
|
2605
|
+
"name": "",
|
|
2606
|
+
"type": "uint256"
|
|
2607
|
+
}
|
|
2608
|
+
],
|
|
2609
|
+
"stateMutability": "view",
|
|
2610
|
+
"type": "function"
|
|
2611
|
+
},
|
|
2612
|
+
{
|
|
2613
|
+
"inputs": [],
|
|
2614
|
+
"name": "kink",
|
|
2615
|
+
"outputs": [
|
|
2616
|
+
{
|
|
2617
|
+
"internalType": "uint256",
|
|
2618
|
+
"name": "",
|
|
2619
|
+
"type": "uint256"
|
|
2620
|
+
}
|
|
2621
|
+
],
|
|
2622
|
+
"stateMutability": "view",
|
|
2623
|
+
"type": "function"
|
|
2624
|
+
},
|
|
2625
|
+
{
|
|
2626
|
+
"inputs": [],
|
|
2627
|
+
"name": "multiplierPerBlock",
|
|
2628
|
+
"outputs": [
|
|
2629
|
+
{
|
|
2630
|
+
"internalType": "uint256",
|
|
2631
|
+
"name": "",
|
|
2632
|
+
"type": "uint256"
|
|
2633
|
+
}
|
|
2634
|
+
],
|
|
2635
|
+
"stateMutability": "view",
|
|
2636
|
+
"type": "function"
|
|
2637
|
+
},
|
|
2638
|
+
{
|
|
2639
|
+
"inputs": [
|
|
2640
|
+
{
|
|
2641
|
+
"internalType": "uint256",
|
|
2642
|
+
"name": "baseRatePerYear",
|
|
2643
|
+
"type": "uint256"
|
|
2644
|
+
},
|
|
2645
|
+
{
|
|
2646
|
+
"internalType": "uint256",
|
|
2647
|
+
"name": "multiplierPerYear",
|
|
2648
|
+
"type": "uint256"
|
|
2649
|
+
},
|
|
2650
|
+
{
|
|
2651
|
+
"internalType": "uint256",
|
|
2652
|
+
"name": "jumpMultiplierPerYear",
|
|
2653
|
+
"type": "uint256"
|
|
2654
|
+
},
|
|
2655
|
+
{
|
|
2656
|
+
"internalType": "uint256",
|
|
2657
|
+
"name": "kink_",
|
|
2658
|
+
"type": "uint256"
|
|
2659
|
+
}
|
|
2660
|
+
],
|
|
2661
|
+
"name": "updateJumpRateModel",
|
|
2662
|
+
"outputs": [],
|
|
2663
|
+
"stateMutability": "nonpayable",
|
|
2664
|
+
"type": "function"
|
|
2665
|
+
},
|
|
2666
|
+
{
|
|
2667
|
+
"inputs": [
|
|
2668
|
+
{
|
|
2669
|
+
"internalType": "uint256",
|
|
2670
|
+
"name": "cash",
|
|
2671
|
+
"type": "uint256"
|
|
2672
|
+
},
|
|
2673
|
+
{
|
|
2674
|
+
"internalType": "uint256",
|
|
2675
|
+
"name": "borrows",
|
|
2676
|
+
"type": "uint256"
|
|
2677
|
+
},
|
|
2678
|
+
{
|
|
2679
|
+
"internalType": "uint256",
|
|
2680
|
+
"name": "reserves",
|
|
2681
|
+
"type": "uint256"
|
|
2682
|
+
},
|
|
2683
|
+
{
|
|
2684
|
+
"internalType": "uint256",
|
|
2685
|
+
"name": "badDebt",
|
|
2686
|
+
"type": "uint256"
|
|
2687
|
+
}
|
|
2688
|
+
],
|
|
2689
|
+
"name": "utilizationRate",
|
|
2690
|
+
"outputs": [
|
|
2691
|
+
{
|
|
2692
|
+
"internalType": "uint256",
|
|
2693
|
+
"name": "",
|
|
2694
|
+
"type": "uint256"
|
|
2695
|
+
}
|
|
2696
|
+
],
|
|
2697
|
+
"stateMutability": "pure",
|
|
2698
|
+
"type": "function"
|
|
2699
|
+
}
|
|
2700
|
+
]
|
|
2701
|
+
},
|
|
2383
2702
|
"JumpRateModelV2_base0bps_slope1500bps_jump30000bps_kink6000bps": {
|
|
2384
2703
|
"address": "0x0b7cdC617bFE8e63D7861AbC1139811b61DbC869",
|
|
2385
2704
|
"abi": [
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
"ComptrollerImpl": "0xbA12d0BFC59fd29C44795FfFa8A3Ccc877A41325",
|
|
7
7
|
"Comptroller_Core": "0xD6e3E2A1d8d95caE355D15b3b9f8E5c2511874dd",
|
|
8
8
|
"DefaultProxyAdmin": "0xF77bD1D893F67b3EB2Cd256239c98Ba3F238fb52",
|
|
9
|
+
"JumpRateModelV2_base0bps_slope1250bps_jump25000bps_kink8000bps": "0x0E43acCbe2f38A0e98C6979bE5b803f813ce8be5",
|
|
9
10
|
"JumpRateModelV2_base0bps_slope1500bps_jump30000bps_kink6000bps": "0x0b7cdC617bFE8e63D7861AbC1139811b61DbC869",
|
|
10
11
|
"JumpRateModelV2_base0bps_slope900bps_jump30000bps_kink4500bps": "0x48C8a6A591f8f0943bF5FeEFB5E1Cbc803Eda89e",
|
|
11
12
|
"JumpRateModel_base0bps_slope1000bps_jump25000bps_kink8000bps": "0xaf6862b20280818FA24fA6D17097517608Fe65d4",
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ethers_1 = require("ethers");
|
|
4
|
+
const utils_1 = require("ethers/lib/utils");
|
|
5
|
+
const deploymentConfig_1 = require("../helpers/deploymentConfig");
|
|
6
|
+
const deploymentConfig_2 = require("../helpers/deploymentConfig");
|
|
7
|
+
const deploymentUtils_1 = require("../helpers/deploymentUtils");
|
|
8
|
+
const mantissaToBps = (num) => {
|
|
9
|
+
return ethers_1.BigNumber.from(num).div((0, utils_1.parseUnits)("1", 14)).toString();
|
|
10
|
+
};
|
|
11
|
+
const func = async function (hre) {
|
|
12
|
+
const { deployments, getNamedAccounts } = hre;
|
|
13
|
+
const { deploy } = deployments;
|
|
14
|
+
const { deployer } = await getNamedAccounts();
|
|
15
|
+
const { poolConfig, preconfiguredAddresses } = await (0, deploymentConfig_1.getConfig)(hre.network.name);
|
|
16
|
+
const accessControlManagerAddress = await (0, deploymentUtils_1.toAddress)(preconfiguredAddresses.AccessControlManager || "AccessControlManager", hre);
|
|
17
|
+
for (const pool of poolConfig) {
|
|
18
|
+
// Deploy IR Models
|
|
19
|
+
for (const vtoken of pool.vtokens) {
|
|
20
|
+
const { rateModel, baseRatePerYear, multiplierPerYear, jumpMultiplierPerYear, kink_ } = vtoken;
|
|
21
|
+
const BLOCKS_PER_YEAR = deploymentConfig_1.blocksPerYear[hre.network.name];
|
|
22
|
+
if (rateModel === deploymentConfig_2.InterestRateModels.JumpRate.toString()) {
|
|
23
|
+
const [b, m, j, k] = [baseRatePerYear, multiplierPerYear, jumpMultiplierPerYear, kink_].map(mantissaToBps);
|
|
24
|
+
const rateModelName = `JumpRateModelV2_base${b}bps_slope${m}bps_jump${j}bps_kink${k}bps`;
|
|
25
|
+
console.log(`Deploying interest rate model ${rateModelName}`);
|
|
26
|
+
await deploy(rateModelName, {
|
|
27
|
+
from: deployer,
|
|
28
|
+
contract: "JumpRateModelV2",
|
|
29
|
+
args: [
|
|
30
|
+
BLOCKS_PER_YEAR,
|
|
31
|
+
baseRatePerYear,
|
|
32
|
+
multiplierPerYear,
|
|
33
|
+
jumpMultiplierPerYear,
|
|
34
|
+
kink_,
|
|
35
|
+
accessControlManagerAddress,
|
|
36
|
+
],
|
|
37
|
+
log: true,
|
|
38
|
+
autoMine: true,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const [b, m] = [baseRatePerYear, multiplierPerYear].map(mantissaToBps);
|
|
43
|
+
const rateModelName = `WhitePaperInterestRateModel_base${b}bps_slope${m}bps`;
|
|
44
|
+
console.log(`Deploying interest rate model ${rateModelName}`);
|
|
45
|
+
await deploy(rateModelName, {
|
|
46
|
+
from: deployer,
|
|
47
|
+
contract: "WhitePaperInterestRateModel",
|
|
48
|
+
args: [BLOCKS_PER_YEAR, baseRatePerYear, multiplierPerYear],
|
|
49
|
+
log: true,
|
|
50
|
+
autoMine: true,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
console.log(`-----------------------------------------`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
func.tags = ["IR"];
|
|
58
|
+
func.skip = async (hre) => !hre.network.live;
|
|
59
|
+
exports.default = func;
|