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 | 0xCD2D0e8A7140C5fBA6E3eCf0AA96893216B1c204 |
| Base Sepolia | 0x2b2782251A31Ec9e1c7A0403f4AFb64E41406438 |
| Base Mainnet | 0xd56eF5A31D662a526e85B3af43ef681b48740326 |
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
| Name | Type | Description |
|---|---|---|
productId | ProductId | 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(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
| Name | Type | Description |
|---|---|---|
productId | ProductId | product being updated |
value | FPUnsigned | new value |
timestamp | uint64 | time 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
| Name | Type | Description |
|---|---|---|
next | contract IOracle | New address. Must not be 0 |
Events
SetOracle
event SetOracle(contract IOracle newOracle, contract IOracle prevOracle)
Modifiers
onlyOracle
modifier onlyOracle()
Errors
OnlyOracle
error OnlyOracle()