Inspiration
We're inspired by the wish to democratize the access to sophisticated financial products. We believe that DeFi will allow us to give everyone with a STX/BTC wallet access to investment strategies that have historically been reserved for institutions and high net worth individuals (aka the whales).
We also believe that Stacks is in a unique position to become the smart contracting layer for Bitcoin, and by extension the home of Bitcoin DeFi. In making sustainable yield strategies available on Stacks, we believe that we can help unlock the ecosystem's potential and contribute to accelerated user adoption.
DeFi summer has brought us a myriad of investment strategies with a majority of them centering around liquidity provision for automated market making (AMM) pools. While these strategies have their merit they often rely on the emission of inflationary protocol tokens to make the APY attractive, but making the yield for farmers unsustainable in the long term.
Options arbitrage strategies, on the other hand, represent a time tested alternative to generate sustainable, risk-adjusted yield without the risk of liquidation. Our project brings one options arbitrage strategy - the covered call strategy - to the Stacks ecosystem.
The project submission represents an MVP version of the options vault protocol, implementing one strategy (covered calls) for one asset (STX). With the help of dlc.link technology we intend to create native BTC vaults that pay out a native BTC yield, enabling true Bitcoin DeFi.
What it does
Options vaults allow you to allocate your crypto to an automated options yield strategy. All STX deposited into the options vault become available to a set of Clarity smart contracts that execute a simple covered call options writing strategy.
The strategy sells one week options contracts (represented as NFTs) against the STX in the vault. The options contracts, sold deeply "out-of-the-money", mostly expire worthless, putting a steady stream of premium payments into the vault investor's pocket.
The call option contract sold by the vault gives the buyer the right (but not the obligation) to buy one STX 15% above the current market price in one week from now. In other words, the call option contract only loses money for the vault if STX goes up by more than 15% in one week.
The net result is a strategy that, in bearish and mildly bullish market conditions, puts a steady stream of income payments into the vault's pocket - over the last year the APY for this strategy has been roughly 20%. Only in extremely bullish market conditions, a market with fast and steep price appreciation, does the strategy become unprofitable.
How we built it
We've built the project using Clarity for smart contracts and Typescript for writing unit and integration tests.
Challenges we ran into
Our first major challenge was how to design an app that uses calendar time instead of block time. The market standard for options expiry dates is calendar time and so, in order to make our options contracts comparable and therefore attractive to the majority of the market, we could not use block-height as our contract "internal clock" but instead needed calendar timestamps. This meant that we had to integrate price data and timestamps from the Redstone oracle - a task that challenged us for several days.
Our app has a sort of heartbeat. It all revolves around a weekly cycle that contains a number of different phases (auction, settlement, payout, ledger updates). We were challenged to come up with a simple, yet functional design for this cycle and had to refactor our code several times after we discovered that an earlier cycle design came with fatal flaws.
We had to design the majority of the public functions in our
vaultcontract so that they are only callable by theoptions-nftcontract. Understanding how to implement this check was challenging.The other big challenge was building out the testing suite. Since a large part of our internal functions are tightly interconnected, we had to simulate all aspects of a weekly cycle (from the auction, to the settlement and claiming of proceeds) in order to test the functions at the end of the process.
Accomplishments that we're proud of
Firstly, we are simply proud of the fact that the smart contracts work. The architecture is reasonably complex and so we had to spend a lot of time refining and simplifying the business logic. We have built a fully functional MVP with all the core features that we initially scoped.
Secondly, we're proud that we were able to build a testing suite that covers 100% of the functions in the smart contracts and more than 95% of the lines of code (see coverage report in the images above). We not only built unit tests but also integration tests that test all stages of the user flow and the interactions between Redstone data and the different elements of our contracts.
What's next for Options Vault
- Implementing a better options pricing formula, i.e. the Black-Scholes formula - the industry standard for pricing European style options
- Expanding the testing suite to include more unit and integration tests for all edge cases
- Getting the smart contracts audited
- Building a frontend using Stacks.js or uStacks
- Building covered call vaults for other assets on Stacks (i.e xBTC)
- Implementing other options arbitrage strategies like cash secured puts that earn yield on stable coins like xUSD
- Integrating dlc.link technology to offer vaults for native BTC



Log in or sign up for Devpost to join the conversation.