BinanceOracle
BinanceOracle
This oracle fetches price of assets from Binance.
Solidity API
sidRegistryAddress
Used to fetch feed registry address.
BNB_ADDR
Set this as asset address for BNB. This is the underlying address for vBNB
maxStalePeriod
Max stale period configuration for assets
symbols
Override symbols to be compatible with Binance feed registry
feedRegistryAddress
Used to fetch price of assets used directly when space ID is not supported by current chain.
constructor
Constructor for the implementation contract.
initialize
Sets the contracts required to fetch prices
Parameters
Name | Type | Description |
---|---|---|
_sidRegistryAddress | address | Address of SID registry |
_accessControlManager | address | Address of the access control manager contract |
setMaxStalePeriod
Used to set the max stale period of an asset
Parameters
Name | Type | Description |
---|---|---|
symbol | string | The symbol of the asset |
_maxStalePeriod | uint256 | The max stake period |
setSymbolOverride
Used to override a symbol when fetching price
Parameters
Name | Type | Description |
---|---|---|
symbol | string | The symbol to override |
overrideSymbol | string | The symbol after override |
setFeedRegistryAddress
Used to set feed registry address when current chain does not support space ID.
Parameters
Name | Type | Description |
---|---|---|
newfeedRegistryAddress | address | Address of new feed registry. |
getFeedRegistryAddress
Uses Space ID to fetch the feed registry address
Return Values
Name | Type | Description |
---|---|---|
[0] | address | feedRegistryAddress Address of binance oracle feed registry. |
getPrice
Gets the price of a asset from the binance oracle
Parameters
Name | Type | Description |
---|---|---|
asset | address | Address of the asset |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | Price in USD |
Last updated