Skip to content

Latest commit

 

History

History
47 lines (24 loc) · 2.58 KB

README.md

File metadata and controls

47 lines (24 loc) · 2.58 KB

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/