BinanceOracle

BinanceOracle

This oracle fetches price of assets from Binance.

Solidity API

BNB_ADDR

Set this as asset address for BNB. This is the underlying address for vBNB

address BNB_ADDR

maxStalePeriod

Max stale period configuration for assets

mapping(string => uint256) maxStalePeriod

symbols

Override symbols to be compatible with Binance feed registry

mapping(string => string) symbols

constructor

Constructor for the implementation contract.

constructor() public

setMaxStalePeriod

Used to set the max stale period of an asset

function setMaxStalePeriod(string symbol, uint256 _maxStalePeriod) external

Parameters

NameTypeDescription

symbol

string

The symbol of the asset

_maxStalePeriod

uint256

The max stake period


setSymbolOverride

Used to override a symbol when fetching price

function setSymbolOverride(string symbol, string overrideSymbol) external

Parameters

NameTypeDescription

symbol

string

The symbol to override

overrideSymbol

string

The symbol after override


initialize

Sets the contracts required to fetch prices

function initialize(address _sidRegistryAddress, address _accessControlManager) external

Parameters

NameTypeDescription

_sidRegistryAddress

address

Address of SID registry

_accessControlManager

address

Address of the access control manager contract


getFeedRegistryAddress

Uses Space ID to fetch the feed registry address

function getFeedRegistryAddress() public view returns (address)

Return Values

NameTypeDescription

[0]

address

feedRegistryAddress Address of binance oracle feed registry.


getPrice

Gets the price of a asset from the binance oracle

function getPrice(address asset) public view returns (uint256)

Parameters

NameTypeDescription

asset

address

Address of the asset

Return Values

NameTypeDescription

[0]

uint256

Price in USD


Last updated