Interest Rate Strategy
Last updated
Last updated
The InterestRateStrategy
contract manages loan interest rates with theses being dependent on the utilisation of liquidity within the lending pool reserve
function calculateInterestRate(uint256 reserveId, uint256 availableLiquidity, uint256 totalStableDebt, uint256 totalVariableDebt, uint256 averageStableBorrowRate, uint256 reserveFactor)
Calculates the interest rate depending on the reserve's state and configurations.
Parameter Name | Type | Description |
---|---|---|
Parameter Name | Type | Description |
---|---|---|
function calculateInterestRate(uint256 reserveId, address asset, address fToken, uint256 liquidityAdded, uint256 liquidityTaken, uint256 totalStableDebt, uint256 totalVariableDebt, uint256 averageStableBorrowRate, uint256 reserveFactor)
Calculates the interest rate depending on the reserve's state and configurations.
function variableRateSlope1()
Returns slope1
of the variable interest rate.
function variableRateSlope2()
Returns slope2
of the variable interest rate.
function stableRateSlope1()
Returns slope1
of the stable interest rate.
function stableRateSlope2()
Returns slope2
of the stable interest rate.
function baseVariableBorrowRate()
Returns the base variable borrow rate
.
function maxVariableBorrowRate()
Returns the max variable borrow rate
.
{
"abi": [
{
"inputs": [
{
"internalType": "contract IAddressProvider",
"name": "addressprovider_",
"type": "address"
},
{
"internalType": "uint256",
"name": "optimalUtilizationRate_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "baseVariableBorrowRate_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "variableRateSlope1_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "variableRateSlope2_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "stableRateSlope1_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "stableRateSlope2_",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "EXCESS_UTILIZATION_RATE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "OPTIMAL_UTILIZATION_RATE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "addressProvider",
"outputs": [
{
"internalType": "contract IAddressProvider",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "baseVariableBorrowRate",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "reserveId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "availableLiquidity",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "totalStableDebt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "totalVariableDebt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "averageStableBorrowRate",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveFactor",
"type": "uint256"
}
],
"name": "calculateInterestRate",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "reserveId",
"type": "uint256"
},
{
"internalType": "address",
"name": "asset",
"type": "address"
},
{
"internalType": "address",
"name": "fToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "liquidityAdded",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "liquidityTaken",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "totalStableDebt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "totalVariableDebt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "averageStableBorrowRate",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveFactor",
"type": "uint256"
}
],
"name": "calculateInterestRates",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxVariableBorrowRate",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "stableRateSlope1",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "stableRateSlope2",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "variableRateSlope1",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "variableRateSlope2",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"bytecode": {
"object": "0x61018060405234801561001157600080fd5b50604051610dd0380380610dd0833981016040819052610030916100b5565b85608081815250506100608661004e61009060201b6107bc1760201c565b6100a060201b6107cc1790919060201c565b60a0526001600160a01b0390961660c05260e093909352610100919091526101205261014052506101605261013f565b6b033b2e3c9fd0803ce800000090565b60006100ac828461011e565b90505b92915050565b600080600080600080600060e0888a0312156100d057600080fd5b87516001600160a01b03811681146100e757600080fd5b602089015160408a015160608b015160808c015160a08d015160c0909d0151949e939d50919b909a50909850965090945092505050565b818103818111156100af57634e487b7160e01b600052601160045260246000fd5b60805160a05160c05160e05161010051610120516101405161016051610bb76102196000396000818161022d015261059101526000818160b0015281816105c101526106ab0152600081816101530152818161025801526105f20152600081816101790152818161029d0152818161063d01526107150152600081816102070152818161027c0152818161061c015261073b01526000818161010f015261040501526000818160e8015261052b0152600081816101e3015281816104ff0152818161054f0152818161067701526106ef0152610bb76000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80637b832f58116100715780637b832f58146101775780637d8a872d1461019d5780639b9c5b49146101cb578063a15f30ac146101de578063b258954414610205578063ccab01a31461022b57600080fd5b80630bdf953f146100ae57806317319873146100e35780632954018c1461010a578063643d41f21461014957806365614f8114610151575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040519081526020015b60405180910390f35b6100d07f000000000000000000000000000000000000000000000000000000000000000081565b6101317f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100da565b6100d0610251565b7f00000000000000000000000000000000000000000000000000000000000000006100d0565b7f00000000000000000000000000000000000000000000000000000000000000006100d0565b6101b06101ab3660046109be565b6102cc565b604080519384526020840192909252908201526060016100da565b6101b06101d9366004610a36565b61037b565b6100d07f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100d0565b7f00000000000000000000000000000000000000000000000000000000000000006100d0565b60006102c77f00000000000000000000000000000000000000000000000000000000000000006102c17f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006107e1565b906107e1565b905090565b6040516370a0823160e01b81526001600160a01b0388811660048301526000918291829182918d16906370a0823190602401602060405180830381865afa15801561031b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061033f9190610a79565b90506103558961034f838d6107e1565b906107cc565b90506103658d828a8a8a8a61037b565b9350935093505099509950999650505050505050565b60008060006103b26040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b6103bc88886107e1565b808252600060408301819052602083018190526060830152156103f75780516103f2906103ea908b906107e1565b8251906107ed565b6103fa565b60005b8160800181815250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663617e06056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610461573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104859190610a92565b6001600160a01b031663f12c8b358b6040518263ffffffff1660e01b81526004016104b291815260200190565b602060405180830381865afa1580156104cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f39190610a79565b604082015260808101517f0000000000000000000000000000000000000000000000000000000000000000101561066c5760006105877f00000000000000000000000000000000000000000000000000000000000000006105817f000000000000000000000000000000000000000000000000000000000000000085608001516107cc90919063ffffffff16565b906107ed565b90506105e56105b67f00000000000000000000000000000000000000000000000000000000000000008361082f565b60408401516102c1907f00000000000000000000000000000000000000000000000000000000000000006107e1565b60408301526106616106177f00000000000000000000000000000000000000000000000000000000000000008361082f565b6102c17f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006107e1565b602083015250610766565b6106db6106d06106a97f000000000000000000000000000000000000000000000000000000000000000084608001516107ed90919063ffffffff16565b7f00000000000000000000000000000000000000000000000000000000000000009061082f565b6040830151906107e1565b6040820152608081015161076090610739907f000000000000000000000000000000000000000000000000000000000000000090610581907f000000000000000000000000000000000000000000000000000000000000000061082f565b7f0000000000000000000000000000000000000000000000000000000000000000906107e1565b60208201525b610799610775612710876107cc565b610793836080015161078d8c8c87602001518d610865565b9061082f565b906108cd565b606082018190526040820151602090920151909b919a5098509650505050505050565b6b033b2e3c9fd0803ce800000090565b60006107d88284610acc565b90505b92915050565b60006107d88284610adf565b6000806107fb600284610af2565b90506108278361082161081a876b033b2e3c9fd0803ce800000061097e565b84906107e1565b9061098a565b949350505050565b60006107d86b033b2e3c9fd0803ce800000061082161084e868661097e565b6102c160026b033b2e3c9fd0803ce8000000610af2565b60008061087286866107e1565b905080600003610886576000915050610827565b60006108958561078d88610996565b905060006108a68561078d8a610996565b905060006108c06108b685610996565b61058185856107e1565b9998505050505050505050565b60008215806108da575081155b156108e7575060006107db565b816108f56002612710610af2565b61090190600019610acc565b61090b9190610af2565b8311156040518060400160405280600381526020016203230360ec1b815250906109515760405162461bcd60e51b81526004016109489190610b14565b60405180910390fd5b50612710610960600282610af2565b61096a8486610b62565b6109749190610adf565b6107d89190610af2565b60006107d88284610b62565b60006107d88284610af2565b60006107db82633b9aca0061097e565b6001600160a01b03811681146109bb57600080fd5b50565b60008060008060008060008060006101208a8c0312156109dd57600080fd5b8935985060208a01356109ef816109a6565b975060408a01356109ff816109a6565b989b979a5097986060810135985060808101359760a0820135975060c0820135965060e08201359550610100909101359350915050565b60008060008060008060c08789031215610a4f57600080fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b600060208284031215610a8b57600080fd5b5051919050565b600060208284031215610aa457600080fd5b8151610aaf816109a6565b9392505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156107db576107db610ab6565b808201808211156107db576107db610ab6565b600082610b0f57634e487b7160e01b600052601260045260246000fd5b500490565b600060208083528351808285015260005b81811015610b4157858101830151858201604001528201610b25565b506000604082860101526040601f19601f8301168501019250505092915050565b6000816000190483118215151615610b7c57610b7c610ab6565b50029056fea2646970667358221220b9696d36d84199f46617ec26b205bc5caf91a18f7fb7c5e906d3a5ed738abe9964736f6c63430008100033",
"sourceMap": "958:9371:144:-:0;;;2520:751;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;2853:23;2826:50;;;;;;2913:45;2934:23;2913:16;:14;;;;;:16;;:::i;:::-;:20;;;;;;:45;;;;:::i;:::-;2887:71;;-1:-1:-1;;;;;2969:34:144;;;;;3014:49;;;;;3074:41;;;;;3126;;3178:37;;-1:-1:-1;3226:37:144;;958:9371;;641:76:134;524:4;;641:76::o;3122:96:71:-;3180:7;3206:5;3210:1;3206;:5;:::i;:::-;3199:12;;3122:96;;;;;:::o;14:686:176:-;164:6;172;180;188;196;204;212;265:3;253:9;244:7;240:23;236:33;233:53;;;282:1;279;272:12;233:53;308:16;;-1:-1:-1;;;;;353:31:176;;343:42;;333:70;;399:1;396;389:12;333:70;467:2;452:18;;446:25;511:2;496:18;;490:25;555:2;540:18;;534:25;599:3;584:19;;578:26;644:3;629:19;;623:26;689:3;674:19;;;668:26;422:5;;446:25;;-1:-1:-1;490:25:176;;534;;-1:-1:-1;578:26:176;;-1:-1:-1;623:26:176;-1:-1:-1;668:26:176;;-1:-1:-1;14:686:176;-1:-1:-1;;;14:686:176:o;705:225::-;772:9;;;793:11;;;790:134;;;846:10;841:3;837:20;834:1;827:31;881:4;878:1;871:15;909:4;906:1;899:15;705:225;958:9371:144;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
"linkReferences": {}
},
"deployedBytecode": {
"object": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80637b832f58116100715780637b832f58146101775780637d8a872d1461019d5780639b9c5b49146101cb578063a15f30ac146101de578063b258954414610205578063ccab01a31461022b57600080fd5b80630bdf953f146100ae57806317319873146100e35780632954018c1461010a578063643d41f21461014957806365614f8114610151575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040519081526020015b60405180910390f35b6100d07f000000000000000000000000000000000000000000000000000000000000000081565b6101317f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100da565b6100d0610251565b7f00000000000000000000000000000000000000000000000000000000000000006100d0565b7f00000000000000000000000000000000000000000000000000000000000000006100d0565b6101b06101ab3660046109be565b6102cc565b604080519384526020840192909252908201526060016100da565b6101b06101d9366004610a36565b61037b565b6100d07f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100d0565b7f00000000000000000000000000000000000000000000000000000000000000006100d0565b60006102c77f00000000000000000000000000000000000000000000000000000000000000006102c17f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006107e1565b906107e1565b905090565b6040516370a0823160e01b81526001600160a01b0388811660048301526000918291829182918d16906370a0823190602401602060405180830381865afa15801561031b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061033f9190610a79565b90506103558961034f838d6107e1565b906107cc565b90506103658d828a8a8a8a61037b565b9350935093505099509950999650505050505050565b60008060006103b26040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b6103bc88886107e1565b808252600060408301819052602083018190526060830152156103f75780516103f2906103ea908b906107e1565b8251906107ed565b6103fa565b60005b8160800181815250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663617e06056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610461573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104859190610a92565b6001600160a01b031663f12c8b358b6040518263ffffffff1660e01b81526004016104b291815260200190565b602060405180830381865afa1580156104cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f39190610a79565b604082015260808101517f0000000000000000000000000000000000000000000000000000000000000000101561066c5760006105877f00000000000000000000000000000000000000000000000000000000000000006105817f000000000000000000000000000000000000000000000000000000000000000085608001516107cc90919063ffffffff16565b906107ed565b90506105e56105b67f00000000000000000000000000000000000000000000000000000000000000008361082f565b60408401516102c1907f00000000000000000000000000000000000000000000000000000000000000006107e1565b60408301526106616106177f00000000000000000000000000000000000000000000000000000000000000008361082f565b6102c17f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006107e1565b602083015250610766565b6106db6106d06106a97f000000000000000000000000000000000000000000000000000000000000000084608001516107ed90919063ffffffff16565b7f00000000000000000000000000000000000000000000000000000000000000009061082f565b6040830151906107e1565b6040820152608081015161076090610739907f000000000000000000000000000000000000000000000000000000000000000090610581907f000000000000000000000000000000000000000000000000000000000000000061082f565b7f0000000000000000000000000000000000000000000000000000000000000000906107e1565b60208201525b610799610775612710876107cc565b610793836080015161078d8c8c87602001518d610865565b9061082f565b906108cd565b606082018190526040820151602090920151909b919a5098509650505050505050565b6b033b2e3c9fd0803ce800000090565b60006107d88284610acc565b90505b92915050565b60006107d88284610adf565b6000806107fb600284610af2565b90506108278361082161081a876b033b2e3c9fd0803ce800000061097e565b84906107e1565b9061098a565b949350505050565b60006107d86b033b2e3c9fd0803ce800000061082161084e868661097e565b6102c160026b033b2e3c9fd0803ce8000000610af2565b60008061087286866107e1565b905080600003610886576000915050610827565b60006108958561078d88610996565b905060006108a68561078d8a610996565b905060006108c06108b685610996565b61058185856107e1565b9998505050505050505050565b60008215806108da575081155b156108e7575060006107db565b816108f56002612710610af2565b61090190600019610acc565b61090b9190610af2565b8311156040518060400160405280600381526020016203230360ec1b815250906109515760405162461bcd60e51b81526004016109489190610b14565b60405180910390fd5b50612710610960600282610af2565b61096a8486610b62565b6109749190610adf565b6107d89190610af2565b60006107d88284610b62565b60006107d88284610af2565b60006107db82633b9aca0061097e565b6001600160a01b03811681146109bb57600080fd5b50565b60008060008060008060008060006101208a8c0312156109dd57600080fd5b8935985060208a01356109ef816109a6565b975060408a01356109ff816109a6565b989b979a5097986060810135985060808101359760a0820135975060c0820135965060e08201359550610100909101359350915050565b60008060008060008060c08789031215610a4f57600080fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b600060208284031215610a8b57600080fd5b5051919050565b600060208284031215610aa457600080fd5b8151610aaf816109a6565b9392505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156107db576107db610ab6565b808201808211156107db576107db610ab6565b600082610b0f57634e487b7160e01b600052601260045260246000fd5b500490565b600060208083528351808285015260005b81811015610b4157858101830151858201604001528201610b25565b506000604082860101526040601f19601f8301168501019250505092915050565b6000816000190483118215151615610b7c57610b7c610ab6565b50029056fea2646970667358221220b9696d36d84199f46617ec26b205bc5caf91a18f7fb7c5e906d3a5ed738abe9964736f6c63430008100033",
"sourceMap": "958:9371:144:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3509:103;3587:17;3509:103;;;160:25:176;;;148:2;133:18;3509:103:144;;;;;;;;1590:48;;;;;1647:49;;;;;;;;-1:-1:-1;;;;;386:32:176;;;368:51;;356:2;341:18;1647:49:144;196:229:176;3863:173:144;;;:::i;3394:107::-;3474:19;3394:107;;3279;3359:19;3279:107;;4772:925;;;;;;:::i;:::-;;:::i;:::-;;;;1643:25:176;;;1699:2;1684:18;;1677:34;;;;1727:18;;;1720:34;1631:2;1616:18;4772:925:144;1441:319:176;6603:2429:144;;;;;;:::i;:::-;;:::i;1296:49::-;;;;;3731:124;3824:23;3731:124;;3620:103;3698:17;3620:103;;3863:173;3928:7;3955:73;4008:19;3955:48;:23;3983:19;3955:27;:48::i;:::-;:52;;:73::i;:::-;3948:80;;3863:173;:::o;4772:925::-;5288:42;;-1:-1:-1;;;5288:42:144;;-1:-1:-1;;;;;386:32:176;;;5288:42:144;;;368:51:176;5180:7:144;;;;;;;;5288:34;;;;;341:18:176;;5288:42:144;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5259:71;-1:-1:-1;5394:58:144;5437:14;5394:38;5259:71;5417:14;5394:22;:38::i;:::-;:42;;:58::i;:::-;5373:79;;5472:217;5508:9;5532:18;5565:15;5595:17;5627:23;5665:13;5472:21;:217::i;:::-;5465:224;;;;;;;4772:925;;;;;;;;;;;;;:::o;6603:2429::-;6930:7;6952;6974;7009:38;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7009:38:144;7077;:15;7097:17;7077:19;:38::i;:::-;7060:55;;;:14;7126:28;;;:32;;;7169:30;;;:34;;;7214:25;;;:29;7279:19;:115;;7378:14;;7333:61;;7355:38;;:18;;:22;:38::i;:::-;7333:14;;;:21;:61::i;:::-;7279:115;;;7315:1;7279:115;7256:4;:20;;:138;;;;;7458:15;-1:-1:-1;;;;;7458:37:144;;:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;7438:94:144;;7533:9;7438:105;;;;;;;;;;;;;160:25:176;;148:2;133:18;;14:177;7438:105:144;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;7407:28;;;:136;7560:20;;;;7583:24;-1:-1:-1;7556:979:144;;;7624:34;7661:82;7719:23;7661:50;7686:24;7661:4;:20;;;:24;;:50;;;;:::i;:::-;:57;;:82::i;:::-;7624:119;-1:-1:-1;7791:141:144;7865:52;:17;7624:119;7865:24;:52::i;:::-;7791:28;;;;:51;;7824:17;7791:32;:51::i;:141::-;7760:28;;;:172;7982:140;8053:54;:19;8080:26;8053;:54::i;:::-;7982:48;:23;8010:19;7982:27;:48::i;:140::-;7949:30;;;:173;-1:-1:-1;7556:979:144;;;8186:145;8237:79;8262:53;8290:24;8262:4;:20;;;:27;;:53;;;;:::i;:::-;8237:17;;:24;:79::i;:::-;8186:28;;;;;:32;:145::i;:::-;8155:28;;;:176;8427:20;;;;8381:142;;8427:81;;8483:24;;8427:48;;8455:19;8427:27;:48::i;:81::-;8381:23;;:27;:142::i;:::-;8348:30;;;:175;7556:979;8575:290;8813:51;470:3:133;8850:13:144;8813:36;:51::i;:::-;8575:216;8770:4;:20;;;8575:177;8611:15;8641:17;8673:4;:30;;;8718:23;8575:21;:177::i;:::-;:194;;:216::i;:::-;:237;;:290::i;:::-;8547:25;;;:318;;;8940:28;;;;8983:30;;;;;8547:318;;8940:28;;-1:-1:-1;8983:30:144;-1:-1:-1;6603:2429:144;-1:-1:-1;;;;;;;6603:2429:144:o;641:76:134:-;524:4;;641:76::o;3122:96:71:-;3180:7;3206:5;3210:1;3206;:5;:::i;:::-;3199:12;;3122:96;;;;;:::o;2755:::-;2813:7;2839:5;2843:1;2839;:5;:::i;1425:158:134:-;1486:7;;1522:5;1526:1;1522;:5;:::i;:::-;1506:21;-1:-1:-1;1547:28:134;1573:1;1547:21;1557:10;:1;524:4;1557:5;:10::i;:::-;1547:5;;:9;:21::i;:::-;:25;;:28::i;:::-;1540:35;1425:158;-1:-1:-1;;;;1425:158:134:o;1291:126::-;1352:7;1379:30;524:4;1379:21;1391:8;:1;1397;1391:5;:8::i;:::-;571:7;577:1;524:4;571:7;:::i;9597:729:144:-;9821:7;;9861:38;:15;9881:17;9861:19;:38::i;:::-;9841:58;;9916:9;9929:1;9916:14;9912:28;;9939:1;9932:8;;;;;9912:28;9953;9984:62;10020:25;9984:28;:17;:26;:28::i;:62::-;9953:93;;10059:26;10088:65;10122:30;10088:26;:15;:24;:26::i;:65::-;10059:94;;10166:25;10208:73;10260:20;:9;:18;:20::i;:::-;10208:44;:20;10233:18;10208:24;:44::i;:73::-;10166:115;9597:729;-1:-1:-1;;;;;;;;;9597:729:144:o;1026:333:133:-;1104:7;1123:10;;;:29;;-1:-1:-1;1137:15:133;;1123:29;1119:58;;;-1:-1:-1;1169:1:133;1162:8;;1119:58;1237:10;540:21;560:1;470:3;540:21;:::i;:::-;1201:32;;-1:-1:-1;;1201:32:133;:::i;:::-;1200:47;;;;:::i;:::-;1191:5;:56;;1249:35;;;;;;;;;;;;;-1:-1:-1;;;1249:35:133;;;1183:102;;;;;-1:-1:-1;;;1183:102:133;;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;470:3:133;540:21;560:1;470:3;540:21;:::i;:::-;1300:18;1308:10;1300:5;:18;:::i;:::-;:33;;;;:::i;:::-;1299:55;;;;:::i;3465:96:71:-;3523:7;3549:5;3553:1;3549;:5;:::i;3850:96::-;3908:7;3934:5;3938:1;3934;:5;:::i;1771:107:134:-;1823:7;1850:20;:1;629:3;1850:5;:20::i;430:131:176:-;-1:-1:-1;;;;;505:31:176;;495:42;;485:70;;551:1;548;541:12;485:70;430:131;:::o;566:870::-;697:6;705;713;721;729;737;745;753;761;814:3;802:9;793:7;789:23;785:33;782:53;;;831:1;828;821:12;782:53;867:9;854:23;844:33;;927:2;916:9;912:18;899:32;940:31;965:5;940:31;:::i;:::-;990:5;-1:-1:-1;1047:2:176;1032:18;;1019:32;1060:33;1019:32;1060:33;:::i;:::-;566:870;;;;-1:-1:-1;1112:7:176;;1166:2;1151:18;;1138:32;;-1:-1:-1;1217:3:176;1202:19;;1189:33;;1269:3;1254:19;;1241:33;;-1:-1:-1;1321:3:176;1306:19;;1293:33;;-1:-1:-1;1373:3:176;1358:19;;1345:33;;-1:-1:-1;1425:3:176;1410:19;;;1397:33;;-1:-1:-1;566:870:176;-1:-1:-1;;566:870:176:o;1765:523::-;1869:6;1877;1885;1893;1901;1909;1962:3;1950:9;1941:7;1937:23;1933:33;1930:53;;;1979:1;1976;1969:12;1930:53;-1:-1:-1;;2002:23:176;;;2072:2;2057:18;;2044:32;;-1:-1:-1;2123:2:176;2108:18;;2095:32;;2174:2;2159:18;;2146:32;;-1:-1:-1;2225:3:176;2210:19;;2197:33;;-1:-1:-1;2277:3:176;2262:19;2249:33;;-1:-1:-1;1765:523:176;-1:-1:-1;1765:523:176:o;2501:184::-;2571:6;2624:2;2612:9;2603:7;2599:23;2595:32;2592:52;;;2640:1;2637;2630:12;2592:52;-1:-1:-1;2663:16:176;;2501:184;-1:-1:-1;2501:184:176:o;2690:251::-;2760:6;2813:2;2801:9;2792:7;2788:23;2784:32;2781:52;;;2829:1;2826;2819:12;2781:52;2861:9;2855:16;2880:31;2905:5;2880:31;:::i;:::-;2930:5;2690:251;-1:-1:-1;;;2690:251:176:o;2946:127::-;3007:10;3002:3;2998:20;2995:1;2988:31;3038:4;3035:1;3028:15;3062:4;3059:1;3052:15;3078:128;3145:9;;;3166:11;;;3163:37;;;3180:18;;:::i;3211:125::-;3276:9;;;3297:10;;;3294:36;;;3310:18;;:::i;3341:217::-;3381:1;3407;3397:132;;3451:10;3446:3;3442:20;3439:1;3432:31;3486:4;3483:1;3476:15;3514:4;3511:1;3504:15;3397:132;-1:-1:-1;3543:9:176;;3341:217::o;3563:548::-;3675:4;3704:2;3733;3722:9;3715:21;3765:6;3759:13;3808:6;3803:2;3792:9;3788:18;3781:34;3833:1;3843:140;3857:6;3854:1;3851:13;3843:140;;;3952:14;;;3948:23;;3942:30;3918:17;;;3937:2;3914:26;3907:66;3872:10;;3843:140;;;3847:3;4032:1;4027:2;4018:6;4007:9;4003:22;3999:31;3992:42;4102:2;4095;4091:7;4086:2;4078:6;4074:15;4070:29;4059:9;4055:45;4051:54;4043:62;;;;3563:548;;;;:::o;4116:168::-;4156:7;4222:1;4218;4214:6;4210:14;4207:1;4204:21;4199:1;4192:9;4185:17;4181:45;4178:71;;;4229:18;;:::i;:::-;-1:-1:-1;4269:9:176;;4116:168::o",
"linkReferences": {},
"immutableReferences": {
"67153": [
{
"start": 483,
"length": 32
},
{
"start": 1279,
"length": 32
},
{
"start": 1359,
"length": 32
},
{
"start": 1655,
"length": 32
},
{
"start": 1775,
"length": 32
}
],
"67156": [
{
"start": 232,
"length": 32
},
{
"start": 1323,
"length": 32
}
],
"67159": [
{
"start": 271,
"length": 32
},
{
"start": 1029,
"length": 32
}
],
"67161": [
{
"start": 519,
"length": 32
},
{
"start": 636,
"length": 32
},
{
"start": 1564,
"length": 32
},
{
"start": 1851,
"length": 32
}
],
"67163": [
{
"start": 377,
"length": 32
},
{
"start": 669,
"length": 32
},
{
"start": 1597,
"length": 32
},
{
"start": 1813,
"length": 32
}
],
"67165": [
{
"start": 339,
"length": 32
},
{
"start": 600,
"length": 32
},
{
"start": 1522,
"length": 32
}
],
"67167": [
{
"start": 176,
"length": 32
},
{
"start": 1473,
"length": 32
},
{
"start": 1707,
"length": 32
}
],
"67169": [
{
"start": 557,
"length": 32
},
{
"start": 1425,
"length": 32
}
]
}
},
"methodIdentifiers": {
"EXCESS_UTILIZATION_RATE()": "17319873",
"OPTIMAL_UTILIZATION_RATE()": "a15f30ac",
"addressProvider()": "2954018c",
"baseVariableBorrowRate()": "b2589544",
"calculateInterestRate(uint256,uint256,uint256,uint256,uint256,uint256)": "9b9c5b49",
"calculateInterestRates(uint256,address,address,uint256,uint256,uint256,uint256,uint256,uint256)": "7d8a872d",
"maxVariableBorrowRate()": "643d41f2",
"stableRateSlope1()": "0bdf953f",
"stableRateSlope2()": "ccab01a3",
"variableRateSlope1()": "7b832f58",
"variableRateSlope2()": "65614f81"
},
"rawMetadata": "{\"compiler\":{\"version\":\"0.8.16+commit.07a7930e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IAddressProvider\",\"name\":\"addressprovider_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"optimalUtilizationRate_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseVariableBorrowRate_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"variableRateSlope1_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"variableRateSlope2_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stableRateSlope1_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stableRateSlope2_\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"EXCESS_UTILIZATION_RATE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"OPTIMAL_UTILIZATION_RATE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"addressProvider\",\"outputs\":[{\"internalType\":\"contract IAddressProvider\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseVariableBorrowRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"reserveId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"availableLiquidity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalStableDebt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalVariableDebt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"averageStableBorrowRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveFactor\",\"type\":\"uint256\"}],\"name\":\"calculateInterestRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"reserveId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"fToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"liquidityAdded\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"liquidityTaken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalStableDebt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalVariableDebt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"averageStableBorrowRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveFactor\",\"type\":\"uint256\"}],\"name\":\"calculateInterestRates\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxVariableBorrowRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"stableRateSlope1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"stableRateSlope2\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"variableRateSlope1\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"variableRateSlope2\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"FluidNFT*\",\"details\":\"The model of interest rate is based on 2 slopes, one before the `OPTIMAL_UTILIZATION_RATE` point of utilization and another from that one to 100%\",\"kind\":\"dev\",\"methods\":{\"calculateInterestRate(uint256,uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Calculates the interest rates depending on the asset reserve's state and configurations.\",\"params\":{\"availableLiquidity\":\"The liquidity available in the corresponding fToken\",\"averageStableBorrowRate\":\"The weighted average of all the stable rate loans\",\"reserveFactor\":\"The reserve portion of the interest that goes to the treasury of the market\",\"totalStableDebt\":\"The total borrowed from the reserve at a stable rate\",\"totalVariableDebt\":\"The total borrowed from the reserve at a variable rate\"},\"returns\":{\"_0\":\"The liquidity rate, the stable borrow rate and the variable borrow rate*\"}},\"calculateInterestRates(uint256,address,address,uint256,uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"Calculates the interest rates depending on the reserve's state and configurations\",\"params\":{\"asset\":\"The address of the reserve asset\",\"fToken\":\"The address of the reserve fToken\",\"liquidityAdded\":\"The liquidity added during the operation\",\"liquidityTaken\":\"The liquidity taken during the operation\",\"reserveFactor\":\"The reserve portion of the interest that goes to the treasury of the market\",\"totalStableDebt\":\"The total borrowed from the reserve a stable rate\",\"totalVariableDebt\":\"The total borrowed from the reserve at a variable rate\"},\"returns\":{\"_0\":\"The liquidity rate, the stable borrow rate and the variable borrow rate*\"}}},\"stateVariables\":{\"EXCESS_UTILIZATION_RATE\":{\"details\":\"This constant represents the excess utilization rate above the optimal. It's always equal to 1-optimal utilization rate. Added as a constant here for gas optimizations. Expressed in ray*\"},\"OPTIMAL_UTILIZATION_RATE\":{\"details\":\"this constant represents the utilization rate at which the pool aims to obtain most competitive borrow rates. Expressed in ray*\"}},\"title\":\"InterestRateStrategy contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Implfements the calculation of the interest rates depending on the reserve state\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/protocol/risk/InterestRateStrategy.sol\":\"InterestRateStrategy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@chainlink/=lib/chainlink/\",\":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\",\":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/\",\":chainlink/=lib/chainlink/integration-tests/contracts/ethereum/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\"]},\"sources\":{\"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/IERC20Upgradeable.sol\":{\"keccak256\":\"0x4e733d3164f73f461eaf9d8087a7ad1ea180bdc8ba0d3d61b0e1ae16d8e63dff\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://75b47c3aeca7b66ea6752f8be020ec5c1c502de6ec9065272dae23d3a52196e2\",\"dweb:/ipfs/QmUebPMHv16tYKFh5BmBQkMfRFb5b8UZ2RgVwdjxCeufVF\"]},\"lib/openzeppelin-contracts/contracts/utils/math/SafeMath.sol\":{\"keccak256\":\"0x0f633a0223d9a1dcccfcf38a64c9de0874dfcbfac0c6941ccf074d63a2ce0e1e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://864a40efcffdf408044c332a5aa38ec5618ed7b4eecb8f65faf45671bd6cdc65\",\"dweb:/ipfs/QmQJquTMtc6fgm5JQzGdsGpA2fqBe3MHWEdt2qzaLySMdN\"]},\"src/interfaces/IAddressProvider.sol\":{\"keccak256\":\"0x6730abfcd8770e3279dad6137bf619ab98ee8b049e6dd85d2fbe87ba6224fde8\",\"license\":\"AGPL-3.0\",\"urls\":[\"bzz-raw://9b7d1588eab025b049f858ab2f329be7fec220198d956b9b61bf0b9bddc5761a\",\"dweb:/ipfs/QmTaFkYSUfWmbpsyE2TKC1QvP6eTDggZ72ZWodBhydqt5X\"]},\"src/interfaces/IInterestRateStrategy.sol\":{\"keccak256\":\"0x71f8b91324433fbdb16a38e5b7c214e7c30094167a7aaf77fcb045194a63af16\",\"license\":\"AGPL-3.0\",\"urls\":[\"bzz-raw://ce7a18b9c191a676ab68f5d59449c22bead494ccba0c2272e6c8bd606a1c0fd3\",\"dweb:/ipfs/QmZ4byVDnoAH67dSSXppkhTbvdNs7mmQadUnmreoeZVbSv\"]},\"src/interfaces/ILendingRateManager.sol\":{\"keccak256\":\"0x6078c32591ae3ced86c344ad2f228fbcc625f09cd59a8f7014355adb89dfcde0\",\"license\":\"AGPL-3.0\",\"urls\":[\"bzz-raw://fa594c0ceb1a0a085a6b077ac0729663f839f33f760eb8775ff1b3d25415e097\",\"dweb:/ipfs/QmXU74R73UDHiwvVaU9LRrC1tHaDq5eCerenKQtFX97UL6\"]},\"src/protocol/libraries/helpers/Errors.sol\":{\"keccak256\":\"0x490e76871922e89a13ba0bb88977be18c143fa9d0cd9afb033744a3d81479c52\",\"license\":\"AGPL-3.0\",\"urls\":[\"bzz-raw://1c409d4d1e1689d8d8f3c3e361198d20f3b6476608c5316d8e2d91f52373e8e3\",\"dweb:/ipfs/QmRZaYpxqjmBpbxb51KqswKYPSeCsU3ejbmk5E3MrMxJaM\"]},\"src/protocol/libraries/math/PercentageMath.sol\":{\"keccak256\":\"0xb84274fc3effba81036256cf7fde67b3dbfe86c4ffd0e062711a3270157952a2\",\"license\":\"AGPL-3.0\",\"urls\":[\"bzz-raw://3ecaf26e713b39d89ee21fb8bfefe55fe2fec4a2f5a2bffba7612f82182b7262\",\"dweb:/ipfs/QmZ6oXpNspwBEkiJEz1EhsU4EVBpG3anNjtzcycNEgAkfe\"]},\"src/protocol/libraries/math/WadRayMath.sol\":{\"keccak256\":\"0xb29e8edc0e0e6bfead27945357c9e4a66e0c11e58ff3b87ee68ed1b5ca416735\",\"license\":\"AGPL-3.0\",\"urls\":[\"bzz-raw://d1b4377995155f32bb6c3ba558875c617fa63601c597099d3460063ac2a15d93\",\"dweb:/ipfs/QmUvCE6Q2J62sMgQCCEbQauWSYJpMiu3QCgWa6mZnEmcK2\"]},\"src/protocol/risk/InterestRateStrategy.sol\":{\"keccak256\":\"0x15b2793f86d490b8d366e510d5a5c36f01450caf00bc748f1481a82ed02f7a0d\",\"license\":\"AGPL-3.0\",\"urls\":[\"bzz-raw://cbaedb9dd3f31336ec1c37844f19815a7d5c54bf271bbdaaea259f68ebfaf046\",\"dweb:/ipfs/QmUdVBDHqzL5AoNRMZxDyfAshSM315qgtrX4DBwidA8TdS\"]}},\"version\":1}",
"metadata": {
"compiler": {
"version": "0.8.16+commit.07a7930e"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "contract IAddressProvider",
"name": "addressprovider_",
"type": "address"
},
{
"internalType": "uint256",
"name": "optimalUtilizationRate_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "baseVariableBorrowRate_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "variableRateSlope1_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "variableRateSlope2_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "stableRateSlope1_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "stableRateSlope2_",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"stateMutability": "view",
"type": "function",
"name": "EXCESS_UTILIZATION_RATE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
},
{
"inputs": [],
"stateMutability": "view",
"type": "function",
"name": "OPTIMAL_UTILIZATION_RATE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
},
{
"inputs": [],
"stateMutability": "view",
"type": "function",
"name": "addressProvider",
"outputs": [
{
"internalType": "contract IAddressProvider",
"name": "",
"type": "address"
}
]
},
{
"inputs": [],
"stateMutability": "view",
"type": "function",
"name": "baseVariableBorrowRate",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
},
{
"inputs": [
{
"internalType": "uint256",
"name": "reserveId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "availableLiquidity",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "totalStableDebt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "totalVariableDebt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "averageStableBorrowRate",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveFactor",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function",
"name": "calculateInterestRate",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
},
{
"inputs": [
{
"internalType": "uint256",
"name": "reserveId",
"type": "uint256"
},
{
"internalType": "address",
"name": "asset",
"type": "address"
},
{
"internalType": "address",
"name": "fToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "liquidityAdded",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "liquidityTaken",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "totalStableDebt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "totalVariableDebt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "averageStableBorrowRate",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserveFactor",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function",
"name": "calculateInterestRates",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
},
{
"inputs": [],
"stateMutability": "view",
"type": "function",
"name": "maxVariableBorrowRate",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
},
{
"inputs": [],
"stateMutability": "view",
"type": "function",
"name": "stableRateSlope1",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
},
{
"inputs": [],
"stateMutability": "view",
"type": "function",
"name": "stableRateSlope2",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
},
{
"inputs": [],
"stateMutability": "view",
"type": "function",
"name": "variableRateSlope1",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
},
{
"inputs": [],
"stateMutability": "view",
"type": "function",
"name": "variableRateSlope2",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
}
],
"devdoc": {
"kind": "dev",
"methods": {
"calculateInterestRate(uint256,uint256,uint256,uint256,uint256,uint256)": {
"details": "Calculates the interest rates depending on the asset reserve's state and configurations.",
"params": {
"availableLiquidity": "The liquidity available in the corresponding fToken",
"averageStableBorrowRate": "The weighted average of all the stable rate loans",
"reserveFactor": "The reserve portion of the interest that goes to the treasury of the market",
"totalStableDebt": "The total borrowed from the reserve at a stable rate",
"totalVariableDebt": "The total borrowed from the reserve at a variable rate"
},
"returns": {
"_0": "The liquidity rate, the stable borrow rate and the variable borrow rate*"
}
},
"calculateInterestRates(uint256,address,address,uint256,uint256,uint256,uint256,uint256,uint256)": {
"details": "Calculates the interest rates depending on the reserve's state and configurations",
"params": {
"asset": "The address of the reserve asset",
"fToken": "The address of the reserve fToken",
"liquidityAdded": "The liquidity added during the operation",
"liquidityTaken": "The liquidity taken during the operation",
"reserveFactor": "The reserve portion of the interest that goes to the treasury of the market",
"totalStableDebt": "The total borrowed from the reserve a stable rate",
"totalVariableDebt": "The total borrowed from the reserve at a variable rate"
},
"returns": {
"_0": "The liquidity rate, the stable borrow rate and the variable borrow rate*"
}
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"remappings": [
":@chainlink/=lib/chainlink/",
":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
":chainlink/=lib/chainlink/integration-tests/contracts/ethereum/src/",
":ds-test/=lib/forge-std/lib/ds-test/src/",
":forge-std/=lib/forge-std/src/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"bytecodeHash": "ipfs"
},
"compilationTarget": {
"src/protocol/risk/InterestRateStrategy.sol": "InterestRateStrategy"
},
"libraries": {}
},
"sources": {
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/IERC20Upgradeable.sol": {
"keccak256": "0x4e733d3164f73f461eaf9d8087a7ad1ea180bdc8ba0d3d61b0e1ae16d8e63dff",
"urls": [
"bzz-raw://75b47c3aeca7b66ea6752f8be020ec5c1c502de6ec9065272dae23d3a52196e2",
"dweb:/ipfs/QmUebPMHv16tYKFh5BmBQkMfRFb5b8UZ2RgVwdjxCeufVF"
],
"license": "MIT"
},
"lib/openzeppelin-contracts/contracts/utils/math/SafeMath.sol": {
"keccak256": "0x0f633a0223d9a1dcccfcf38a64c9de0874dfcbfac0c6941ccf074d63a2ce0e1e",
"urls": [
"bzz-raw://864a40efcffdf408044c332a5aa38ec5618ed7b4eecb8f65faf45671bd6cdc65",
"dweb:/ipfs/QmQJquTMtc6fgm5JQzGdsGpA2fqBe3MHWEdt2qzaLySMdN"
],
"license": "MIT"
},
"src/interfaces/IAddressProvider.sol": {
"keccak256": "0x6730abfcd8770e3279dad6137bf619ab98ee8b049e6dd85d2fbe87ba6224fde8",
"urls": [
"bzz-raw://9b7d1588eab025b049f858ab2f329be7fec220198d956b9b61bf0b9bddc5761a",
"dweb:/ipfs/QmTaFkYSUfWmbpsyE2TKC1QvP6eTDggZ72ZWodBhydqt5X"
],
"license": "AGPL-3.0"
},
"src/interfaces/IInterestRateStrategy.sol": {
"keccak256": "0x71f8b91324433fbdb16a38e5b7c214e7c30094167a7aaf77fcb045194a63af16",
"urls": [
"bzz-raw://ce7a18b9c191a676ab68f5d59449c22bead494ccba0c2272e6c8bd606a1c0fd3",
"dweb:/ipfs/QmZ4byVDnoAH67dSSXppkhTbvdNs7mmQadUnmreoeZVbSv"
],
"license": "AGPL-3.0"
},
"src/interfaces/ILendingRateManager.sol": {
"keccak256": "0x6078c32591ae3ced86c344ad2f228fbcc625f09cd59a8f7014355adb89dfcde0",
"urls": [
"bzz-raw://fa594c0ceb1a0a085a6b077ac0729663f839f33f760eb8775ff1b3d25415e097",
"dweb:/ipfs/QmXU74R73UDHiwvVaU9LRrC1tHaDq5eCerenKQtFX97UL6"
],
"license": "AGPL-3.0"
},
"src/protocol/libraries/helpers/Errors.sol": {
"keccak256": "0x490e76871922e89a13ba0bb88977be18c143fa9d0cd9afb033744a3d81479c52",
"urls": [
"bzz-raw://1c409d4d1e1689d8d8f3c3e361198d20f3b6476608c5316d8e2d91f52373e8e3",
"dweb:/ipfs/QmRZaYpxqjmBpbxb51KqswKYPSeCsU3ejbmk5E3MrMxJaM"
],
"license": "AGPL-3.0"
},
"src/protocol/libraries/math/PercentageMath.sol": {
"keccak256": "0xb84274fc3effba81036256cf7fde67b3dbfe86c4ffd0e062711a3270157952a2",
"urls": [
"bzz-raw://3ecaf26e713b39d89ee21fb8bfefe55fe2fec4a2f5a2bffba7612f82182b7262",
"dweb:/ipfs/QmZ6oXpNspwBEkiJEz1EhsU4EVBpG3anNjtzcycNEgAkfe"
],
"license": "AGPL-3.0"
},
"src/protocol/libraries/math/WadRayMath.sol": {
"keccak256": "0xb29e8edc0e0e6bfead27945357c9e4a66e0c11e58ff3b87ee68ed1b5ca416735",
"urls": [
"bzz-raw://d1b4377995155f32bb6c3ba558875c617fa63601c597099d3460063ac2a15d93",
"dweb:/ipfs/QmUvCE6Q2J62sMgQCCEbQauWSYJpMiu3QCgWa6mZnEmcK2"
],
"license": "AGPL-3.0"
},
"src/protocol/risk/InterestRateStrategy.sol": {
"keccak256": "0x15b2793f86d490b8d366e510d5a5c36f01450caf00bc748f1481a82ed02f7a0d",
"urls": [
"bzz-raw://cbaedb9dd3f31336ec1c37844f19815a7d5c54bf271bbdaaea259f68ebfaf046",
"dweb:/ipfs/QmUdVBDHqzL5AoNRMZxDyfAshSM315qgtrX4DBwidA8TdS"
],
"license": "AGPL-3.0"
}
},
"version": 1
},
"ast": {
"absolutePath": "src/protocol/risk/InterestRateStrategy.sol",
"id": 67613,
"exportedSymbols": {
"IAddressProvider": [
45718
],
"IERC20Upgradeable": [
27189
],
"IInterestRateStrategy": [
46846
],
"ILendingRateManager": [
47434
],
"InterestRateStrategy": [
67612
],
"PercentageMath": [
62719
],
"SafeMath": [
36719
],
"WadRayMath": [
62965
]
},
"nodeType": "SourceUnit",
"src": "38:10291:144",
"nodes": [
{
"id": 67124,
"nodeType": "PragmaDirective",
"src": "38:23:144",
"nodes": [],
"literals": [
"solidity",
"0.8",
".16"
]
},
{
"id": 67126,
"nodeType": "ImportDirective",
"src": "65:83:144",
"nodes": [],
"absolutePath": "src/interfaces/IInterestRateStrategy.sol",
"file": "../../interfaces/IInterestRateStrategy.sol",
"nameLocation": "-1:-1:-1",
"scope": 67613,
"sourceUnit": 46847,
"symbolAliases": [
{
"foreign": {
"id": 67125,
"name": "IInterestRateStrategy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 46846,
"src": "74:21:144",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"id": 67128,
"nodeType": "ImportDirective",
"src": "150:79:144",
"nodes": [],
"absolutePath": "src/interfaces/ILendingRateManager.sol",
"file": "../../interfaces/ILendingRateManager.sol",
"nameLocation": "-1:-1:-1",
"scope": 67613,
"sourceUnit": 47435,
"symbolAliases": [
{
"foreign": {
"id": 67127,
"name": "ILendingRateManager",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 47434,
"src": "159:19:144",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"id": 67130,
"nodeType": "ImportDirective",
"src": "231:73:144",
"nodes": [],
"absolutePath": "src/interfaces/IAddressProvider.sol",
"file": "../../interfaces/IAddressProvider.sol",
"nameLocation": "-1:-1:-1",
"scope": 67613,
"sourceUnit": 45719,
"symbolAliases": [
{
"foreign": {
"id": 67129,
"name": "IAddressProvider",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 45718,
"src": "240:16:144",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"id": 67132,
"nodeType": "ImportDirective",
"src": "308:70:144",
"nodes": [],
"absolutePath": "src/protocol/libraries/math/PercentageMath.sol",
"file": "../libraries/math/PercentageMath.sol",
"nameLocation": "-1:-1:-1",
"scope": 67613,
"sourceUnit": 62720,
"symbolAliases": [
{
"foreign": {
"id": 67131,
"name": "PercentageMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 62719,
"src": "317:14:144",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"id": 67134,
"nodeType": "ImportDirective",
"src": "380:62:144",
"nodes": [],
"absolutePath": "src/protocol/libraries/math/WadRayMath.sol",
"file": "../libraries/math/WadRayMath.sol",
"nameLocation": "-1:-1:-1",
"scope": 67613,
"sourceUnit": 62966,
"symbolAliases": [
{
"foreign": {
"id": 67133,
"name": "WadRayMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 62965,
"src": "389:10:144",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"id": 67136,
"nodeType": "ImportDirective",
"src": "446:106:144",
"nodes": [],
"absolutePath": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/IERC20Upgradeable.sol",
"file": "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol",
"nameLocation": "-1:-1:-1",
"scope": 67613,
"sourceUnit": 27190,
"symbolAliases": [
{
"foreign": {
"id": 67135,
"name": "IERC20Upgradeable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27189,
"src": "455:17:144",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"id": 67138,
"nodeType": "ImportDirective",
"src": "554:75:144",
"nodes": [],
"absolutePath": "lib/openzeppelin-contracts/contracts/utils/math/SafeMath.sol",
"file": "@openzeppelin/contracts/utils/math/SafeMath.sol",
"nameLocation": "-1:-1:-1",
"scope": 67613,
"sourceUnit": 36720,
"symbolAliases": [
{
"foreign": {
"id": 67137,
"name": "SafeMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 36719,
"src": "563:8:144",