-
Notifications
You must be signed in to change notification settings - Fork 1
/
JumpRateModel.json
398 lines (398 loc) · 27.9 KB
/
JumpRateModel.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
{
"address": "0x9748b6d59fd4C4f087294087bD94b6B9d95B4293",
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "baseRatePerYear",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "multiplierPerYear",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "jumpMultiplierPerYear",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "kink_",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "baseRatePerBlock",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "multiplierPerBlock",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "jumpMultiplierPerBlock",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "kink",
"type": "uint256"
}
],
"name": "NewInterestParams",
"type": "event"
},
{
"inputs": [],
"name": "baseRatePerBlock",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "blocksPerYear",
"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"
}
],
"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": [],
"name": "jumpMultiplierPerBlock",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "kink",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "multiplierPerBlock",
"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"
}
],
"name": "utilizationRate",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
}
],
"transactionHash": "0x6abb1e9a8dfe745ad5a1a46cfad4706f1c8a893be21c24e64634b675162257c4",
"receipt": {
"to": null,
"from": "0x2fA8e44e9A3D833019FCc52D62B4dD05125cA1b1",
"contractAddress": "0x9748b6d59fd4C4f087294087bD94b6B9d95B4293",
"transactionIndex": 0,
"gasUsed": "340698",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000080000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000",
"blockHash": "0xff2d3507374a51e99dc5ce5a54984e28317b7df3458d51262c6c13173a9da761",
"transactionHash": "0x6abb1e9a8dfe745ad5a1a46cfad4706f1c8a893be21c24e64634b675162257c4",
"logs": [
{
"transactionIndex": 0,
"blockNumber": 224943,
"transactionHash": "0x6abb1e9a8dfe745ad5a1a46cfad4706f1c8a893be21c24e64634b675162257c4",
"address": "0x9748b6d59fd4C4f087294087bD94b6B9d95B4293",
"topics": [
"0x6960ab234c7ef4b0c9197100f5393cfcde7c453ac910a27bd2000aa1dd4c068d"
],
"data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c4ade592b000000000000000000000000000000000000000000000000000000b12b7964ad00000000000000000000000000000000000000000000000009b6e64a8ec60000",
"logIndex": 0,
"blockHash": "0xff2d3507374a51e99dc5ce5a54984e28317b7df3458d51262c6c13173a9da761"
}
],
"blockNumber": 224943,
"cumulativeGasUsed": "340698",
"status": 1,
"byzantium": true
},
"args": [
"0",
"1000000000000000000",
"4000000000000000000",
"700000000000000000"
],
"numDeployments": 2,
"solcInputHash": "a822655fb04b3944b585567b09afe37c",
"metadata": "{\"compiler\":{\"version\":\"0.8.11+commit.d7f03943\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"baseRatePerYear\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"multiplierPerYear\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"jumpMultiplierPerYear\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"kink_\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"baseRatePerBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"multiplierPerBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"jumpMultiplierPerBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"kink\",\"type\":\"uint256\"}],\"name\":\"NewInterestParams\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"baseRatePerBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blocksPerYear\",\"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\"}],\"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\":[],\"name\":\"jumpMultiplierPerBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"kink\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"multiplierPerBlock\",\"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\"}],\"name\":\"utilizationRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Compound\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"baseRatePerYear\":\"The approximate target base APR, as a mantissa (scaled by BASE)\",\"jumpMultiplierPerYear\":\"The multiplierPerBlock after hitting a specified utilization point\",\"kink_\":\"The utilization point at which the jump multiplier is applied\",\"multiplierPerYear\":\"The rate of increase in interest rate wrt utilization (scaled by BASE)\"}},\"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 block as a mantissa (scaled by BASE)\"}},\"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 block as a mantissa (scaled by BASE)\"}},\"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 (currently unused)\"},\"returns\":{\"_0\":\"The utilization rate as a mantissa between [0, BASE]\"}}},\"title\":\"Compound's JumpRateModel Contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"baseRatePerBlock()\":{\"notice\":\"The base interest rate which is the y-intercept when utilization rate is 0\"},\"blocksPerYear()\":{\"notice\":\"The approximate number of blocks per year that is assumed by the interest rate model\"},\"constructor\":{\"notice\":\"Construct an interest rate model\"},\"getBorrowRate(uint256,uint256,uint256)\":{\"notice\":\"Calculates the current borrow rate per block, with the error code expected by the market\"},\"getSupplyRate(uint256,uint256,uint256,uint256)\":{\"notice\":\"Calculates the current supply rate per block\"},\"isInterestRateModel()\":{\"notice\":\"Indicator that this is an InterestRateModel contract (for inspection)\"},\"jumpMultiplierPerBlock()\":{\"notice\":\"The multiplierPerBlock after hitting a specified utilization point\"},\"kink()\":{\"notice\":\"The utilization point at which the jump multiplier is applied\"},\"multiplierPerBlock()\":{\"notice\":\"The multiplier of utilization rate that gives the slope of the interest rate\"},\"utilizationRate(uint256,uint256,uint256)\":{\"notice\":\"Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/JumpRateModel.sol\":\"JumpRateModel\"},\"evmVersion\":\"london\",\"libraries\":{\":__CACHE_BREAKER__\":\"0x0000000000000031363630313837333733303434\"},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"src/InterestRateModel.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\n/**\\n * @title Compound's InterestRateModel Interface\\n * @author Compound\\n */\\nabstract contract InterestRateModel {\\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 amount of reserves the market has\\n * @return The borrow rate per block (as a percentage, and scaled by 1e18)\\n */\\n function getBorrowRate(uint cash, uint borrows, uint reserves) virtual view external returns (uint);\\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 amount 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(uint cash, uint borrows, uint reserves, uint reserveFactorMantissa) virtual view external returns (uint);\\n}\\n\",\"keccak256\":\"0x8076506ade5e37e9d2acb71a3685b4ecb88dfe12ee8a9936bdfd146ce48aa541\",\"license\":\"BSD-3-Clause\"},\"src/JumpRateModel.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\nimport \\\"./InterestRateModel.sol\\\";\\n\\n/**\\n * @title Compound's JumpRateModel Contract\\n * @author Compound\\n */\\ncontract JumpRateModel is InterestRateModel {\\n event NewInterestParams(uint baseRatePerBlock, uint multiplierPerBlock, uint jumpMultiplierPerBlock, uint kink);\\n\\n uint256 private constant BASE = 1e18;\\n\\n /**\\n * @notice The approximate number of blocks per year that is assumed by the interest rate model\\n */\\n uint public constant blocksPerYear = 5256666;\\n\\n /**\\n * @notice The multiplier of utilization rate that gives the slope of the interest rate\\n */\\n uint public multiplierPerBlock;\\n\\n /**\\n * @notice The base interest rate which is the y-intercept when utilization rate is 0\\n */\\n uint public baseRatePerBlock;\\n\\n /**\\n * @notice The multiplierPerBlock after hitting a specified utilization point\\n */\\n uint public jumpMultiplierPerBlock;\\n\\n /**\\n * @notice The utilization point at which the jump multiplier is applied\\n */\\n uint public kink;\\n\\n /**\\n * @notice Construct an interest rate model\\n * @param baseRatePerYear The approximate target base APR, as a mantissa (scaled by BASE)\\n * @param multiplierPerYear The rate of increase in interest rate wrt utilization (scaled by BASE)\\n * @param jumpMultiplierPerYear The multiplierPerBlock after hitting a specified utilization point\\n * @param kink_ The utilization point at which the jump multiplier is applied\\n */\\n constructor(uint baseRatePerYear, uint multiplierPerYear, uint jumpMultiplierPerYear, uint kink_) public {\\n baseRatePerBlock = baseRatePerYear / blocksPerYear;\\n multiplierPerBlock = multiplierPerYear / blocksPerYear;\\n jumpMultiplierPerBlock = jumpMultiplierPerYear / blocksPerYear;\\n kink = kink_;\\n\\n emit NewInterestParams(baseRatePerBlock, multiplierPerBlock, jumpMultiplierPerBlock, kink);\\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 (currently unused)\\n * @return The utilization rate as a mantissa between [0, BASE]\\n */\\n function utilizationRate(uint cash, uint borrows, uint reserves) public pure returns (uint) {\\n // Utilization rate is 0 when there are no borrows\\n if (borrows == 0) {\\n return 0;\\n }\\n\\n return borrows * BASE / (cash + borrows - reserves);\\n }\\n\\n /**\\n * @notice Calculates the current borrow rate per 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 block as a mantissa (scaled by BASE)\\n */\\n function getBorrowRate(uint cash, uint borrows, uint reserves) override public view returns (uint) {\\n uint util = utilizationRate(cash, borrows, reserves);\\n\\n if (util <= kink) {\\n return (util * multiplierPerBlock / BASE) + baseRatePerBlock;\\n } else {\\n uint normalRate = (kink * multiplierPerBlock / BASE) + baseRatePerBlock;\\n uint excessUtil = util - kink;\\n return (excessUtil * jumpMultiplierPerBlock/ BASE) + normalRate;\\n }\\n }\\n\\n /**\\n * @notice Calculates the current supply rate per 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 block as a mantissa (scaled by BASE)\\n */\\n function getSupplyRate(uint cash, uint borrows, uint reserves, uint reserveFactorMantissa) override public view returns (uint) {\\n uint oneMinusReserveFactor = BASE - reserveFactorMantissa;\\n uint borrowRate = getBorrowRate(cash, borrows, reserves);\\n uint rateToPool = borrowRate * oneMinusReserveFactor / BASE;\\n return utilizationRate(cash, borrows, reserves) * rateToPool / BASE;\\n }\\n}\\n\",\"keccak256\":\"0x5b0977c7f733f2d9a2599789e4a2407d504d1275ee3e49edc4a91bde6020dac4\",\"license\":\"BSD-3-Clause\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b506040516104fb3803806104fb83398101604081905261002f916100be565b61003c625035da856100f4565b60015561004c625035da846100f4565b60005561005c625035da836100f4565b60028190556003829055600154600054604080519283526020830191909152810191909152606081018290527f6960ab234c7ef4b0c9197100f5393cfcde7c453ac910a27bd2000aa1dd4c068d9060800160405180910390a150505050610116565b600080600080608085870312156100d457600080fd5b505082516020840151604085015160609095015191969095509092509050565b60008261011157634e487b7160e01b600052601260045260246000fd5b500490565b6103d6806101256000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063a385fb9611610066578063a385fb96146100f2578063b8168816146100fc578063b9f9850a1461010f578063f14039de14610118578063fd2da3391461012157600080fd5b806315f24053146100985780632191f92a146100be5780636e71e2d8146100d65780638726bb89146100e9575b600080fd5b6100ab6100a63660046102bc565b61012a565b6040519081526020015b60405180910390f35b6100c6600181565b60405190151581526020016100b5565b6100ab6100e43660046102bc565b6101f8565b6100ab60005481565b6100ab625035da81565b6100ab61010a3660046102e8565b610240565b6100ab60025481565b6100ab60015481565b6100ab60035481565b6000806101388585856101f8565b9050600354811161017957600154670de0b6b3a76400006000548361015d9190610330565b610167919061034f565b6101719190610371565b9150506101f1565b6000600154670de0b6b3a76400006000546003546101979190610330565b6101a1919061034f565b6101ab9190610371565b90506000600354836101bd9190610389565b905081670de0b6b3a7640000600254836101d79190610330565b6101e1919061034f565b6101eb9190610371565b93505050505b9392505050565b600082610207575060006101f1565b816102128486610371565b61021c9190610389565b61022e670de0b6b3a764000085610330565b610238919061034f565b949350505050565b60008061025583670de0b6b3a7640000610389565b9050600061026487878761012a565b90506000670de0b6b3a764000061027b8484610330565b610285919061034f565b9050670de0b6b3a76400008161029c8a8a8a6101f8565b6102a69190610330565b6102b0919061034f565b98975050505050505050565b6000806000606084860312156102d157600080fd5b505081359360208301359350604090920135919050565b600080600080608085870312156102fe57600080fd5b5050823594602084013594506040840135936060013592509050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561034a5761034a61031a565b500290565b60008261036c57634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156103845761038461031a565b500190565b60008282101561039b5761039b61031a565b50039056fea2646970667358221220dec517622c876077d05501ed4db2a80c94c049988cd348f5062af13d4961996b64736f6c634300080b0033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063a385fb9611610066578063a385fb96146100f2578063b8168816146100fc578063b9f9850a1461010f578063f14039de14610118578063fd2da3391461012157600080fd5b806315f24053146100985780632191f92a146100be5780636e71e2d8146100d65780638726bb89146100e9575b600080fd5b6100ab6100a63660046102bc565b61012a565b6040519081526020015b60405180910390f35b6100c6600181565b60405190151581526020016100b5565b6100ab6100e43660046102bc565b6101f8565b6100ab60005481565b6100ab625035da81565b6100ab61010a3660046102e8565b610240565b6100ab60025481565b6100ab60015481565b6100ab60035481565b6000806101388585856101f8565b9050600354811161017957600154670de0b6b3a76400006000548361015d9190610330565b610167919061034f565b6101719190610371565b9150506101f1565b6000600154670de0b6b3a76400006000546003546101979190610330565b6101a1919061034f565b6101ab9190610371565b90506000600354836101bd9190610389565b905081670de0b6b3a7640000600254836101d79190610330565b6101e1919061034f565b6101eb9190610371565b93505050505b9392505050565b600082610207575060006101f1565b816102128486610371565b61021c9190610389565b61022e670de0b6b3a764000085610330565b610238919061034f565b949350505050565b60008061025583670de0b6b3a7640000610389565b9050600061026487878761012a565b90506000670de0b6b3a764000061027b8484610330565b610285919061034f565b9050670de0b6b3a76400008161029c8a8a8a6101f8565b6102a69190610330565b6102b0919061034f565b98975050505050505050565b6000806000606084860312156102d157600080fd5b505081359360208301359350604090920135919050565b600080600080608085870312156102fe57600080fd5b5050823594602084013594506040840135936060013592509050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561034a5761034a61031a565b500290565b60008261036c57634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156103845761038461031a565b500190565b60008282101561039b5761039b61031a565b50039056fea2646970667358221220dec517622c876077d05501ed4db2a80c94c049988cd348f5062af13d4961996b64736f6c634300080b0033",
"devdoc": {
"author": "Compound",
"kind": "dev",
"methods": {
"constructor": {
"params": {
"baseRatePerYear": "The approximate target base APR, as a mantissa (scaled by BASE)",
"jumpMultiplierPerYear": "The multiplierPerBlock after hitting a specified utilization point",
"kink_": "The utilization point at which the jump multiplier is applied",
"multiplierPerYear": "The rate of increase in interest rate wrt utilization (scaled by BASE)"
}
},
"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 block as a mantissa (scaled by BASE)"
}
},
"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 block as a mantissa (scaled by BASE)"
}
},
"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 (currently unused)"
},
"returns": {
"_0": "The utilization rate as a mantissa between [0, BASE]"
}
}
},
"title": "Compound's JumpRateModel Contract",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"baseRatePerBlock()": {
"notice": "The base interest rate which is the y-intercept when utilization rate is 0"
},
"blocksPerYear()": {
"notice": "The approximate number of blocks per year that is assumed by the interest rate model"
},
"constructor": {
"notice": "Construct an interest rate model"
},
"getBorrowRate(uint256,uint256,uint256)": {
"notice": "Calculates the current borrow rate per block, with the error code expected by the market"
},
"getSupplyRate(uint256,uint256,uint256,uint256)": {
"notice": "Calculates the current supply rate per block"
},
"isInterestRateModel()": {
"notice": "Indicator that this is an InterestRateModel contract (for inspection)"
},
"jumpMultiplierPerBlock()": {
"notice": "The multiplierPerBlock after hitting a specified utilization point"
},
"kink()": {
"notice": "The utilization point at which the jump multiplier is applied"
},
"multiplierPerBlock()": {
"notice": "The multiplier of utilization rate that gives the slope of the interest rate"
},
"utilizationRate(uint256,uint256,uint256)": {
"notice": "Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`"
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 18986,
"contract": "src/JumpRateModel.sol:JumpRateModel",
"label": "multiplierPerBlock",
"offset": 0,
"slot": "0",
"type": "t_uint256"
},
{
"astId": 18989,
"contract": "src/JumpRateModel.sol:JumpRateModel",
"label": "baseRatePerBlock",
"offset": 0,
"slot": "1",
"type": "t_uint256"
},
{
"astId": 18992,
"contract": "src/JumpRateModel.sol:JumpRateModel",
"label": "jumpMultiplierPerBlock",
"offset": 0,
"slot": "2",
"type": "t_uint256"
},
{
"astId": 18995,
"contract": "src/JumpRateModel.sol:JumpRateModel",
"label": "kink",
"offset": 0,
"slot": "3",
"type": "t_uint256"
}
],
"types": {
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
}
}
}