@venusprotocol/isolated-pools 3.8.0-dev.3 → 3.8.0-dev.4

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.
Files changed (25) hide show
  1. package/deployments/arbitrumone/TwoKinks_base0bps_slope1500bps_kink8000bps_slope29000bps_base20bps_kink29000bps_jump30000bps.json +552 -0
  2. package/deployments/arbitrumone.json +352 -0
  3. package/deployments/arbitrumone_addresses.json +1 -0
  4. package/deployments/bscmainnet/JumpRateModelV2_base0bps_slope2000bps_jump25000bps_kink8000bps.json +608 -0
  5. package/deployments/bscmainnet/JumpRateModelV2_base200bps_slope2000bps_jump25000bps_kink8000bps.json +608 -0
  6. package/deployments/bscmainnet.json +825 -105
  7. package/deployments/bscmainnet_addresses.json +2 -0
  8. package/deployments/ethereum/JumpRateModelV2_base0bps_slope1750bps_jump25000bps_kink8000bps.json +608 -0
  9. package/deployments/ethereum/JumpRateModelV2_base0bps_slope2000bps_jump25000bps_kink8000bps.json +608 -0
  10. package/deployments/ethereum/TwoKinks_base0bps_slope1500bps_kink8000bps_slope29000bps_base20bps_kink29000bps_jump30000bps.json +552 -0
  11. package/deployments/ethereum.json +2011 -939
  12. package/deployments/ethereum_addresses.json +3 -0
  13. package/deployments/zksyncmainnet/TwoKinks_base0bps_slope1500bps_kink8000bps_slope29000bps_base20bps_kink29000bps_jump30000bps.json +651 -0
  14. package/deployments/zksyncmainnet/solcInputs/7ee56954f4157666c7d07cfa8db6f8de.json +445 -0
  15. package/deployments/zksyncmainnet.json +352 -0
  16. package/deployments/zksyncmainnet_addresses.json +1 -0
  17. package/dist/deploy/009-deploy-vtokens.js +37 -2
  18. package/dist/deploy/019-deploy-ir-models.js +36 -2
  19. package/dist/deployments/arbitrumone.json +352 -0
  20. package/dist/deployments/bscmainnet.json +825 -105
  21. package/dist/deployments/ethereum.json +2011 -939
  22. package/dist/deployments/zksyncmainnet.json +352 -0
  23. package/dist/helpers/deploymentConfig.d.ts +5 -1
  24. package/dist/helpers/deploymentConfig.js +54 -32
  25. package/package.json +1 -1
@@ -9659,6 +9659,358 @@
9659
9659
  }
9660
9660
  ]
9661
9661
  },
