Ring Protocol
Search…
UniswapOracle
An ETH/USDC Uniswap TWAP snapshot oracle

Contract

Description

The UniswapOracle reads the TWAP of duration (default to 10 mint) price information from UniswapV3 Pool The Governor ⚖️can change the duration.

Events

DurationUpdate
New TWAP duration
type
param
description
uint256
_duration
new value of the TWAP duration

Read-Only Functions

read

1
function read() external view returns (Decimal.D256 memory, bool);
Copied!
Reads the oracle value and reports the peg as RUSD per underlying. The boolean value returned informs whether the reported value is valid. Invalid means the oracle is uninitialized or the contract is paused.
This method is pausable. If paused, it won't revert but it will return valid as false

Governor-Only⚖️ State-Changing Functions

setDuration

1
function setDuration(uint256 _duration) external;
Copied!
Changes the time-weighted average price to _duration second snapshots
emits DurationUpdate

ABIs

uniswaporacle.json
3KB
Binary
Uniswap Oracle ABI
iuniswaporacle.json
878B
Binary
Uniswap Oracle Interface ABI
ioracle.json
270B
Binary
Oracle Interface ABI
Last modified 4mo ago