Oracle parameters
Parameters governing the log-space TWAP oracle (OracleSupervised).
Defaults
| ID | Parameter | Range | Notes |
|---|---|---|---|
0x1 | DECAY | 0.5–1.0 | EWMA decay factor (the α in the math). At a 1-hour LIMIT the default 0.944 gives a 12-hour half-life. |
0x2 | DELAY | 1 week – 3 months | Wait between enlisting a feed and that feed becoming live. |
0x4 | LEVEL | 0–64 | PoW difficulty for permissionless retwap calls. |
0x8 | LIMIT | 1 second – 1 day | Minimum interval between two TWAP refreshes. |
What each parameter does
DECAY— geometric weight on each new sample. SmallerDECAY⇒ faster adaptation, higher manipulation surface; largerDECAY⇒ smoother price, slower reaction to genuine moves.DELAY— gives users a window to react before a newly-enlisted feed influences any pool's risk math. Distinct fromLIMIT: this is a one-shot enlistment delay, not a rolling rate-limit.LEVEL— proof-of-work difficulty a permissionless caller must satisfy to invokeretwap. Permissioned callers (FEED_RETWAP_ROLE) bypass this.LIMIT— minimum spacing between consecutive TWAP refreshes. A second sample withinLIMITreverts. This is what bounds the per-block manipulation surface.
Reading from the contract
solidity
IOracle oracle = IOracle(0xB822EF2015C7E35Cad636d0391A282E40B05a44d); // APOW/XPOW
(uint256 decay,) = oracle.getTarget(oracle.DECAY_ID());
(uint256 limit,) = oracle.getTarget(oracle.LIMIT_ID());Every parameter ID is a public constant on the contract (DECAY_ID, DELAY_ID, LEVEL_ID, LIMIT_ID). Current and pending values are read with getTarget(id).