Dusk Dual
Price.
A lightweight on-chain DUSK/USD and DUSK/EUR price oracle for DuskEVM applications and smart contracts.
The updater runs every 30 minutes, but only writes on-chain when either USD or EUR deviates by at least 0.2%. An older price-change timestamp does not by itself mean the updater is delayed.
Five opinions. One median.
The updater gathers multiple independent market prices, calculates a median and only submits an on-chain update when the difference is meaningful.
Fetch
Collect DUSK market prices from five providers.
Median
Calculate a robust median across the available sources.
Compare
Compare the result with the current on-chain price.
Update
Submit a transaction when either USD or EUR deviates by at least 0.2%.
Don't trust just one exchange.
USD is built from five configured market providers. EUR combines a USD-derived FX reference with a direct CoinGecko EUR reference when available.
What could you use this for?
Any DuskEVM contract that needs a DUSK fiat reference can consume the oracle.
Fiat-priced payments
Price something in USD or EUR while accepting the equivalent amount in DUSK.
Collateral
Estimate the fiat value of DUSK collateral before applying application-specific rules.
Treasury values
Calculate the fiat reference value of DUSK held by a contract or treasury.
Price triggers
Build contract logic that reacts when DUSK crosses an application-defined price level.
Read it from Solidity.
The deployed oracle exposes the current USD price, EUR price and last update timestamp through getPrices().
interface IDuskDualPriceOracle {
function getPrices()
external
view
returns (
uint256 usd,
uint256 eur,
uint256 updatedAt
);
}
IDuskDualPriceOracle oracle =
IDuskDualPriceOracle(
0x4B69A094014c88177869C616A0e1bc6C0AD7a5E4
);
(
uint256 usd,
uint256 eur,
uint256 updatedAt
) = oracle.getPrices();
// Prices use 8 decimals.
// 6808700 = $0.06808700
//
// updatedAt is the timestamp of the last on-chain
// PRICE CHANGE, not the last updater run.
// The updater may run successfully without writing
// when both deviations remain below 0.2%.For people who like integers.
The contract stores uint256 values scaled by 1e8.
Multi-source pricing.
Owner-submitted updates.
Price selection uses multiple market providers and a median-based updater, but the deployed oracle contract currently accepts updates from its owner address only. It is therefore not a decentralized oracle network.
Consumers should treat updatedAt as the timestamp of the last on-chain price change, not as an updater-health heartbeat. The updater can run successfully without writing when both price deviations remain below 0.2%.
