Skip to content

First Release

Latest

Choose a tag to compare

@dudesahn dudesahn released this 14 Nov 01:51
· 10 commits to main since this release

This oracle may be used to price Velodrome-style LP pools (both vAMM and sAMM) in a manipulation-resistant manner. A pool must contain at least one asset with a Chainlink feed to be valid. If only one asset has a Chainlink feed, an internal TWAP may be used to price the other asset , with a default 2 hour window.

The pessimistic oracle stores daily lows, and prices are checked over the past two (or three) days of stored data when calculating an LP's value. A manual price cap (upper and lower bounds) may be enabled to further limit the impact of manipulations in a given direction. Note that manual price caps (just as the ability to set price feeds) are the main centralization risk of an oracle such as this, and if used, should be treated with great consideration.

With this oracle, price manipulation attacks are substantially more difficult, as an attacker needs to log artificially high lows but still come in under any price cap (if set). Additionally, if three-day lows are used, the oracle becomes more robust for public price updates, as the minimum time covered by all observations jumps from two seconds (two-day window) to 24 hours (three-day window). However, using the pessimistic oracle does have the disadvantage of reducing borrow power of borrowers to a multi-day minimum value of their collateral, where the price also must have been seen by the oracle.