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
Many onchain value flows require fair pricing for token pairs
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.
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.
forge fmt
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
forge doc --serve --port 4000
- serves natspec docs at http://localhost:4000/