Ample Harvest was inspired by the composibility of ethereum (money legos!) and the importance of options as a hedging tool in the financial world. Since Ampleforth is a currency where the amount you own may change every day, many users may want to leverage against changes in their balance by placing bets that, if correct, pay out more AMPL during a supply contraction, or boost the upside impact of a supply expansion. This type of derivatives trading may also help stabilize the AMPL market overall, since speculators can profit under all three conditions (expansion, contraction, and equilibirum) and may help the AMPL token meet it's goal of staying within target range.

What it does

Allows you to write American-style call and put options based on the difference over/under of the current AMPL vwap to it's price target. These can be held, exercised or sold on DEXes to earn premium on your AMPL collateral.

How I built it

Using chainlink to keep the latest vwap price of Ampleforth continually fed into the smart contract. The entire contract protocol was written in Solidity, with a front end (WIP) that was built with a combo of TailwindCSS and Javascript.

Challenges I ran into

Initially, I didn't know what price feed to use for getting the best Ampleforth data. After research, I selected anyblocks API and the official Ampleforth/Fragments REST API for other data such as next rebase time and the CPI target. Some code size limitations in solidity, but I made the code shorter and more elegant! Also, the challenge that Ampleforth rebases daily, and how to best deal with that when creating a standardized contract that holds a fixed amount of Ampleforth.

Accomplishments that I'm proud of

Using ratios throughout the protocol, so that after rebase, you're still entitled to the same proportion of AMPL you should receive per contracts that you hold. I'm also proud of learning new things about finance, and more of the API of chainlink!

What I learned

How to get data of any precision/decimal place using Chainlink's HTTP GET More about AmpleForth and it's monetary policy

What's next for Ample Harvest

Bug fixes/errata Progress on the options exchange dapp Working towards a main net release!

Built With

Share this project: