Price Oracle
The Price Oracle contract retrieves the exchange rate between Basis Cash and DAI.
A modified version of
ExampleOracleSimple.sol from the uniswap-v2-periphery repository has been used.Oracle.solDeployed at
[0xcontract_address] on the Ethereum mainnet, [other_testnets] testnets.This contract is yet to be deployed.
event Updated(uint256 price0CumulativeLast, uint256 price1CumulativeLast);
Emitted when the price of Basis Cash is updated via
update.function update() external
If 24 hours has passed since
update was last successfully executed, updates the time-weighted average price (TWAP) of Basis Cash. Emits Updated.function consult(address token, uint amountIn) external view returns (uint amountOut)
Returns the amount of output tokens given in exchange for
amountIn number oftoken tokens ((Price of token token denominated in output tokens) * amountIn).function pairFor(address factory, address tokenA, address tokenB) external pure returns (address lpt)
Returns the calculated address for a pair without making any external calls.
Last modified 2yr ago