Skip to main content

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

ChainAddress
Arbitrum Sepolia0x519a1CC04c0CED13ae7906FBD519D32D14329087

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

NameTypeDescription
productIdbytes32Product for which to retrieve price

Return Values

NameTypeDescription
priceFPUnsignedLatest 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

NameTypeDescription
productIdbytes32product being updated
valueFPUnsignednew value
timestampuint64time new value was generated

setOracle

Update the address of the saved oracle

function setOracle(contract IOracle newOracle) external

Parameters

NameTypeDescription
newOraclecontract IOracleNew 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()

Variables

owner

oracle

perp