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 Sepolia0xCD2D0e8A7140C5fBA6E3eCf0AA96893216B1c204
Base Sepolia0x2b2782251A31Ec9e1c7A0403f4AFb64E41406438
Base Mainnet0xd56eF5A31D662a526e85B3af43ef681b48740326

Functions

initialize

function initialize(struct StorageInstance store, contract IOracle initialOracle) external

getPrice

Retrieve the latest price for a product

function getPrice(ProductId productId) public view returns (FPUnsigned price)

Parameters

NameTypeDescription
productIdProductIdProduct 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(ProductId 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
productIdProductIdproduct being updated
valueFPUnsignednew value
timestampuint64time new value was generated

oracle

function oracle() external view returns (contract IOracle)

setOracle

Update the address of the saved oracle

function setOracle(contract IOracle next) external

Parameters

NameTypeDescription
nextcontract IOracleNew address. Must not be 0

Events

SetOracle

event SetOracle(contract IOracle newOracle, contract IOracle prevOracle)

Modifiers

onlyOracle

modifier onlyOracle()

Errors

OnlyOracle

error OnlyOracle()

Variables

props