PriceFeed
PriceFeed
Price feed for Domination Finance perpetual exchange.
Assembles prices from one or more oracle contracts into a single price feed for the exchange.
Addresses
Chain | Address |
---|---|
Arbitrum Sepolia | 0x519a1CC04c0CED13ae7906FBD519D32D14329087 |
Zircuit | 0x72c1FAF8447f178A7D57499f3d47854E981ED9f9 |
Functions
constructor
constructor(contract IOracle _oracle) public
getPrice
Retrieve the latest price for a product
function getPrice(bytes32 productId) public view returns (FPUnsigned price)
Parameters
Name | Type | Description |
---|---|---|
productId | bytes32 | Product for which to retrieve price |
Return Values
Name | Type | Description |
---|---|---|
price | FPUnsigned | Latest price for this product |
notifyPerp
Cause the connected DomFiPerp, if registered, to emit a PriceUpdate
function notifyPerp(bytes32 productId, FPUnsigned value, uint64 timestamp) external
Dev note
no-op if no perp registered, so PriceFeeds can be set up before being passed into Perp constructor
Parameters
Name | Type | Description |
---|---|---|
productId | bytes32 | product being updated |
value | FPUnsigned | new value |
timestamp | uint64 | time new value was generated |
setOracle
Update the address of the saved oracle
function setOracle(contract IOracle newOracle) external
Parameters
Name | Type | Description |
---|---|---|
newOracle | contract IOracle | New address. Must not be 0 |
setPerp
function setPerp(contract IDomFiPerp newPerp) external
setOwner
function setOwner(address _owner) external
Events
SetOwner
event SetOwner(address owner)
SetOracle
event SetOracle(contract IOracle newOracle, contract IOracle prevOracle)
SetPerp
event SetPerp(contract IDomFiPerp newPerp, contract IDomFiPerp oldPerp)
Modifiers
onlyOwner
modifier onlyOwner()
Errors
OracleOnly
error OracleOnly()
OwnerOnly
error OwnerOnly()
InvalidOracle
error InvalidOracle()