9662
+ "TwoKinks_base0bps_slope1500bps_kink8000bps_slope29000bps_base20bps_kink29000bps_jump30000bps": {
9663
+ "address": "0x61E98E6a1F37649543156DC995E0dfe466B31a2e",
9664
+ "abi": [
9665
+ {
9666
+ "inputs": [
9667
+ {
9668
+ "internalType": "int256",
9669
+ "name": "baseRatePerYear_",
9670
+ "type": "int256"
9671
+ },
9672
+ {
9673
+ "internalType": "int256",
9674
+ "name": "multiplierPerYear_",
9675
+ "type": "int256"
9676
+ },
9677
+ {
9678
+ "internalType": "int256",
9679
+ "name": "kink1_",
9680
+ "type": "int256"
9681
+ },
9682
+ {
9683
+ "internalType": "int256",
9684
+ "name": "multiplier2PerYear_",
9685
+ "type": "int256"
9686
+ },
9687
+ {
9688
+ "internalType": "int256",
9689
+ "name": "baseRate2PerYear_",
9690
+ "type": "int256"
9691
+ },
9692
+ {
9693
+ "internalType": "int256",
9694
+ "name": "kink2_",
9695
+ "type": "int256"
9696
+ },
9697
+ {
9698
+ "internalType": "int256",
9699
+ "name": "jumpMultiplierPerYear_",
9700
+ "type": "int256"
9701
+ },
9702
+ {
9703
+ "internalType": "bool",
9704
+ "name": "timeBased_",
9705
+ "type": "bool"
9706
+ },
9707
+ {
9708
+ "internalType": "uint256",
9709
+ "name": "blocksPerYear_",
9710
+ "type": "uint256"
9711
+ }
9712
+ ],
9713
+ "stateMutability": "nonpayable",
9714
+ "type": "constructor"
9715
+ },
9716
+ {
9717
+ "inputs": [],
9718
+ "name": "InvalidBlocksPerYear",
9719
+ "type": "error"
9720
+ },
9721
+ {
9722
+ "inputs": [],
9723
+ "name": "InvalidKink",
9724
+ "type": "error"
9725
+ },
9726
+ {
9727
+ "inputs": [],
9728
+ "name": "InvalidTimeBasedConfiguration",
9729
+ "type": "error"
9730
+ },
9731
+ {
9732
+ "inputs": [],
9733
+ "name": "NegativeValueNotAllowed",
9734
+ "type": "error"
9735
+ },
9736
+ {
9737
+ "inputs": [],
9738
+ "name": "BASE_RATE_2_PER_BLOCK_OR_SECOND",
9739
+ "outputs": [
9740
+ {
9741
+ "internalType": "int256",
9742
+ "name": "",
9743
+ "type": "int256"
9744
+ }
9745
+ ],
9746
+ "stateMutability": "view",
9747
+ "type": "function"
9748
+ },
9749
+ {
9750
+ "inputs": [],
9751
+ "name": "BASE_RATE_PER_BLOCK_OR_SECOND",
9752
+ "outputs": [
9753
+ {
9754
+ "internalType": "int256",
9755
+ "name": "",
9756
+ "type": "int256"
9757
+ }
9758
+ ],
9759
+ "stateMutability": "view",
9760
+ "type": "function"
9761
+ },
9762
+ {
9763
+ "inputs": [],
9764
+ "name": "JUMP_MULTIPLIER_PER_BLOCK_OR_SECOND",
9765
+ "outputs": [
9766
+ {
9767
+ "internalType": "int256",
9768
+ "name": "",
9769
+ "type": "int256"
9770
+ }
9771
+ ],
9772
+ "stateMutability": "view",
9773
+ "type": "function"
9774
+ },
9775
+ {
9776
+ "inputs": [],
9777
+ "name": "KINK_1",
9778
+ "outputs": [
9779
+ {
9780
+ "internalType": "int256",
9781
+ "name": "",
9782
+ "type": "int256"
9783
+ }
9784
+ ],
9785
+ "stateMutability": "view",
9786
+ "type": "function"
9787
+ },
9788
+ {
9789
+ "inputs": [],
9790
+ "name": "KINK_2",
9791
+ "outputs": [
9792
+ {
9793
+ "internalType": "int256",
9794
+ "name": "",
9795
+ "type": "int256"
9796
+ }
9797
+ ],
9798
+ "stateMutability": "view",
9799
+ "type": "function"
9800
+ },
9801
+ {
9802
+ "inputs": [],
9803
+ "name": "MULTIPLIER_2_PER_BLOCK_OR_SECOND",
9804
+ "outputs": [
9805
+ {
9806
+ "internalType": "int256",
9807
+ "name": "",
9808
+ "type": "int256"
9809
+ }
9810
+ ],
9811
+ "stateMutability": "view",
9812
+ "type": "function"
9813
+ },
9814
+ {
9815
+ "inputs": [],
9816
+ "name": "MULTIPLIER_PER_BLOCK_OR_SECOND",
9817
+ "outputs": [
9818
+ {
9819
+ "internalType": "int256",
9820
+ "name": "",
9821
+ "type": "int256"
9822
+ }
9823
+ ],
9824
+ "stateMutability": "view",
9825
+ "type": "function"
9826
+ },
9827
+ {
9828
+ "inputs": [],
9829
+ "name": "RATE_1",
9830
+ "outputs": [
9831
+ {
9832
+ "internalType": "int256",
9833
+ "name": "",
9834
+ "type": "int256"
9835
+ }
9836
+ ],
9837
+ "stateMutability": "view",
9838
+ "type": "function"
9839
+ },
9840
+ {
9841
+ "inputs": [],
9842
+ "name": "RATE_2",
9843
+ "outputs": [
9844
+ {
9845
+ "internalType": "int256",
9846
+ "name": "",
9847
+ "type": "int256"
9848
+ }
9849
+ ],
9850
+ "stateMutability": "view",
9851
+ "type": "function"
9852
+ },
9853
+ {
9854
+ "inputs": [],
9855
+ "name": "blocksOrSecondsPerYear",
9856
+ "outputs": [
9857
+ {
9858
+ "internalType": "uint256",
9859
+ "name": "",
9860
+ "type": "uint256"
9861
+ }
9862
+ ],
9863
+ "stateMutability": "view",
9864
+ "type": "function"
9865
+ },
9866
+ {
9867
+ "inputs": [],
9868
+ "name": "getBlockNumberOrTimestamp",
9869
+ "outputs": [
9870
+ {
9871
+ "internalType": "uint256",
9872
+ "name": "",
9873
+ "type": "uint256"
9874
+ }
9875
+ ],
9876
+ "stateMutability": "view",
9877
+ "type": "function"
9878
+ },
9879
+ {
9880
+ "inputs": [
9881
+ {
9882
+ "internalType": "uint256",
9883
+ "name": "cash",
9884
+ "type": "uint256"
9885
+ },
9886
+ {
9887
+ "internalType": "uint256",
9888
+ "name": "borrows",
9889
+ "type": "uint256"
9890
+ },
9891
+ {
9892
+ "internalType": "uint256",
9893
+ "name": "reserves",
9894
+ "type": "uint256"
9895
+ },
9896
+ {
9897
+ "internalType": "uint256",
9898
+ "name": "badDebt",
9899
+ "type": "uint256"
9900
+ }
9901
+ ],
9902
+ "name": "getBorrowRate",
9903
+ "outputs": [
9904
+ {
9905
+ "internalType": "uint256",
9906
+ "name": "",
9907
+ "type": "uint256"
9908
+ }
9909
+ ],
9910
+ "stateMutability": "view",
9911
+ "type": "function"
9912
+ },
9913
+ {
9914
+ "inputs": [
9915
+ {
9916
+ "internalType": "uint256",
9917
+ "name": "cash",
9918
+ "type": "uint256"
9919
+ },
9920
+ {
9921
+ "internalType": "uint256",
9922
+ "name": "borrows",
9923
+ "type": "uint256"
9924
+ },
9925
+ {
9926
+ "internalType": "uint256",
9927
+ "name": "reserves",
9928
+ "type": "uint256"
9929
+ },
9930
+ {
9931
+ "internalType": "uint256",
9932
+ "name": "reserveFactorMantissa",
9933
+ "type": "uint256"
9934
+ },
9935
+ {
9936
+ "internalType": "uint256",
9937
+ "name": "badDebt",
9938
+ "type": "uint256"
9939
+ }
9940
+ ],
9941
+ "name": "getSupplyRate",
9942
+ "outputs": [
9943
+ {
9944
+ "internalType": "uint256",
9945
+ "name": "",
9946
+ "type": "uint256"
9947
+ }
9948
+ ],
9949
+ "stateMutability": "view",
9950
+ "type": "function"
9951
+ },
9952
+ {
9953
+ "inputs": [],
9954
+ "name": "isInterestRateModel",
9955
+ "outputs": [
9956
+ {
9957
+ "internalType": "bool",
9958
+ "name": "",
9959
+ "type": "bool"
9960
+ }
9961
+ ],
9962
+ "stateMutability": "pure",
9963
+ "type": "function"
9964
+ },
9965
+ {
9966
+ "inputs": [],
9967
+ "name": "isTimeBased",
9968
+ "outputs": [
9969
+ {
9970
+ "internalType": "bool",
9971
+ "name": "",
9972
+ "type": "bool"
9973
+ }
9974
+ ],
9975
+ "stateMutability": "view",
9976
+ "type": "function"
9977
+ },
9978
+ {
9979
+ "inputs": [
9980
+ {
9981
+ "internalType": "uint256",
9982
+ "name": "cash",
9983
+ "type": "uint256"
9984
+ },
9985
+ {
9986
+ "internalType": "uint256",
9987
+ "name": "borrows",
9988
+ "type": "uint256"
9989
+ },
9990
+ {
9991
+ "internalType": "uint256",
9992
+ "name": "reserves",
9993
+ "type": "uint256"
9994
+ },
9995
+ {
9996
+ "internalType": "uint256",
9997
+ "name": "badDebt",
9998
+ "type": "uint256"
9999
+ }
10000
+ ],
10001
+ "name": "utilizationRate",
10002
+ "outputs": [
10003
+ {
10004
+ "internalType": "uint256",
10005
+ "name": "",
10006
+ "type": "uint256"
10007
+ }
10008
+ ],
10009
+ "stateMutability": "pure",
10010
+ "type": "function"
10011
+ }
10012
+ ]
10013
+ },
9662
10014
  "VTokenBeacon": {
9663
10015
  "address": "0x53523537aa330640B80400EB8B309fF5896E7eb5",
9664
10016
  "abi": [
@@ -18,6 +18,7 @@
18
18
  "RewardsDistributorImpl": "0x1A363085a85a21361c97ee9eeF07a8e61cc0D8e2",
19
19
  "RewardsDistributor_Core_0": "0x7C7846A74AB38A8d554Bc5f7652eCf8Efb58c894",
20
20
  "RewardsDistributor_Core_0_Proxy": "0x7C7846A74AB38A8d554Bc5f7652eCf8Efb58c894",
21
+ "TwoKinks_base0bps_slope1500bps_kink8000bps_slope29000bps_base20bps_kink29000bps_jump30000bps": "0x61E98E6a1F37649543156DC995E0dfe466B31a2e",
21
22
  "VTokenBeacon": "0x53523537aa330640B80400EB8B309fF5896E7eb5",
22
23
  "VTokenImpl": "0x6829fF2937F780eD01A4CE3FDa3d0bA63B1BD771",
23
24
  "VToken_vUSDC.e_Core": "0x1aF23bD57c62A99C59aD48236553D0Dd11e49D2D",
@@ -47,7 +47,7 @@ const func = async function (hre) {
47
47
  const comptrollerProxy = await hardhat_1.ethers.getContract(`Comptroller_${pool.id}`);
48
48
  // Deploy Markets
49
49
  for (const vtoken of pool.vtokens) {
50
- const { name, asset, symbol, rateModel, baseRatePerYear, multiplierPerYear, jumpMultiplierPerYear, kink_, reserveFactor, } = vtoken;
50
+ const { name, asset, symbol, rateModel, baseRatePerYear, multiplierPerYear, jumpMultiplierPerYear, kink_, reserveFactor, multiplierPerYear2, baseRatePerYear2, kink2_, } = vtoken;
51
51
  const token = (0, deploymentConfig_1.getTokenConfig)(asset, tokensConfig);
52
52
  let tokenContract;
53
53
  if (token.isMock) {
@@ -78,7 +78,7 @@ const func = async function (hre) {
78
78
  });
79
79
  rateModelAddress = result.address;
80
80
  }
81
- else {
81
+ else if (rateModel === deploymentConfig_2.InterestRateModels.WhitePaper.toString()) {
82
82
  const [b, m] = [baseRatePerYear, multiplierPerYear].map(mantissaToBps);
83
83
  const rateModelName = `WhitePaperInterestRateModel_base${b}bps_slope${m}bps`;
84
84
  const result = await deploy(rateModelName, {
@@ -91,6 +91,41 @@ const func = async function (hre) {
91
91
  });
92
92
  rateModelAddress = result.address;
93
93
  }
94
+ else {
95
+ if (!multiplierPerYear2 || !baseRatePerYear2 || !kink2_) {
96
+ throw new Error(`Invalid IR model parameters for ${rateModel}`);
97
+ }
98
+ const [b, m, k, m2, b2, k2, j] = [
99
+ baseRatePerYear,
100
+ multiplierPerYear,
101
+ kink_,
102
+ multiplierPerYear2,
103
+ baseRatePerYear2,
104
+ kink2_,
105
+ jumpMultiplierPerYear,
106
+ ].map(mantissaToBps);
107
+ const rateModelName = `TwoKinks_base${b}bps_slope${m}bps_kink${k}bps_slope2${m2}bps_base2${b2}bps_kink2${k2}bps_jump${j}bps`;
108
+ console.log(`Deploying interest rate model ${rateModelName}`);
109
+ const result = await deploy(rateModelName, {
110
+ from: deployer,
111
+ contract: "TwoKinksInterestRateModel",
112
+ args: [
113
+ baseRatePerYear,
114
+ multiplierPerYear,
115
+ kink_,
116
+ multiplierPerYear2,
117
+ baseRatePerYear2,
118
+ kink2_,
119
+ jumpMultiplierPerYear,
120
+ isTimeBased,
121
+ blocksPerYear,
122
+ ],
123
+ log: true,
124
+ autoMine: true,
125
+ skipIfAlreadyDeployed: true,
126
+ });
127
+ rateModelAddress = result.address;
128
+ }
94
129
  const VToken = await hardhat_1.ethers.getContractFactory("VToken");
95
130
  const underlyingDecimals = Number(await tokenContract.decimals());
96
131
  const vTokenDecimals = 8;
@@ -18,7 +18,7 @@ const func = async function (hre) {
18
18
  for (const pool of poolConfig) {
19
19
  // Deploy IR Models
20
20
  for (const vtoken of pool.vtokens) {
21
- const { rateModel, baseRatePerYear, multiplierPerYear, jumpMultiplierPerYear, kink_ } = vtoken;
21
+ const { rateModel, baseRatePerYear, multiplierPerYear, jumpMultiplierPerYear, kink_, kink2_, multiplierPerYear2, baseRatePerYear2, } = vtoken;
22
22
  if (rateModel === deploymentConfig_2.InterestRateModels.JumpRate.toString()) {
23
23
  const [b, m, j, k] = [baseRatePerYear, multiplierPerYear, jumpMultiplierPerYear, kink_].map(mantissaToBps);
24
24
  const rateModelName = `JumpRateModelV2_base${b}bps_slope${m}bps_jump${j}bps_kink${k}bps`;
@@ -39,7 +39,7 @@ const func = async function (hre) {
39
39
  skipIfAlreadyDeployed: true,
40
40
  });
41
41
  }
42
- else {
42
+ else if (rateModel === deploymentConfig_2.InterestRateModels.WhitePaper.toString()) {
43
43
  const [b, m] = [baseRatePerYear, multiplierPerYear].map(mantissaToBps);
44
44
  const rateModelName = `WhitePaperInterestRateModel_base${b}bps_slope${m}bps`;
45
45
  await deploy(rateModelName, {
@@ -51,6 +51,40 @@ const func = async function (hre) {
51
51
  skipIfAlreadyDeployed: true,
52
52
  });
53
53
  }
54
+ else {
55
+ if (!multiplierPerYear2 || !baseRatePerYear2 || !kink2_) {
56
+ throw new Error(`Invalid IR model parameters for ${rateModel}`);
57
+ }
58
+ const [b, m, k, m2, b2, k2, j] = [
59
+ baseRatePerYear,
60
+ multiplierPerYear,
61
+ kink_,
62
+ multiplierPerYear2,
63
+ baseRatePerYear2,
64
+ kink2_,
65
+ jumpMultiplierPerYear,
66
+ ].map(mantissaToBps);
67
+ const rateModelName = `TwoKinks_base${b}bps_slope${m}bps_kink${k}bps_slope2${m2}bps_base2${b2}bps_kink2${k2}bps_jump${j}bps`;
68
+ console.log(`Deploying interest rate model ${rateModelName}`);
69
+ await deploy(rateModelName, {
70
+ from: deployer,
71
+ contract: "TwoKinksInterestRateModel",
72
+ args: [
73
+ baseRatePerYear,
74
+ multiplierPerYear,
75
+ kink_,
76
+ multiplierPerYear2,
77
+ baseRatePerYear2,
78
+ kink2_,
79
+ jumpMultiplierPerYear,
80
+ isTimeBased,
81
+ blocksPerYear,
82
+ ],
83
+ log: true,
84
+ autoMine: true,
85
+ skipIfAlreadyDeployed: true,
86
+ });
87
+ }
54
88
  console.log(`-----------------------------------------`);
55
89
  }
56
90
  }