0xSplits / splits-oracle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

splits-oracle

Docs

What

Oracle provides a generic interface (IOracle) allowing for modular integrations of other onchain oracles (see Swapper for an example integration)

UniV3OracleImpl - provides per-pair customization layer (pool, period) on top of Uniswap v3's TWAP oracle

ChainlinkOracleImpl - provides per-pair customization layer (path, staleAfter) on top of Chainlink's data feed oracle

Why

Many onchain value flows require fair pricing for token pairs

How

UniV3OracleImpl sequence diagram

How does it determine fair pricing?

UniV3OracleImpl uses Uniswap v3's TWAP oracle. The owner must set per-pair reference pools & may set default & per-pair TWAP periods.

ChainlinkOracleImpl - uses Chainlink's data feed oracle. The owner must set per-pair data feed paths.

How is it governed?

Please be aware, an Oracle's owner has SIGNIFICANT CONTROL (depending on the implementation) of the deployment. It may, at any time for any reason, change the quote pair uniswap pools & TWAP periods. In situations where flows ultimately belong to or benefit more than a single person & immutability is a nonstarter, we strongly recommend using a multisig or DAO for governance.

Lint

forge fmt

Setup & test

forge i - install dependencies

forge b - compile the contracts

forge t - compile & test the contracts

forge t -vvv - produces a trace of any failing tests

Natspec

forge doc --serve --port 4000 - serves natspec docs at http://localhost:4000/

About

License:GNU General Public License v3.0


Languages

Language:Solidity 100.0%