Ring Protocol
Search
K
Comment on page

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

function read() external view returns (Decimal.D256 memory, bool);
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

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

ABIs

uniswaporacle.json
3KB
Code
Uniswap Oracle ABI
iuniswaporacle.json
878B
Code
Uniswap Oracle Interface ABI
ioracle.json
270B
Code
Oracle Interface ABI