Lending Rate Manager

The LendingRateManager contract is used to manage fixed-term loan stable borrow rates and loan-to-value ratios for given loan durations.

Methods

setMarketBorrowRate()

function setMarketBorrowRate(uint256 reserveId, uint256 rate)

Sets the fixed-term stable borrow rate for a given reserve.

Parameter NameTypeDescription

reserveId

uint256

id of the target reserve

rate

uint256

interest rate APR in ray

setMarketDurationLoanToValue()

function setMarketDurationLoanToValue(uint256 reserveId, uint256 duration, uint256 ltv)

Sets the LTV for a given reserve, for a given duration.

Parameter NameTypeDescription

reserveId

uint256

id of the target reserve

duration

uint256

duration of the loan

ltv

uint256

loan-to-value percentage in 1e4, e.g. 1000 == 10%

View Methods

getMarketBorrowRate()

function getMarketBorrowRate(uint256 reserveId)

Gets the fixed-term stable borrow rate for a given reserve.

Parameter NameTypeDescription

reserveId

uint256

id of the target reserve

Returns

Parameter NameTypeDescription

rate

uint256

interest rate APR in ray

getMarketDurationLoanToValue()

function vetMarketDurationLoanToValue(uint256 reserveId, uint256 duration)

Gets the LTV for a given reserve, for a given duration.

Parameter NameTypeDescription

reserveId

uint256

id of the target reserve

duration

uint256

duration of the loan

Returns

Parameter NameTypeDescription

ltv

uint256

loan-to-value percentage in 1e4, e.g. 1000 == 10%

ABI

