Skip to content

Latest commit

 

History

History
507 lines (431 loc) · 15.3 KB

IPriceFeeds.md

File metadata and controls

507 lines (431 loc) · 15.3 KB

IPriceFeeds.sol

View Source: contracts/feeds/IPriceFeeds.sol

IPriceFeeds contract

Functions


queryRate

function queryRate(address sourceToken, address destToken) external view
returns(rate uint256, precision uint256)

Arguments

Name Type Description
sourceToken address
destToken address
Source Code
function queryRate(address sourceToken, address destToken)
        external
        view
        returns (uint256 rate, uint256 precision);

queryPrecision

function queryPrecision(address sourceToken, address destToken) external view
returns(precision uint256)

Arguments

Name Type Description
sourceToken address
destToken address
Source Code
function queryPrecision(address sourceToken, address destToken)
        external
        view
        returns (uint256 precision);

queryReturn

function queryReturn(address sourceToken, address destToken, uint256 sourceAmount) external view
returns(destAmount uint256)

Arguments

Name Type Description
sourceToken address
destToken address
sourceAmount uint256
Source Code
function queryReturn(
        address sourceToken,
        address destToken,
        uint256 sourceAmount
    ) external view returns (uint256 destAmount);

checkPriceDisagreement

function checkPriceDisagreement(address sourceToken, address destToken, uint256 sourceAmount, uint256 destAmount, uint256 maxSlippage) external view
returns(sourceToDestSwapRate uint256)

Arguments

Name Type Description
sourceToken address
destToken address
sourceAmount uint256
destAmount uint256
maxSlippage uint256
Source Code
function checkPriceDisagreement(
        address sourceToken,
        address destToken,
        uint256 sourceAmount,
        uint256 destAmount,
        uint256 maxSlippage
    ) external view returns (uint256 sourceToDestSwapRate);

amountInEth

function amountInEth(address Token, uint256 amount) external view
returns(ethAmount uint256)

Arguments

Name Type Description
Token address
amount uint256
Source Code
function amountInEth(address Token, uint256 amount) external view returns (uint256 ethAmount);

getMaxDrawdown

function getMaxDrawdown(address loanToken, address collateralToken, uint256 loanAmount, uint256 collateralAmount, uint256 maintenanceMargin) external view
returns(uint256)

Arguments

Name Type Description
loanToken address
collateralToken address
loanAmount uint256
collateralAmount uint256
maintenanceMargin uint256
Source Code
function getMaxDrawdown(
        address loanToken,
        address collateralToken,
        uint256 loanAmount,
        uint256 collateralAmount,
        uint256 maintenanceMargin
    ) external view returns (uint256);

getCurrentMarginAndCollateralSize

function getCurrentMarginAndCollateralSize(address loanToken, address collateralToken, uint256 loanAmount, uint256 collateralAmount) external view
returns(currentMargin uint256, collateralInEthAmount uint256)

Arguments

Name Type Description
loanToken address
collateralToken address
loanAmount uint256
collateralAmount uint256
Source Code
function getCurrentMarginAndCollateralSize(
        address loanToken,
        address collateralToken,
        uint256 loanAmount,
        uint256 collateralAmount
    ) external view returns (uint256 currentMargin, uint256 collateralInEthAmount);

getCurrentMargin

function getCurrentMargin(address loanToken, address collateralToken, uint256 loanAmount, uint256 collateralAmount) external view
returns(currentMargin uint256, collateralToLoanRate uint256)

Arguments

Name Type Description
loanToken address
collateralToken address
loanAmount uint256
collateralAmount uint256
Source Code
function getCurrentMargin(
        address loanToken,
        address collateralToken,
        uint256 loanAmount,
        uint256 collateralAmount
    ) external view returns (uint256 currentMargin, uint256 collateralToLoanRate);

shouldLiquidate

function shouldLiquidate(address loanToken, address collateralToken, uint256 loanAmount, uint256 collateralAmount, uint256 maintenanceMargin) external view
returns(bool)

Arguments

Name Type Description
loanToken address
collateralToken address
loanAmount uint256
collateralAmount uint256
maintenanceMargin uint256
Source Code
function shouldLiquidate(
        address loanToken,
        address collateralToken,
        uint256 loanAmount,
        uint256 collateralAmount,
        uint256 maintenanceMargin
    ) external view returns (bool);

getFastGasPrice

function getFastGasPrice(address payToken) external view
returns(uint256)

Arguments

Name Type Description
payToken address
Source Code
function getFastGasPrice(address payToken) external view returns (uint256);

Contracts