@venusprotocol/venus-protocol 10.0.0 → 10.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/TwoKinks_base0bps_slope812bps_kink8000bps_slope22000bps_base20bps_kink29000bps_jump30000bps_bpy42048000.json +443 -0
- package/deployments/bscmainnet/TwoKinks_base0bps_slope875bps_kink8000bps_slope22000bps_base20bps_kink29000bps_jump30000bps_bpy42048000.json +443 -0
- package/deployments/bscmainnet/solcInputs/faff93ff29539b1a8d8494a311908070.json +496 -0
- package/deployments/bscmainnet.json +592 -0
- package/deployments/bscmainnet_addresses.json +2 -0
- package/dist/deployments/bscmainnet.json +592 -0
- package/dist/helpers/markets/bscmainnet.d.ts +4 -4
- package/dist/helpers/markets/bscmainnet.js +4 -4
- package/package.json +1 -1
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
{
|
|
2
|
+
"address": "0xF48508A44da9C7D210a668eCe4d31Bc98702602b",
|
|
3
|
+
"abi": [
|
|
4
|
+
{
|
|
5
|
+
"inputs": [
|
|
6
|
+
{
|
|
7
|
+
"internalType": "int256",
|
|
8
|
+
"name": "baseRatePerYear_",
|
|
9
|
+
"type": "int256"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"internalType": "int256",
|
|
13
|
+
"name": "multiplierPerYear_",
|
|
14
|
+
"type": "int256"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"internalType": "int256",
|
|
18
|
+
"name": "kink1_",
|
|
19
|
+
"type": "int256"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"internalType": "int256",
|
|
23
|
+
"name": "multiplier2PerYear_",
|
|
24
|
+
"type": "int256"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"internalType": "int256",
|
|
28
|
+
"name": "baseRate2PerYear_",
|
|
29
|
+
"type": "int256"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"internalType": "int256",
|
|
33
|
+
"name": "kink2_",
|
|
34
|
+
"type": "int256"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"internalType": "int256",
|
|
38
|
+
"name": "jumpMultiplierPerYear_",
|
|
39
|
+
"type": "int256"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"internalType": "int256",
|
|
43
|
+
"name": "blocksPerYear_",
|
|
44
|
+
"type": "int256"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"stateMutability": "nonpayable",
|
|
48
|
+
"type": "constructor"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"inputs": [],
|
|
52
|
+
"name": "InvalidKink",
|
|
53
|
+
"type": "error"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"inputs": [],
|
|
57
|
+
"name": "NegativeValueNotAllowed",
|
|
58
|
+
"type": "error"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"inputs": [],
|
|
62
|
+
"name": "BASE_RATE_2_PER_BLOCK",
|
|
63
|
+
"outputs": [
|
|
64
|
+
{
|
|
65
|
+
"internalType": "int256",
|
|
66
|
+
"name": "",
|
|
67
|
+
"type": "int256"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"stateMutability": "view",
|
|
71
|
+
"type": "function"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"inputs": [],
|
|
75
|
+
"name": "BASE_RATE_PER_BLOCK",
|
|
76
|
+
"outputs": [
|
|
77
|
+
{
|
|
78
|
+
"internalType": "int256",
|
|
79
|
+
"name": "",
|
|
80
|
+
"type": "int256"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"stateMutability": "view",
|
|
84
|
+
"type": "function"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"inputs": [],
|
|
88
|
+
"name": "BLOCKS_PER_YEAR",
|
|
89
|
+
"outputs": [
|
|
90
|
+
{
|
|
91
|
+
"internalType": "int256",
|
|
92
|
+
"name": "",
|
|
93
|
+
"type": "int256"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"stateMutability": "view",
|
|
97
|
+
"type": "function"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"inputs": [],
|
|
101
|
+
"name": "JUMP_MULTIPLIER_PER_BLOCK",
|
|
102
|
+
"outputs": [
|
|
103
|
+
{
|
|
104
|
+
"internalType": "int256",
|
|
105
|
+
"name": "",
|
|
106
|
+
"type": "int256"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"stateMutability": "view",
|
|
110
|
+
"type": "function"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"inputs": [],
|
|
114
|
+
"name": "KINK_1",
|
|
115
|
+
"outputs": [
|
|
116
|
+
{
|
|
117
|
+
"internalType": "int256",
|
|
118
|
+
"name": "",
|
|
119
|
+
"type": "int256"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"stateMutability": "view",
|
|
123
|
+
"type": "function"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"inputs": [],
|
|
127
|
+
"name": "KINK_2",
|
|
128
|
+
"outputs": [
|
|
129
|
+
{
|
|
130
|
+
"internalType": "int256",
|
|
131
|
+
"name": "",
|
|
132
|
+
"type": "int256"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"stateMutability": "view",
|
|
136
|
+
"type": "function"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"inputs": [],
|
|
140
|
+
"name": "MULTIPLIER_2_PER_BLOCK",
|
|
141
|
+
"outputs": [
|
|
142
|
+
{
|
|
143
|
+
"internalType": "int256",
|
|
144
|
+
"name": "",
|
|
145
|
+
"type": "int256"
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"stateMutability": "view",
|
|
149
|
+
"type": "function"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"inputs": [],
|
|
153
|
+
"name": "MULTIPLIER_PER_BLOCK",
|
|
154
|
+
"outputs": [
|
|
155
|
+
{
|
|
156
|
+
"internalType": "int256",
|
|
157
|
+
"name": "",
|
|
158
|
+
"type": "int256"
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"stateMutability": "view",
|
|
162
|
+
"type": "function"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"inputs": [],
|
|
166
|
+
"name": "RATE_1",
|
|
167
|
+
"outputs": [
|
|
168
|
+
{
|
|
169
|
+
"internalType": "int256",
|
|
170
|
+
"name": "",
|
|
171
|
+
"type": "int256"
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"stateMutability": "view",
|
|
175
|
+
"type": "function"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"inputs": [],
|
|
179
|
+
"name": "RATE_2",
|
|
180
|
+
"outputs": [
|
|
181
|
+
{
|
|
182
|
+
"internalType": "int256",
|
|
183
|
+
"name": "",
|
|
184
|
+
"type": "int256"
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
"stateMutability": "view",
|
|
188
|
+
"type": "function"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"inputs": [
|
|
192
|
+
{
|
|
193
|
+
"internalType": "uint256",
|
|
194
|
+
"name": "cash",
|
|
195
|
+
"type": "uint256"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"internalType": "uint256",
|
|
199
|
+
"name": "borrows",
|
|
200
|
+
"type": "uint256"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"internalType": "uint256",
|
|
204
|
+
"name": "reserves",
|
|
205
|
+
"type": "uint256"
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
"name": "getBorrowRate",
|
|
209
|
+
"outputs": [
|
|
210
|
+
{
|
|
211
|
+
"internalType": "uint256",
|
|
212
|
+
"name": "",
|
|
213
|
+
"type": "uint256"
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"stateMutability": "view",
|
|
217
|
+
"type": "function"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"inputs": [
|
|
221
|
+
{
|
|
222
|
+
"internalType": "uint256",
|
|
223
|
+
"name": "cash",
|
|
224
|
+
"type": "uint256"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"internalType": "uint256",
|
|
228
|
+
"name": "borrows",
|
|
229
|
+
"type": "uint256"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"internalType": "uint256",
|
|
233
|
+
"name": "reserves",
|
|
234
|
+
"type": "uint256"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"internalType": "uint256",
|
|
238
|
+
"name": "reserveFactorMantissa",
|
|
239
|
+
"type": "uint256"
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
"name": "getSupplyRate",
|
|
243
|
+
"outputs": [
|
|
244
|
+
{
|
|
245
|
+
"internalType": "uint256",
|
|
246
|
+
"name": "",
|
|
247
|
+
"type": "uint256"
|
|
248
|
+
}
|
|
249
|
+
],
|
|
250
|
+
"stateMutability": "view",
|
|
251
|
+
"type": "function"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"inputs": [],
|
|
255
|
+
"name": "isInterestRateModel",
|
|
256
|
+
"outputs": [
|
|
257
|
+
{
|
|
258
|
+
"internalType": "bool",
|
|
259
|
+
"name": "",
|
|
260
|
+
"type": "bool"
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
"stateMutability": "view",
|
|
264
|
+
"type": "function"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"inputs": [
|
|
268
|
+
{
|
|
269
|
+
"internalType": "uint256",
|
|
270
|
+
"name": "cash",
|
|
271
|
+
"type": "uint256"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"internalType": "uint256",
|
|
275
|
+
"name": "borrows",
|
|
276
|
+
"type": "uint256"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"internalType": "uint256",
|
|
280
|
+
"name": "reserves",
|
|
281
|
+
"type": "uint256"
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
"name": "utilizationRate",
|
|
285
|
+
"outputs": [
|
|
286
|
+
{
|
|
287
|
+
"internalType": "uint256",
|
|
288
|
+
"name": "",
|
|
289
|
+
"type": "uint256"
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
"stateMutability": "pure",
|
|
293
|
+
"type": "function"
|
|
294
|
+
}
|
|
295
|
+
],
|
|
296
|
+
"transactionHash": "0x4a012d63feeb99ce0f8d61c872cd5d278683a43944b42e1cdc871bb0116fbd0a",
|
|
297
|
+
"receipt": {
|
|
298
|
+
"to": null,
|
|
299
|
+
"from": "0x8BDA9f9E1fEF0DFd404Fef338D9fE4c543d172e1",
|
|
300
|
+
"contractAddress": "0xF48508A44da9C7D210a668eCe4d31Bc98702602b",
|
|
301
|
+
"transactionIndex": 86,
|
|
302
|
+
"gasUsed": "485056",
|
|
303
|
+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
|
304
|
+
"blockHash": "0x02a8a261fc909b1c31a38259d94a4d7b1acf2f5cfbad460d7c4d4ddf095a6c45",
|
|
305
|
+
"transactionHash": "0x4a012d63feeb99ce0f8d61c872cd5d278683a43944b42e1cdc871bb0116fbd0a",
|
|
306
|
+
"logs": [],
|
|
307
|
+
"blockNumber": 62857524,
|
|
308
|
+
"cumulativeGasUsed": "11417312",
|
|
309
|
+
"status": 1,
|
|
310
|
+
"byzantium": true
|
|
311
|
+
},
|
|
312
|
+
"args": [
|
|
313
|
+
"0",
|
|
314
|
+
"81250000000000000",
|
|
315
|
+
"800000000000000000",
|
|
316
|
+
"200000000000000000",
|
|
317
|
+
"0",
|
|
318
|
+
"900000000000000000",
|
|
319
|
+
"3000000000000000000",
|
|
320
|
+
42048000
|
|
321
|
+
],
|
|
322
|
+
"numDeployments": 1,
|
|
323
|
+
"solcInputHash": "faff93ff29539b1a8d8494a311908070",
|
|
324
|
+
"metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"baseRatePerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"multiplierPerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"kink1_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"multiplier2PerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"baseRate2PerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"kink2_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"jumpMultiplierPerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"blocksPerYear_\",\"type\":\"int256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidKink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NegativeValueNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BASE_RATE_2_PER_BLOCK\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BASE_RATE_PER_BLOCK\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCKS_PER_YEAR\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"JUMP_MULTIPLIER_PER_BLOCK\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"KINK_1\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"KINK_2\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MULTIPLIER_2_PER_BLOCK\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MULTIPLIER_PER_BLOCK\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RATE_1\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RATE_2\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"cash\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"borrows\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserves\",\"type\":\"uint256\"}],\"name\":\"getBorrowRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"cash\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"borrows\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserves\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveFactorMantissa\",\"type\":\"uint256\"}],\"name\":\"getSupplyRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInterestRateModel\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"cash\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"borrows\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserves\",\"type\":\"uint256\"}],\"name\":\"utilizationRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"baseRate2PerYear_\":\"The additional base APR after hitting KINK_1, as a mantissa (scaled by EXP_SCALE)\",\"baseRatePerYear_\":\"The approximate target base APR, as a mantissa (scaled by EXP_SCALE)\",\"blocksPerYear_\":\"The approximate number of blocks per year to assume\",\"jumpMultiplierPerYear_\":\"The multiplier after hitting KINK_2\",\"kink1_\":\"The utilization point at which the multiplier2 is applied\",\"kink2_\":\"The utilization point at which the jump multiplier is applied\",\"multiplier2PerYear_\":\"The rate of increase or decrease in interest rate wrt utilization after hitting KINK_1 (scaled by EXP_SCALE)\",\"multiplierPerYear_\":\"The rate of increase or decrease in interest rate wrt utilization (scaled by EXP_SCALE)\"}},\"getBorrowRate(uint256,uint256,uint256)\":{\"params\":{\"borrows\":\"The amount of borrows in the market\",\"cash\":\"The amount of cash in the market\",\"reserves\":\"The amount of reserves in the market\"},\"returns\":{\"_0\":\"The borrow rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\"}},\"getSupplyRate(uint256,uint256,uint256,uint256)\":{\"params\":{\"borrows\":\"The amount of borrows in the market\",\"cash\":\"The amount of cash in the market\",\"reserveFactorMantissa\":\"The current reserve factor for the market\",\"reserves\":\"The amount of reserves in the market\"},\"returns\":{\"_0\":\"The supply rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\"}},\"utilizationRate(uint256,uint256,uint256)\":{\"params\":{\"borrows\":\"The amount of borrows in the market\",\"cash\":\"The amount of cash in the market\",\"reserves\":\"The amount of reserves in the market\"},\"returns\":{\"_0\":\"The utilization rate as a mantissa between [0, EXP_SCALE]\"}}},\"title\":\"TwoKinksInterestRateModel\",\"version\":1},\"userdoc\":{\"errors\":{\"InvalidKink()\":[{\"notice\":\"Thrown when the kink points are not in the correct order\"}],\"NegativeValueNotAllowed()\":[{\"notice\":\"Thrown when a negative value is not allowed\"}]},\"kind\":\"user\",\"methods\":{\"BASE_RATE_2_PER_BLOCK()\":{\"notice\":\"The base interest rate per block which is the y-intercept when utilization rate hits KINK_1 scaled by EXP_SCALE\"},\"BASE_RATE_PER_BLOCK()\":{\"notice\":\"The base interest rate per block which is the y-intercept when utilization rate is 0 scaled by EXP_SCALE\"},\"JUMP_MULTIPLIER_PER_BLOCK()\":{\"notice\":\"The multiplier of utilization rate per block that gives the slope 3 of interest rate scaled by EXP_SCALE\"},\"KINK_1()\":{\"notice\":\"The utilization point at which the multiplier2 is applied\"},\"KINK_2()\":{\"notice\":\"The utilization point at which the jump multiplier is applied\"},\"MULTIPLIER_2_PER_BLOCK()\":{\"notice\":\"The multiplier of utilization rate per block that gives the slope 2 of the interest rate scaled by EXP_SCALE\"},\"MULTIPLIER_PER_BLOCK()\":{\"notice\":\"The multiplier of utilization rate per block that gives the slope 1 of the interest rate scaled by EXP_SCALE\"},\"RATE_1()\":{\"notice\":\"The maximum kink interest rate scaled by EXP_SCALE\"},\"RATE_2()\":{\"notice\":\"The maximum kink interest rate scaled by EXP_SCALE\"},\"constructor\":{\"notice\":\"Construct an interest rate model\"},\"getBorrowRate(uint256,uint256,uint256)\":{\"notice\":\"Calculates the current borrow rate per slot (block)\"},\"getSupplyRate(uint256,uint256,uint256,uint256)\":{\"notice\":\"Calculates the current supply rate per slot (block)\"},\"isInterestRateModel()\":{\"notice\":\"Indicator that this is an InterestRateModel contract (for inspection)\"},\"utilizationRate(uint256,uint256,uint256)\":{\"notice\":\"Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`\"}},\"notice\":\"An interest rate model with two different slope increase or decrease each after a certain utilization threshold called **kink** is reached.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/InterestRateModels/TwoKinksInterestRateModel.sol\":\"TwoKinksInterestRateModel\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/InterestRateModels/InterestRateModelV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/**\\n * @title Venus's InterestRateModelV8 Interface\\n * @author Venus\\n */\\nabstract contract InterestRateModelV8 {\\n /// @notice Indicator that this is an InterestRateModel contract (for inspection)\\n bool public constant isInterestRateModel = true;\\n\\n /**\\n * @notice Calculates the current borrow interest rate per block\\n * @param cash The total amount of cash the market has\\n * @param borrows The total amount of borrows the market has outstanding\\n * @param reserves The total amnount of reserves the market has\\n * @return The borrow rate per block (as a percentage, and scaled by 1e18)\\n */\\n function getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) external view virtual returns (uint256);\\n\\n /**\\n * @notice Calculates the current supply interest rate per block\\n * @param cash The total amount of cash the market has\\n * @param borrows The total amount of borrows the market has outstanding\\n * @param reserves The total amnount of reserves the market has\\n * @param reserveFactorMantissa The current reserve factor the market has\\n * @return The supply rate per block (as a percentage, and scaled by 1e18)\\n */\\n function getSupplyRate(\\n uint256 cash,\\n uint256 borrows,\\n uint256 reserves,\\n uint256 reserveFactorMantissa\\n ) external view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x4d5595e761d50a1431c34b39e72dde6c09b0ebccdbe8c5c4e12c8a2ac7b796e1\",\"license\":\"BSD-3-Clause\"},\"contracts/InterestRateModels/TwoKinksInterestRateModel.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { InterestRateModelV8 } from \\\"./InterestRateModelV8.sol\\\";\\n\\n/**\\n * @title TwoKinksInterestRateModel\\n * @author Venus\\n * @notice An interest rate model with two different slope increase or decrease each after a certain utilization threshold called **kink** is reached.\\n */\\ncontract TwoKinksInterestRateModel is InterestRateModelV8 {\\n int256 public immutable BLOCKS_PER_YEAR;\\n\\n ////////////////////// SLOPE 1 //////////////////////\\n\\n /**\\n * @notice The multiplier of utilization rate per block that gives the slope 1 of the interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable MULTIPLIER_PER_BLOCK;\\n\\n /**\\n * @notice The base interest rate per block which is the y-intercept when utilization rate is 0 scaled by EXP_SCALE\\n */\\n int256 public immutable BASE_RATE_PER_BLOCK;\\n\\n ////////////////////// SLOPE 2 //////////////////////\\n\\n /**\\n * @notice The utilization point at which the multiplier2 is applied\\n */\\n int256 public immutable KINK_1;\\n\\n /**\\n * @notice The multiplier of utilization rate per block that gives the slope 2 of the interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable MULTIPLIER_2_PER_BLOCK;\\n\\n /**\\n * @notice The base interest rate per block which is the y-intercept when utilization rate hits KINK_1 scaled by EXP_SCALE\\n */\\n int256 public immutable BASE_RATE_2_PER_BLOCK;\\n\\n /**\\n * @notice The maximum kink interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable RATE_1;\\n\\n ////////////////////// SLOPE 3 //////////////////////\\n\\n /**\\n * @notice The utilization point at which the jump multiplier is applied\\n */\\n int256 public immutable KINK_2;\\n\\n /**\\n * @notice The multiplier of utilization rate per block that gives the slope 3 of interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable JUMP_MULTIPLIER_PER_BLOCK;\\n\\n /**\\n * @notice The maximum kink interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable RATE_2;\\n\\n /// @notice Base unit for computations, usually used in scaling (multiplications, divisions)\\n uint256 internal constant EXP_SCALE = 1e18;\\n\\n /**\\n * @notice Thrown when a negative value is not allowed\\n */\\n error NegativeValueNotAllowed();\\n\\n /**\\n * @notice Thrown when the kink points are not in the correct order\\n */\\n error InvalidKink();\\n\\n /**\\n * @notice Construct an interest rate model\\n * @param baseRatePerYear_ The approximate target base APR, as a mantissa (scaled by EXP_SCALE)\\n * @param multiplierPerYear_ The rate of increase or decrease in interest rate wrt utilization (scaled by EXP_SCALE)\\n * @param kink1_ The utilization point at which the multiplier2 is applied\\n * @param multiplier2PerYear_ The rate of increase or decrease in interest rate wrt utilization after hitting KINK_1 (scaled by EXP_SCALE)\\n * @param baseRate2PerYear_ The additional base APR after hitting KINK_1, as a mantissa (scaled by EXP_SCALE)\\n * @param kink2_ The utilization point at which the jump multiplier is applied\\n * @param jumpMultiplierPerYear_ The multiplier after hitting KINK_2\\n * @param blocksPerYear_ The approximate number of blocks per year to assume\\n */\\n constructor(\\n int256 baseRatePerYear_,\\n int256 multiplierPerYear_,\\n int256 kink1_,\\n int256 multiplier2PerYear_,\\n int256 baseRate2PerYear_,\\n int256 kink2_,\\n int256 jumpMultiplierPerYear_,\\n int256 blocksPerYear_\\n ) {\\n if (baseRatePerYear_ < 0 || baseRate2PerYear_ < 0) {\\n revert NegativeValueNotAllowed();\\n }\\n\\n if (kink2_ <= kink1_ || kink1_ <= 0) {\\n revert InvalidKink();\\n }\\n\\n BLOCKS_PER_YEAR = blocksPerYear_;\\n BASE_RATE_PER_BLOCK = baseRatePerYear_ / BLOCKS_PER_YEAR;\\n MULTIPLIER_PER_BLOCK = multiplierPerYear_ / BLOCKS_PER_YEAR;\\n KINK_1 = kink1_;\\n MULTIPLIER_2_PER_BLOCK = multiplier2PerYear_ / BLOCKS_PER_YEAR;\\n BASE_RATE_2_PER_BLOCK = baseRate2PerYear_ / BLOCKS_PER_YEAR;\\n KINK_2 = kink2_;\\n JUMP_MULTIPLIER_PER_BLOCK = jumpMultiplierPerYear_ / BLOCKS_PER_YEAR;\\n\\n int256 expScale = int256(EXP_SCALE);\\n RATE_1 = (((KINK_1 * MULTIPLIER_PER_BLOCK) / expScale) + BASE_RATE_PER_BLOCK);\\n\\n int256 slope2Util;\\n unchecked {\\n slope2Util = KINK_2 - KINK_1;\\n }\\n RATE_2 = ((slope2Util * MULTIPLIER_2_PER_BLOCK) / expScale) + BASE_RATE_2_PER_BLOCK;\\n }\\n\\n /**\\n * @notice Calculates the current borrow rate per slot (block)\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @return The borrow rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\\n */\\n function getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) external view override returns (uint256) {\\n return _getBorrowRate(cash, borrows, reserves);\\n }\\n\\n /**\\n * @notice Calculates the current supply rate per slot (block)\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @param reserveFactorMantissa The current reserve factor for the market\\n * @return The supply rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\\n */\\n function getSupplyRate(\\n uint256 cash,\\n uint256 borrows,\\n uint256 reserves,\\n uint256 reserveFactorMantissa\\n ) public view virtual override returns (uint256) {\\n uint256 oneMinusReserveFactor = EXP_SCALE - reserveFactorMantissa;\\n uint256 borrowRate = _getBorrowRate(cash, borrows, reserves);\\n uint256 rateToPool = (borrowRate * oneMinusReserveFactor) / EXP_SCALE;\\n return (utilizationRate(cash, borrows, reserves) * rateToPool) / EXP_SCALE;\\n }\\n\\n /**\\n * @notice Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @return The utilization rate as a mantissa between [0, EXP_SCALE]\\n */\\n function utilizationRate(uint256 cash, uint256 borrows, uint256 reserves) public pure returns (uint256) {\\n // Utilization rate is 0 when there are no borrows\\n if (borrows == 0) {\\n return 0;\\n }\\n\\n uint256 rate = (borrows * EXP_SCALE) / (cash + borrows - reserves);\\n\\n if (rate > EXP_SCALE) {\\n rate = EXP_SCALE;\\n }\\n\\n return rate;\\n }\\n\\n /**\\n * @notice Calculates the current borrow rate per slot (block), with the error code expected by the market\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @return The borrow rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\\n */\\n function _getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) internal view returns (uint256) {\\n int256 util = int256(utilizationRate(cash, borrows, reserves));\\n int256 expScale = int256(EXP_SCALE);\\n\\n if (util < KINK_1) {\\n return _minCap(((util * MULTIPLIER_PER_BLOCK) / expScale) + BASE_RATE_PER_BLOCK);\\n } else if (util < KINK_2) {\\n int256 slope2Util;\\n unchecked {\\n slope2Util = util - KINK_1;\\n }\\n int256 rate2 = ((slope2Util * MULTIPLIER_2_PER_BLOCK) / expScale) + BASE_RATE_2_PER_BLOCK;\\n\\n return _minCap(RATE_1 + rate2);\\n } else {\\n int256 slope3Util;\\n unchecked {\\n slope3Util = util - KINK_2;\\n }\\n int256 rate3 = ((slope3Util * JUMP_MULTIPLIER_PER_BLOCK) / expScale);\\n\\n return _minCap(RATE_1 + RATE_2 + rate3);\\n }\\n }\\n\\n /**\\n * @notice Returns 0 if number is less than 0, otherwise returns the input\\n * @param number The first number\\n * @return The maximum of 0 and input number\\n */\\n function _minCap(int256 number) internal pure returns (uint256) {\\n int256 zero;\\n return uint256(number > zero ? number : zero);\\n }\\n}\\n\",\"keccak256\":\"0xf9ee4f9589cfe5f179eb7dd49872a3a70f442443fe2a1f93583ae284e2271286\",\"license\":\"BSD-3-Clause\"}},\"version\":1}",
|
|
325
|
+
"bytecode": "0x6101c0604052348015610010575f80fd5b50604051610ad3380380610ad383398101604081905261002f91610167565b5f88128061003c57505f84125b1561005a576040516341820e7560e11b815260040160405180910390fd5b858313158061006957505f8613155b1561008757604051637099641d60e11b815260040160405180910390fd5b608081905261009681896101d3565b60c0526080516100a690886101d3565b60a05260e08690526080516100bb90866101d3565b610100526080516100cc90856101d3565b610120526101608390526080516100e390836101d3565b6101805260c05160a05160e051670de0b6b3a764000092918391610107919061020b565b61011191906101d3565b61011b9190610240565b6101405260e0516101605161012051610100519290910391839061013f908461020b565b61014991906101d3565b6101539190610240565b6101a0525061026798505050505050505050565b5f805f805f805f80610100898b03121561017f575f80fd5b505086516020880151604089015160608a015160808b015160a08c015160c08d015160e0909d0151959e949d50929b919a50985090965094509092509050565b634e487b7160e01b5f52601160045260245ffd5b5f826101ed57634e487b7160e01b5f52601260045260245ffd5b600160ff1b82145f1984141615610206576102066101bf565b500590565b8082025f8212600160ff1b84141615610226576102266101bf565b818105831482151761023a5761023a6101bf565b92915050565b8082018281125f83128015821682158216171561025f5761025f6101bf565b505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516107aa6103295f395f81816101a001526105c101525f81816102b0015261058701525f818161015201528181610479015261055f01525f818160ed0152818161052e01526105e201525f818161020101526104c501525f818161028901526104ea01525f8181610179015281816103e001526104a101525f818161023b015261040b01525f81816101da015261043001525f61026201526107aa5ff3fe608060405234801561000f575f80fd5b50600436106100e4575f3560e01c80638ea0930e11610088578063c563364911610063578063c563364914610236578063d37db1d21461025d578063ebf22a0814610284578063fe8167d8146102ab575f80fd5b80638ea0930e146101d5578063b5712681146101fc578063b816881614610223575f80fd5b806338afe9c4116100c357806338afe9c41461014d5780633b53e888146101745780635d0054c41461019b5780636e71e2d8146101c2575f80fd5b8062084e89146100e857806315f24053146101225780632191f92a14610135575b5f80fd5b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b61010f61013036600461061c565b6102d2565b61013d600181565b6040519015158152602001610119565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f6101d036600461061c565b6102e8565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f610231366004610645565b61034d565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b5f6102de8484846103c6565b90505b9392505050565b5f825f036102f757505f6102e1565b5f826103038587610688565b61030d91906106a1565b61031f670de0b6b3a7640000866106b4565b61032991906106df565b9050670de0b6b3a76400008111156102de5750670de0b6b3a7640000949350505050565b5f8061036183670de0b6b3a76400006106a1565b90505f61036f8787876103c6565b90505f670de0b6b3a764000061038584846106b4565b61038f91906106df565b9050670de0b6b3a7640000816103a68a8a8a6102e8565b6103b091906106b4565b6103ba91906106df565b98975050505050505050565b5f806103d38585856102e8565b9050670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000008212156104775761046e7f0000000000000000000000000000000000000000000000000000000000000000826104557f0000000000000000000000000000000000000000000000000000000000000000866106f2565b61045f9190610721565b610469919061074d565b610606565b925050506102e1565b7f000000000000000000000000000000000000000000000000000000000000000082121561055d577f000000000000000000000000000000000000000000000000000000000000000082035f7f00000000000000000000000000000000000000000000000000000000000000008361050f7f0000000000000000000000000000000000000000000000000000000000000000856106f2565b6105199190610721565b610523919061074d565b9050610552610469827f000000000000000000000000000000000000000000000000000000000000000061074d565b9450505050506102e1565b7f000000000000000000000000000000000000000000000000000000000000000082035f826105ac7f0000000000000000000000000000000000000000000000000000000000000000846106f2565b6105b69190610721565b90506105528161045f7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061074d565b5f8080831361061557806102e1565b5090919050565b5f805f6060848603121561062e575f80fd5b505081359360208301359350604090920135919050565b5f805f8060808587031215610658575f80fd5b5050823594602084013594506040840135936060013592509050565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561069b5761069b610674565b92915050565b8181038181111561069b5761069b610674565b808202811582820484141761069b5761069b610674565b634e487b7160e01b5f52601260045260245ffd5b5f826106ed576106ed6106cb565b500490565b8082025f8212600160ff1b8414161561070d5761070d610674565b818105831482151761069b5761069b610674565b5f8261072f5761072f6106cb565b600160ff1b82145f198414161561074857610748610674565b500590565b8082018281125f83128015821682158216171561076c5761076c610674565b50509291505056fea264697066735822122098d480280f56c3aa207d69220f86773e94b28973cb0157107164c42807551fbf64736f6c63430008190033",
|
|
326
|
+
"deployedBytecode": "0x608060405234801561000f575f80fd5b50600436106100e4575f3560e01c80638ea0930e11610088578063c563364911610063578063c563364914610236578063d37db1d21461025d578063ebf22a0814610284578063fe8167d8146102ab575f80fd5b80638ea0930e146101d5578063b5712681146101fc578063b816881614610223575f80fd5b806338afe9c4116100c357806338afe9c41461014d5780633b53e888146101745780635d0054c41461019b5780636e71e2d8146101c2575f80fd5b8062084e89146100e857806315f24053146101225780632191f92a14610135575b5f80fd5b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b61010f61013036600461061c565b6102d2565b61013d600181565b6040519015158152602001610119565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f6101d036600461061c565b6102e8565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f610231366004610645565b61034d565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b5f6102de8484846103c6565b90505b9392505050565b5f825f036102f757505f6102e1565b5f826103038587610688565b61030d91906106a1565b61031f670de0b6b3a7640000866106b4565b61032991906106df565b9050670de0b6b3a76400008111156102de5750670de0b6b3a7640000949350505050565b5f8061036183670de0b6b3a76400006106a1565b90505f61036f8787876103c6565b90505f670de0b6b3a764000061038584846106b4565b61038f91906106df565b9050670de0b6b3a7640000816103a68a8a8a6102e8565b6103b091906106b4565b6103ba91906106df565b98975050505050505050565b5f806103d38585856102e8565b9050670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000008212156104775761046e7f0000000000000000000000000000000000000000000000000000000000000000826104557f0000000000000000000000000000000000000000000000000000000000000000866106f2565b61045f9190610721565b610469919061074d565b610606565b925050506102e1565b7f000000000000000000000000000000000000000000000000000000000000000082121561055d577f000000000000000000000000000000000000000000000000000000000000000082035f7f00000000000000000000000000000000000000000000000000000000000000008361050f7f0000000000000000000000000000000000000000000000000000000000000000856106f2565b6105199190610721565b610523919061074d565b9050610552610469827f000000000000000000000000000000000000000000000000000000000000000061074d565b9450505050506102e1565b7f000000000000000000000000000000000000000000000000000000000000000082035f826105ac7f0000000000000000000000000000000000000000000000000000000000000000846106f2565b6105b69190610721565b90506105528161045f7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061074d565b5f8080831361061557806102e1565b5090919050565b5f805f6060848603121561062e575f80fd5b505081359360208301359350604090920135919050565b5f805f8060808587031215610658575f80fd5b5050823594602084013594506040840135936060013592509050565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561069b5761069b610674565b92915050565b8181038181111561069b5761069b610674565b808202811582820484141761069b5761069b610674565b634e487b7160e01b5f52601260045260245ffd5b5f826106ed576106ed6106cb565b500490565b8082025f8212600160ff1b8414161561070d5761070d610674565b818105831482151761069b5761069b610674565b5f8261072f5761072f6106cb565b600160ff1b82145f198414161561074857610748610674565b500590565b8082018281125f83128015821682158216171561076c5761076c610674565b50509291505056fea264697066735822122098d480280f56c3aa207d69220f86773e94b28973cb0157107164c42807551fbf64736f6c63430008190033",
|
|
327
|
+
"devdoc": {
|
|
328
|
+
"author": "Venus",
|
|
329
|
+
"kind": "dev",
|
|
330
|
+
"methods": {
|
|
331
|
+
"constructor": {
|
|
332
|
+
"params": {
|
|
333
|
+
"baseRate2PerYear_": "The additional base APR after hitting KINK_1, as a mantissa (scaled by EXP_SCALE)",
|
|
334
|
+
"baseRatePerYear_": "The approximate target base APR, as a mantissa (scaled by EXP_SCALE)",
|
|
335
|
+
"blocksPerYear_": "The approximate number of blocks per year to assume",
|
|
336
|
+
"jumpMultiplierPerYear_": "The multiplier after hitting KINK_2",
|
|
337
|
+
"kink1_": "The utilization point at which the multiplier2 is applied",
|
|
338
|
+
"kink2_": "The utilization point at which the jump multiplier is applied",
|
|
339
|
+
"multiplier2PerYear_": "The rate of increase or decrease in interest rate wrt utilization after hitting KINK_1 (scaled by EXP_SCALE)",
|
|
340
|
+
"multiplierPerYear_": "The rate of increase or decrease in interest rate wrt utilization (scaled by EXP_SCALE)"
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
"getBorrowRate(uint256,uint256,uint256)": {
|
|
344
|
+
"params": {
|
|
345
|
+
"borrows": "The amount of borrows in the market",
|
|
346
|
+
"cash": "The amount of cash in the market",
|
|
347
|
+
"reserves": "The amount of reserves in the market"
|
|
348
|
+
},
|
|
349
|
+
"returns": {
|
|
350
|
+
"_0": "The borrow rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)"
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
"getSupplyRate(uint256,uint256,uint256,uint256)": {
|
|
354
|
+
"params": {
|
|
355
|
+
"borrows": "The amount of borrows in the market",
|
|
356
|
+
"cash": "The amount of cash in the market",
|
|
357
|
+
"reserveFactorMantissa": "The current reserve factor for the market",
|
|
358
|
+
"reserves": "The amount of reserves in the market"
|
|
359
|
+
},
|
|
360
|
+
"returns": {
|
|
361
|
+
"_0": "The supply rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)"
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
"utilizationRate(uint256,uint256,uint256)": {
|
|
365
|
+
"params": {
|
|
366
|
+
"borrows": "The amount of borrows in the market",
|
|
367
|
+
"cash": "The amount of cash in the market",
|
|
368
|
+
"reserves": "The amount of reserves in the market"
|
|
369
|
+
},
|
|
370
|
+
"returns": {
|
|
371
|
+
"_0": "The utilization rate as a mantissa between [0, EXP_SCALE]"
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
"title": "TwoKinksInterestRateModel",
|
|
376
|
+
"version": 1
|
|
377
|
+
},
|
|
378
|
+
"userdoc": {
|
|
379
|
+
"errors": {
|
|
380
|
+
"InvalidKink()": [
|
|
381
|
+
{
|
|
382
|
+
"notice": "Thrown when the kink points are not in the correct order"
|
|
383
|
+
}
|
|
384
|
+
],
|
|
385
|
+
"NegativeValueNotAllowed()": [
|
|
386
|
+
{
|
|
387
|
+
"notice": "Thrown when a negative value is not allowed"
|
|
388
|
+
}
|
|
389
|
+
]
|
|
390
|
+
},
|
|
391
|
+
"kind": "user",
|
|
392
|
+
"methods": {
|
|
393
|
+
"BASE_RATE_2_PER_BLOCK()": {
|
|
394
|
+
"notice": "The base interest rate per block which is the y-intercept when utilization rate hits KINK_1 scaled by EXP_SCALE"
|
|
395
|
+
},
|
|
396
|
+
"BASE_RATE_PER_BLOCK()": {
|
|
397
|
+
"notice": "The base interest rate per block which is the y-intercept when utilization rate is 0 scaled by EXP_SCALE"
|
|
398
|
+
},
|
|
399
|
+
"JUMP_MULTIPLIER_PER_BLOCK()": {
|
|
400
|
+
"notice": "The multiplier of utilization rate per block that gives the slope 3 of interest rate scaled by EXP_SCALE"
|
|
401
|
+
},
|
|
402
|
+
"KINK_1()": {
|
|
403
|
+
"notice": "The utilization point at which the multiplier2 is applied"
|
|
404
|
+
},
|
|
405
|
+
"KINK_2()": {
|
|
406
|
+
"notice": "The utilization point at which the jump multiplier is applied"
|
|
407
|
+
},
|
|
408
|
+
"MULTIPLIER_2_PER_BLOCK()": {
|
|
409
|
+
"notice": "The multiplier of utilization rate per block that gives the slope 2 of the interest rate scaled by EXP_SCALE"
|
|
410
|
+
},
|
|
411
|
+
"MULTIPLIER_PER_BLOCK()": {
|
|
412
|
+
"notice": "The multiplier of utilization rate per block that gives the slope 1 of the interest rate scaled by EXP_SCALE"
|
|
413
|
+
},
|
|
414
|
+
"RATE_1()": {
|
|
415
|
+
"notice": "The maximum kink interest rate scaled by EXP_SCALE"
|
|
416
|
+
},
|
|
417
|
+
"RATE_2()": {
|
|
418
|
+
"notice": "The maximum kink interest rate scaled by EXP_SCALE"
|
|
419
|
+
},
|
|
420
|
+
"constructor": {
|
|
421
|
+
"notice": "Construct an interest rate model"
|
|
422
|
+
},
|
|
423
|
+
"getBorrowRate(uint256,uint256,uint256)": {
|
|
424
|
+
"notice": "Calculates the current borrow rate per slot (block)"
|
|
425
|
+
},
|
|
426
|
+
"getSupplyRate(uint256,uint256,uint256,uint256)": {
|
|
427
|
+
"notice": "Calculates the current supply rate per slot (block)"
|
|
428
|
+
},
|
|
429
|
+
"isInterestRateModel()": {
|
|
430
|
+
"notice": "Indicator that this is an InterestRateModel contract (for inspection)"
|
|
431
|
+
},
|
|
432
|
+
"utilizationRate(uint256,uint256,uint256)": {
|
|
433
|
+
"notice": "Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`"
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
"notice": "An interest rate model with two different slope increase or decrease each after a certain utilization threshold called **kink** is reached.",
|
|
437
|
+
"version": 1
|
|
438
|
+
},
|
|
439
|
+
"storageLayout": {
|
|
440
|
+
"storage": [],
|
|
441
|
+
"types": null
|
|
442
|
+
}
|
|
443
|
+
}
|