2020-05-29 16:45:37 +00:00
|
|
|
// SPDX-License-Identifier: agpl-3.0
|
2020-11-20 10:45:20 +00:00
|
|
|
pragma solidity 0.6.12;
|
2020-05-29 16:45:37 +00:00
|
|
|
|
2020-08-20 10:44:51 +00:00
|
|
|
import {ILendingRateOracle} from '../../interfaces/ILendingRateOracle.sol';
|
2020-10-15 13:41:56 +00:00
|
|
|
import {Ownable} from '../../dependencies/openzeppelin/contracts/Ownable.sol';
|
2020-05-29 16:45:37 +00:00
|
|
|
|
|
|
|
contract LendingRateOracle is ILendingRateOracle, Ownable {
|
2020-07-13 08:54:08 +00:00
|
|
|
mapping(address => uint256) borrowRates;
|
|
|
|
mapping(address => uint256) liquidityRates;
|
2020-05-29 16:45:37 +00:00
|
|
|
|
2020-07-13 08:54:08 +00:00
|
|
|
function getMarketBorrowRate(address _asset) external override view returns (uint256) {
|
|
|
|
return borrowRates[_asset];
|
|
|
|
}
|
2020-05-29 16:45:37 +00:00
|
|
|
|
2020-07-13 08:54:08 +00:00
|
|
|
function setMarketBorrowRate(address _asset, uint256 _rate) external override onlyOwner {
|
|
|
|
borrowRates[_asset] = _rate;
|
|
|
|
}
|
2020-05-29 16:45:37 +00:00
|
|
|
|
2020-07-13 08:54:08 +00:00
|
|
|
function getMarketLiquidityRate(address _asset) external view returns (uint256) {
|
|
|
|
return liquidityRates[_asset];
|
|
|
|
}
|
2020-05-29 16:45:37 +00:00
|
|
|
|
2020-07-13 08:54:08 +00:00
|
|
|
function setMarketLiquidityRate(address _asset, uint256 _rate) external onlyOwner {
|
|
|
|
liquidityRates[_asset] = _rate;
|
|
|
|
}
|
|
|
|
}
|