metaDAOproject / futarchy

Programs for market-driven governance
Other
49 stars 37 forks source link

Add a Raydium TWAP program #111

Closed metaproph3t closed 6 months ago

metaproph3t commented 6 months ago

We've been wanting to migrate to an AMM for a few reasons, including:

@Henry-E found that Raydium CLMM provides some oracle functionality. It doesn't provide the manipulation-resistance mechanisms we need, but we can build them on top. Importantly, it records observations before any trades have been made in a slot. This prevents someone from moving the AMM price to infinity, forcing an observation, and then selling back atomically.

What we can do is build a wrapper program that anyone can crank with recent observations and which stores those observations into its own data. This would also allow us to trade conditional markets through Jupiter, which is pretty cool.

Sub-issues:

metaproph3t commented 6 months ago

Not planned, going to use joebuild's AMM instead