Lending Rate Manager ABI
{
  "abi": [
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "reserveId",
          "type": "uint256"
        }
      ],
      "name": "getMarketBorrowRate",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "_reserveId",
          "type": "uint256"
        },
        {
          "internalType": "uint256",
          "name": "_duration",
          "type": "uint256"
        }
      ],
      "name": "getMarketDurationLoanToValue",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "reserveId",
          "type": "uint256"
        },
        {
          "internalType": "uint256",
          "name": "rate",
          "type": "uint256"
        }
      ],
      "name": "setMarketBorrowRate",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "_reserveId",
          "type": "uint256"
        },
        {
          "internalType": "uint256",
          "name": "_duration",
          "type": "uint256"
        },
        {
          "internalType": "uint256",
          "name": "_ltv",
          "type": "uint256"
        }
      ],
      "name": "setMarketDurationLoanToValue",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    }
  ],
  "bytecode": {
    "object": "0x",
    "sourceMap": "",
    "linkReferences": {}
  },
  "deployedBytecode": {
    "object": "0x",
    "sourceMap": "",
    "linkReferences": {}
  },
  "methodIdentifiers": {
    "getMarketBorrowRate(uint256)": "f12c8b35",
    "getMarketDurationLoanToValue(uint256,uint256)": "2ee1bbb0",
    "setMarketBorrowRate(uint256,uint256)": "7dc492d1",
    "setMarketDurationLoanToValue(uint256,uint256,uint256)": "2d65150b"
  },
  "rawMetadata": "{\"compiler\":{\"version\":\"0.8.16+commit.07a7930e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"reserveId\",\"type\":\"uint256\"}],\"name\":\"getMarketBorrowRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_reserveId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_duration\",\"type\":\"uint256\"}],\"name\":\"getMarketDurationLoanToValue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"reserveId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rate\",\"type\":\"uint256\"}],\"name\":\"setMarketBorrowRate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_reserveId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_duration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ltv\",\"type\":\"uint256\"}],\"name\":\"setMarketDurationLoanToValue\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getMarketBorrowRate(uint256)\":{\"details\":\"returns the market borrow rate in ray*\"},\"getMarketDurationLoanToValue(uint256,uint256)\":{\"details\":\"Sets the borrow rate of the reserve*\"},\"setMarketBorrowRate(uint256,uint256)\":{\"details\":\"sets the market borrow rate. Rate value must be in ray*\"},\"setMarketDurationLoanToValue(uint256,uint256,uint256)\":{\"details\":\"Sets the borrow rate of the reserve*\"}},\"title\":\"ILendingRateManager interface\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Interface for the FluidNFT borrow rate manager.  Provides the average market borrow rate to be used as a base for the stable borrow rate calculations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/ILendingRateManager.sol\":\"ILendingRateManager\"},\"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\":{\"src/interfaces/ILendingRateManager.sol\":{\"keccak256\":\"0x6078c32591ae3ced86c344ad2f228fbcc625f09cd59a8f7014355adb89dfcde0\",\"license\":\"AGPL-3.0\",\"urls\":[\"bzz-raw://fa594c0ceb1a0a085a6b077ac0729663f839f33f760eb8775ff1b3d25415e097\",\"dweb:/ipfs/QmXU74R73UDHiwvVaU9LRrC1tHaDq5eCerenKQtFX97UL6\"]}},\"version\":1}",
  "metadata": {
    "compiler": {
      "version": "0.8.16+commit.07a7930e"
    },
    "language": "Solidity",
    "output": {
      "abi": [
        {
          "inputs": [
            {
              "internalType": "uint256",
              "name": "reserveId",
              "type": "uint256"
            }
          ],
          "stateMutability": "view",
          "type": "function",
          "name": "getMarketBorrowRate",
          "outputs": [
            {
              "internalType": "uint256",
              "name": "",
              "type": "uint256"
            }
          ]
        },
        {
          "inputs": [
            {
              "internalType": "uint256",
              "name": "_reserveId",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "_duration",
              "type": "uint256"
            }
          ],
          "stateMutability": "view",
          "type": "function",
          "name": "getMarketDurationLoanToValue",
          "outputs": [
            {
              "internalType": "uint256",
              "name": "",
              "type": "uint256"
            }
          ]
        },
        {
          "inputs": [
            {
              "internalType": "uint256",
              "name": "reserveId",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "rate",
              "type": "uint256"
            }
          ],
          "stateMutability": "nonpayable",
          "type": "function",
          "name": "setMarketBorrowRate"
        },
        {
          "inputs": [
            {
              "internalType": "uint256",
              "name": "_reserveId",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "_duration",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "_ltv",
              "type": "uint256"
            }
          ],
          "stateMutability": "nonpayable",
          "type": "function",
          "name": "setMarketDurationLoanToValue"
        }
      ],
      "devdoc": {
        "kind": "dev",
        "methods": {
          "getMarketBorrowRate(uint256)": {
            "details": "returns the market borrow rate in ray*"
          },
          "getMarketDurationLoanToValue(uint256,uint256)": {
            "details": "Sets the borrow rate of the reserve*"
          },
          "setMarketBorrowRate(uint256,uint256)": {
            "details": "sets the market borrow rate. Rate value must be in ray*"
          },
          "setMarketDurationLoanToValue(uint256,uint256,uint256)": {
            "details": "Sets the borrow rate of the reserve*"
          }
        },
        "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/interfaces/ILendingRateManager.sol": "ILendingRateManager"
      },
      "libraries": {}
    },
    "sources": {
      "src/interfaces/ILendingRateManager.sol": {
        "keccak256": "0x6078c32591ae3ced86c344ad2f228fbcc625f09cd59a8f7014355adb89dfcde0",
        "urls": [
          "bzz-raw://fa594c0ceb1a0a085a6b077ac0729663f839f33f760eb8775ff1b3d25415e097",
          "dweb:/ipfs/QmXU74R73UDHiwvVaU9LRrC1tHaDq5eCerenKQtFX97UL6"
        ],
        "license": "AGPL-3.0"
      }
    },
    "version": 1
  },
  "ast": {
    "absolutePath": "src/interfaces/ILendingRateManager.sol",
    "id": 49045,
    "exportedSymbols": {
      "ILendingRateManager": [
        49044
      ]
    },
    "nodeType": "SourceUnit",
    "src": "37:933:114",
    "nodes": [
      {
        "id": 49006,
        "nodeType": "PragmaDirective",
        "src": "37:23:114",
        "nodes": [],
        "literals": [
          "solidity",
          "0.8",
          ".16"
        ]
      },
      {
        "id": 49044,
        "nodeType": "ContractDefinition",
        "src": "276:693:114",
        "nodes": [
          {
            "id": 49015,
            "nodeType": "FunctionDefinition",
            "src": "377:80:114",
            "nodes": [],
            "documentation": {
              "id": 49008,
              "nodeType": "StructuredDocumentation",
              "src": "312:60:114",
              "text": "@dev returns the market borrow rate in ray*"
            },
            "functionSelector": "f12c8b35",
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getMarketBorrowRate",
            "nameLocation": "386:19:114",
            "parameters": {
              "id": 49011,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 49010,
                  "mutability": "mutable",
                  "name": "reserveId",
                  "nameLocation": "414:9:114",
                  "nodeType": "VariableDeclaration",
                  "scope": 49015,
                  "src": "406:17:114",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 49009,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "406:7:114",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "405:19:114"
            },
            "returnParameters": {
              "id": 49014,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 49013,
                  "mutability": "mutable",
                  "name": "",
                  "nameLocation": "-1:-1:-1",
                  "nodeType": "VariableDeclaration",
                  "scope": 49015,
                  "src": "448:7:114",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 49012,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "448:7:114",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "447:9:114"
            },
            "scope": 49044,
            "stateMutability": "view",
            "virtual": false,
            "visibility": "external"
          },
          {
            "id": 49023,
            "nodeType": "FunctionDefinition",
            "src": "545:71:114",
            "nodes": [],
            "documentation": {
              "id": 49016,
              "nodeType": "StructuredDocumentation",
              "src": "463:77:114",
              "text": "@dev sets the market borrow rate. Rate value must be in ray*"
            },
            "functionSelector": "7dc492d1",
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "setMarketBorrowRate",
            "nameLocation": "554:19:114",
            "parameters": {
              "id": 49021,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 49018,
                  "mutability": "mutable",
                  "name": "reserveId",
                  "nameLocation": "582:9:114",
                  "nodeType": "VariableDeclaration",
                  "scope": 49023,
                  "src": "574:17:114",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 49017,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "574:7:114",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 49020,
                  "mutability": "mutable",
                  "name": "rate",
                  "nameLocation": "601:4:114",
                  "nodeType": "VariableDeclaration",
                  "scope": 49023,
                  "src": "593:12:114",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 49019,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "593:7:114",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "573:33:114"
            },
            "returnParameters": {
              "id": 49022,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "615:0:114"
            },
            "scope": 49044,
            "stateMutability": "nonpayable",
            "virtual": false,
            "visibility": "external"
          },
          {
            "id": 49033,
            "nodeType": "FunctionDefinition",
            "src": "687:109:114",
            "nodes": [],
            "documentation": {
              "id": 49024,
              "nodeType": "StructuredDocumentation",
              "src": "622:60:114",
              "text": " @dev Sets the borrow rate of the reserve*"
            },
            "functionSelector": "2ee1bbb0",
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getMarketDurationLoanToValue",
            "nameLocation": "696:28:114",
            "parameters": {
              "id": 49029,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 49026,
                  "mutability": "mutable",
                  "name": "_reserveId",
                  "nameLocation": "733:10:114",
                  "nodeType": "VariableDeclaration",
                  "scope": 49033,
                  "src": "725:18:114",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 49025,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "725:7:114",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 49028,
                  "mutability": "mutable",
                  "name": "_duration",
                  "nameLocation": "753:9:114",
                  "nodeType": "VariableDeclaration",
                  "scope": 49033,
                  "src": "745:17:114",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 49027,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "745:7:114",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "724:39:114"
            },
            "returnParameters": {
              "id": 49032,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 49031,
                  "mutability": "mutable",
                  "name": "",
                  "nameLocation": "-1:-1:-1",
                  "nodeType": "VariableDeclaration",
                  "scope": 49033,
                  "src": "787:7:114",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 49030,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "787:7:114",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "786:9:114"
            },
            "scope": 49044,
            "stateMutability": "view",
            "virtual": false,
            "visibility": "external"
          },
          {
            "id": 49043,
            "nodeType": "FunctionDefinition",
            "src": "867:100:114",
            "nodes": [],
            "documentation": {
              "id": 49034,
              "nodeType": "StructuredDocumentation",
              "src": "802:60:114",
              "text": " @dev Sets the borrow rate of the reserve*"
            },
            "functionSelector": "2d65150b",
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "setMarketDurationLoanToValue",
            "nameLocation": "876:28:114",
            "parameters": {
              "id": 49041,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 49036,
                  "mutability": "mutable",
                  "name": "_reserveId",
                  "nameLocation": "913:10:114",
                  "nodeType": "VariableDeclaration",
                  "scope": 49043,
                  "src": "905:18:114",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 49035,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "905:7:114",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 49038,
                  "mutability": "mutable",
                  "name": "_duration",
                  "nameLocation": "933:9:114",
                  "nodeType": "VariableDeclaration",
                  "scope": 49043,
                  "src": "925:17:114",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 49037,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "925:7:114",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 49040,
                  "mutability": "mutable",
                  "name": "_ltv",
                  "nameLocation": "952:4:114",
                  "nodeType": "VariableDeclaration",
                  "scope": 49043,
                  "src": "944:12:114",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 49039,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "944:7:114",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "904:53:114"
            },
            "returnParameters": {
              "id": 49042,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "966:0:114"
            },
            "scope": 49044,
            "stateMutability": "nonpayable",
            "virtual": false,
            "visibility": "external"
          }
        ],
        "abstract": false,
        "baseContracts": [],
        "canonicalName": "ILendingRateManager",
        "contractDependencies": [],
        "contractKind": "interface",
        "documentation": {
          "id": 49007,
          "nodeType": "StructuredDocumentation",
          "src": "62:212:114",
          "text": " @title ILendingRateManager interface\n @notice Interface for the FluidNFT borrow rate manager. \n Provides the average market borrow rate to be used as a base for the stable borrow rate calculations*"
        },
        "fullyImplemented": false,
        "linearizedBaseContracts": [
          49044
        ],
        "name": "ILendingRateManager",
        "nameLocation": "286:19:114",
        "scope": 49045,
        "usedErrors": []
      }
    ],
    "license": "AGPL-3.0"
  },
  "id": 114
}

Last updated