27 Followers
·
Follow

Image for post
Image for post
Zeus

tl:dr: Exercising an option will pay you first.

For the past few weeks we have been testing the contracts and optimizing their gas usage. In the process of this, we noticed that by reorganizing the logic in the exercise function, we can enable flash exercises.

Vanilla options are often never exercised because it uses the option. The option had extrinsic time value, which is effectively burned when it’s used. It’s often the case options are sold to close, rather than exercised to close.

Why build in flash exercises then? There is a case where an option is exercised: when the option expires in the money. At this point in time, the option’s value is almost 100% of its intrinsic value, the difference between the execution price of buying the underlying tokens and the market value of the underlying tokens. Therefore, a flash exercise will give us the underlying token first which we can then sell and use the proceeds to pay the strike price of the option. …


Image for post
Image for post
Prometheus Carrying Fire — Jan Cossiers (1600–1671) — Prado Museum

tl:dr: Smart tokens are ERC-20 tokens with extra features.

The ERC-20 standard is powerful for a few reasons, but one of them is how easy it is to build liquidity around. These tokens are plugged into liquidity models with ease, and what we get is a more liquid market that is better for all parties. Liquidity models will continue to grow and iterate towards zero impermanent loss, but what about the tokens?

System Tokens

Many of the most liquid tokens have their value derived from the system it is embedded in. …


At 11:30 A.M. we announced our alpha release. Two hours later, we discovered a bug.

TL:DR

  • The bug prevents purchasing Primes from the Pool.
  • Current Prime holders are not at risk due to this bug. If you have Prime tokens, you can still freely exercise. We recommend you do so.
  • No funds are at risk due to this bug.
  • We paused the Pool, preventing new liquidity from being added.

The Bug

Image for post
Image for post
PrimePool.sol Alpha V0

Lines 235–241 are the area of focus here. In line 237, the premium is calculated. If this premium is 0, the transaction will revert with the error: “ERR_BAL_ETH” at line 241. We made the mistake of assuming the premium should only return 0 if the amount is 0, which is the input parameter for the amount of Primes to buy. …

About

Primitive

Permissionless options protocol. Built on Ethereum.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store