Smilee v1 — The first primitive for Decentralized Volatility Products (DVPs)

An open-source protocol enabling volatility-based products and strategies — bringing convexity to DeFi.

N B
Smilee Finance
16 min readJan 25, 2023

--

Introducing Smilee, the first Primitive create Decentralized Volatility Products!

🚨 Note: Smilee v1.69 is out! You can read about the new product here:

Abstract

Smilee is the first primitive to create fully Decentralized Volatility Products!

The Smilee team has fully solved the mathematics behind Impermanent Loss. By modeling liquidity providers as options sellers, Smilee transforms Impermanent Loss into a portfolio of options and then combines the options to create any volatility-based payoff.

Smilee transforms Impermanent Loss from a bug into a feature. In addition, by leveraging DEXs, Smilee can access ample liquidity and a diverse set of assets from day one.

This solves the chicken and egg problem of liquidity for options AMMs and other on-chain volatility products and positions Smilee as a primitive that such protocols can use to hedge risks fully on-chain. Moreover, Smilee can be used to build brand new volatility products, such as Impermanent Gain, the opposite of the Impermanent Loss.

We believe Decentralized Exchanges (DEXs) and Automated Market Makers (AMMs) are here to stay and will ultimately dominate both the crypto and traditional finance markets as trading activity moves on-chain. Thus, as Impermanent Loss becomes more relevant, so will be Smilee by empowering on-chain derivative solutions and the products of tomorrow.

Finding it interesting? Keep reading for all the details about Smilee, you will find a lot to Smile about…

Introduction: Impermanent Loss is just a portfolio of options

The rise of Decentralized Exchanges (DEXs) attracted tens of billions of dollars into liquidity pools during DeFi summer and the DeFi 2.0 boom.

However, liquidity providers (LPs) in DeFi are exposed to a now infamous risk: when markets are volatile, they significantly underperform an equal-weighted portfolio (EW portfolio), a problem known as Impermanent Loss (IL).

Mathematically, the EW portfolio payoff is:

EW portfolio payoff formula.

The LP payoff formula is:

LP payoff formula.

The difference is the Impermanent Loss, which can be written as:

Impermanent loss formula.

Where we have that r is the return of the token x in terms of the token y and V0 is the initial capital. For the derivation see appendix 1.

Graphically, the payoffs of the LP and the EW portfolios are:

A comparison between providing liquidity and holding an equal-weight portfolio of ETH / USDC worth $10,000. Initial ETH price = $1,000

If we plot their difference, we obtain the chart of the Impermanent Loss:

As we can see, Impermanent Loss is a concave function, which means the more the pair moves, the larger the Impermanent Loss is, which is equivalent to having a short volatility position (short gamma).

In exchange for such risk, Liquidity Providers receive a yield (APY) that depends on the fees generated on the DEX (long theta).

The combination of a short gamma exposure and a long theta one makes the liquidity provider payoff that of an options seller.

But who is the options buyer?

No one.

People can go LONG on liquidity (selling options), but they can’t go SHORT (buying options). This happens by design: automated market makers (AMMs) are built this way.

At Smilee we realized this is not a bug, it’s a feature.

Starting with the Impermanent Loss payoff, we derived the function to replicate it by selling a portfolio of options. The resulting formula is:

Options Weights Vector formula.

Where P is the matrix of the Payoffs of every option in each point of our replication grid, w is the vector of weights that we are computing and L is the vector containing the IL in each point of the grid.

We can get a progressively better approximation of the IL by selling more option strikes:

The relation between Impermanent Loss and options, never fully understood so far, allows us to create a brand new primitive whereby we decompose Impermanent Loss into options and recompose them to generate any type of volatility payoff.

This means that as long as there is enough liquidity on Smilee, we can mint and sell any option, on any strike, without having someone selling that option in the first place.

Again, this solves chicken and egg problem for options AMMs and positions Smilee as a primitive that other protocols can use to hedge risks fully on-chain in a fully customizable way.

Smilee: the first primitive for volatility

Smilee is the first primitive for volatility and it enables a new kind of on-chain product: the Decentralized Volatility Product (DVP).

DVPs are vault-based strategies that generate payoffs which are either long volatility (make money when market moves, no matter in which direction) or short volatility (make money when the market is stable or at equilibrium).

Architecture and functioning

At a high level, the Smilee core components are:

The core components of Smilee.

Short volatility DVPs are the ones “paying” the Impermanent Loss (or part of it) in exchange for a premium.

Long volatility DVPs are the ones paying a premium to “earn” the Impermanent Loss (or part of it).

At the abstract level, each DVP is a vault defined by:

  • The type of volatility exposure (long volatility vs short volatility)
  • A pair of tokens (eg., ETH / USDC, ETH / BTC, …)
  • The payoff formula, which define exactly the strategy behind the DVP
  • A maturity
  • An auction period

The liquidity-to-volatility engine is where the magic happens. Having fully solved the mathematics behind Impermanent Loss we are capable of translating it into any volatility-based payoffs, ensuring long and short volatility DVPs are perfectly balanced: what a DVP earns is paid by another DVP in any market scenarios.

How is that possible?

The engine ensures that for each pair of tokens:

  • The overall payoff of the short volatility DVPs is equal to a full range DEX LP token position payoff.
  • The overall payoff of the long volatility DVPs correspond to the Impermanent Loss with opposite sign. We call it Impermanent Gain.
  • The notional values of the long and short volatility DVPs always match.

Consequently, the sum of long and short volatility DVPs payoffs is the sum of the LP payoff and the Impermanent Loss.

However, by definition the Impermanent Loss is exactly the difference between the EW portfolio payoff and the LP payoff. Rearranging the formula, the sum of the long and short volatility DVPs payoffs is exactly the EW portfolio.

In formulas (also see the formulas and charts at the start of the paper):

EW — LP = IL -> EW = LP + IL

By simply ensuring that the liquidity into each of the vaults perfectly matches the allocation of the equal-weight portfolio, Smilee can guarantee that all the DVP payoffs are fully covered.

In addition, Smilee leverages DEXs liquidity in order to support a broad range assets.

This empowers unprecedented levels of customizability and composability.

Risks

Smilee is built in a way to avoid liquidation, credit or counterparty risks. However, volatility products are inherently risky as their payoff depends on market moves and the characteristics of the specific product.

Moreover, like any DeFi protocol, Smilee is exposed to several risks such as hacks, exploits and market manipulation. Our engineering team has applied all the security guidelines to minimize these risks and we have a smart contracts audit in the pipeline, but using a new DeFi primitive is risky so use Smilee at your own risk!

Examples of DVPs

Smilee vaults enable to easily create any volatility-based payoffs, such as:

  • Impermanent Gain (the opposite of Impermanent Loss)
  • Options (calls, puts, straddles, strangles, exotics, …)
  • Variance Swaps
  • Certificates and Structured Products
  • Insurance (depeg protection, Impermanent Loss protection, …)

To summarize, Smilee is the primitive that sits on top of DEXs and transforms their liquidity into Decentralized Volatility Products:

Smilee is the primitive to transform DEX Liquidity into Volatility.

Smilee’s architecture is so flexible that it allows for the creation of customizable DVPs for advance use cases, whether it be from a protocol, a DAO or an institutional (such as market makers, hedge funds, …). This brings the concept of the “money lego” to a brand-new level.

Various protocols are building long & short volatility products; however, they all have one key drawback. They lack a volatility primitive specifically built for fully decentralized solutions and thus often resort to using centralized counterparties (eg., Deribit), which in turn causes additional counterparty, credit and execution risks.

Smilee will be such primitive, empowering a new wave of DeFi innovation.

Let’s get real: the first Decentralized Volatility Products

To showcase what Smilee can do, we decided to build two very simple but powerful DVPs:

Real Yield: provide DEX-like liquidity to earn a predictable APY in USDC

Impermanent Gain: short LP positions to profit from Impermanent Loss

Two powerful DVPs for Smilee.

Real Yield in details: a fair return for liquidity providers

The Real Yield specifically targets liquidity providers’ needs.

Data collected during this bear market clearly shows that liquidity providers on DEXs are not compensated enough for the risks they are taking.

Uneven trading volumes, high volatility and the complexity of managing ranges are making APYs difficult to predict, unstable and, after the impact of Impermanent Loss, lower than the risk-free rate.

Smilee turbocharges liquidity provisioning by using Impermanent Loss to create new products. This increases the overall utility and value of providing liquidity without adding risks.

It is simply more efficient capital allocation, which accrues back to liquidity providers in the form of higher and more predictable returns.

The customer experience in-app related to Real Yield.

Real Yield: how does it work?

Each Real Yield Vault is defined by:

  • A pair of tokens (eg., ETH / USDC, ETH / BTC, …)
  • A target APY (eg., a fixed rate, …)
  • A strategy (eg., delta neutral, real yield, …)
  • A maturity
  • An auction period

During the auction period Liquidity Providers deposit liquidity into the vault in the form of either or both tokens of the pair. At the same time, users depositing in the Impermanent Gain Vault pay a premium in USDC (see next section). At maturity, the entire premium paid, minus the Impermanent Loss, goes to liquidity providers.

The Impermanent Loss is computed using the formula:

How the Impermanent Loss is computed, formula.

which matches the realized Impermanent Loss on a DEX.

After maturity Liquidity Providers can withdraw their liquidity and the accrued APY.

Initially, the APY of the vault is the cumulative premium paid by users of the Impermanent Gain Vault, but in the future it will be the cumulative premium paid by all long volatility DVP buyers.

Contrary to Uniswap and other DEXs, liquidity providers earn a pre-defined and transparent payoff.

Real Yield: payoff

EARN: APY + delta exposure

PAY: Impermanent Loss

The Real Yield payoff at maturity is:

Payoff:

Real Yield Payoff

PnL:

Real Yield PnL

The value of the Real Yield matches the value of a LP, but instead of the swap fees the LP earns a fixed premium P in USDC.

Graphically:

V0=10k, S0=1k, P=20

Real Yield: an example

Alice sees that the USDC/WETH pool on Smilee has a 15% target APY for the 7 day maturity.

She decides to deposit 1000 USDC in the Real Yield Vault.

At maturity, the ETH return (r) has been +5% vs USDC. As the vault expires, Alice gets back:

As the vault expires, Alice gets back:

Therefore, adding the premium, we have 1027.58$ so Alice made a profit of 27.58$.

Real Yield: strategies

Smilee vaults can be further expanded to create even more powerful strategies.

Examples of additional features are:

  • A Yield Boost Vault, where users can directly deposit LP tokens earning the DEX APY + a premium. This expands the protocol composability and ensures the strategy always outperform providing liquidity on a DEX
  • A Delta-neutral Vault, to provide liquidity with no direct market exposure
  • A IL-capped Vault, where the Impermanent Loss is capped at a maximum, reducing the overall exposure in extreme scenarios

Real Yield: comparison with existing strategies

The Real Yield Vault is nothing more than providing a full range liquidity position on a DEX , but this time with a real yield in USDC.

Liquidity providers are exposed to Impermanent Loss, but they don’t bear any additional risk (aside from smart contract risk).

Furthermore, Smilee is not affected by maturities mismatch between Real Yield and Impermanent Gain Vaults. This is made possible by adjusting the delta of Real Yield Vault when an Impermamnent Gain Vault reaches maturity. As a result, the final Impermanent Loss is exactly that of a DEX LP provider, no matter what other DVPs do with the Real Yield vault liquidity.

This Real Yield Vault structure makes returns more transparent than other yield providing strategies, such as decentralized option vaults, yield optimizers, lending protocols, which expose users to unclear tail risks , credit risk, liquidation risk, counterparty risk and so on.

Smilee Real Yield Vaults are also more transparent, more predictable and less volatile than Uniswap V3 concentrated liquidity positions.

For example the chart below compares providing liquidity in Smilee Real Yield and providing concentrated liquidity on Uniswap in the (-50%, +50% range).

The pair is ETH/USDC.

Range formula.

Impermanent Gain: make Money in any market direction

Impermanent Gain is the opposite of the Impermanent Loss and it is a strategy designed to bet on volatility.

Users can employ it for different scopes such as:

  • Taking a position before a market moving event (such as the Merge or a FED meeting)
  • Hedging portfolio risks
  • Purchasing insurance on stablecoin depeg or extreme scenarios
  • Arbitrage against an option protocol (eg., buying Impermanent Gain at leverage and selling out of the money put and call options) or against DEX pools
  • DAOs and market makers hedging risks when providing liquidity to DEXs in their own tokens or tokens they support (protocol-owned liquidity)

With volatility in DeFi still being uncharted territory, there are plenty of opportunities abound.

Impermanent Gain: how does it work?

Each Impermanent Gain Vault is defined by:

  • A pair of tokens (eg., ETH / USDC, ETH / BTC, …)
  • A premium in USDC
  • A leverage
  • A strategy (eg., upside only, downside only, plain)
  • A maturity
  • An auction period

During the auction period users enter the Impermanent Gain Vault by paying the premium in USDC. The premium is computed to cover the Real Yield Vault APY.

For instance, given a 10% APY, the weekly premium will be equal to:

10%/52 = 0.19%

The premium also defines the leverage, which is simply:

1/premium -> 1/0.19% = 520

At the end of the auction period, the Impermanent Gain Vault pays the premium to the Real Yield Vault to access its liquidity. Such liquidity is used to recreate the payoff of the Hodl portfolio, which is:

Hodl portfolio formula.

This formula ensures that the sum of the payoff to LPs perfectly matches that of the Impermanent Gain buyers.

At maturity the Impermanent Loss lost by the Real Yield Vault is transferred to the Impermanent Gain Vault. Earning the Impermanent Loss makes it in effect an Impermanent Gain.

At this point users can withdraw the resulting Impermanent Gain from the Vault.

Impermanent Gain: Payoff

EARN: Impermanent Gain

PAY: Initial Premium

The Impermanent Gain (IG) is the difference between equal-weight portfolio value and the LP token value:

Impermanent Gain formula.

Therefore the position value and PnL of the Impermanent Gain buyer are:

Position value and PnL of the Impermanent Gain buyer.

V0 is the notional, P is the premium and L = 1p=V0P is the leverage.

As shown below, buying Impermanent Gain is similar to purchasing options or insurance. If the pair doesn’t move (r = 0), the buyer loses the entire premium paid (P); however, when the pair moves in either direction, the buyer starts earning a payoff.

Buying Impermanent Gain.

When the return of the pair in either direction is large enough to compensate for the premium paid, the buyer reaches his breakeven. After this points, he starts earning a profit.

The breakeven formula is:

Breakeven formula.

You can find the derivation in the appendix.
An Impermanent Loss buyer can never lose more than the amount deposited. As a consequence, Impermanent Gain buyers are not exposed to any liquidation risk, no matter the huge Impermanent Gain Vault leverage.

Impermanent Gain: an example

Bob thinks ETH price will move significantly next week due to a FED meeting. He sees on Smilee that he can purchase an Impermanent Gain DVP for $10,000 in notional value for 1 week by paying just 20 USDC (500x leverage). He goes ahead and deposits 20 USDC into the Impermanent Gain Vault.

According to our breakeven formula we have:

Breakeven formula.

In other words, if ETH moves up more than 13% or down more than 12% in one week, Bob starts earning a profit.

After 1 week, ETH price dropped 20%. Bob’s payoff is

Bob’s payoff formula.

After subtracting the premium, his PnL is 25.55$, that is +128% ROI on his invested premium.

The Impermanent Gain product has been designed to maximize capital efficiency while neutralizing market risks. With leverage up to 500x, Impermanent Gain is one of the most capital-efficient products in DeFi.

Impermanent Gain: closing the position early

Buying an Impermanent Gain DVP does not mean being forced to hold the position until maturity.

If a trader wants to exit his position earlier, he can easily close it. In this case, his payoff will be the Impermanent Gain realized up to that point but he will forfeit the entire premium paid.

Impermanent Gain: strategies

Smilee vaults can be further expanded to create even more powerful strategies.

A first example of additional strategies are:

  • Upside only, to bet only on market upside doubling the leverage (1000x)
  • Downside only, to bet only on market downside doubling the leverage (1000x)

Impermanent Gain: comparison with existing strategies

Impermanent Gain positions are similar to buying out of the money put and call options, but thanks to the power of Smilee primitive, the product ensures extremely competitive pricing and the option of early termination.

In addition, Impermanent Gain Vaults have such a high degree of inherent leverage embedded in them that if taken directionally (eg, upside only IG) can outperform even the most extreme leveraged products, such as perpetuals, without any liquidation risk.

Conclusion

We believe Decentralized Exchanges (DEXs) are here to stay and Automated Market Makers (AMMs) will one day dominate crypto markets as well as traditional finance.

Impermanent Loss is a core part of DEXs and will get more and more relevant over time as traditional assets get tokenized and trading activity moves on-chain.

Smilee is the first platform to leverage Impermanent Loss in order to build products that can be long or short volatility in an open, transparent and permissionless way.

Real Yield and Impermanent Gain, our first products, unlock new opportunities for traders, liquidity providers, and DAOs.

Options protocols, insurance platforms, and stablecoin providers can use Smilee to build products fully on-chain without relying on centralized counterparties.

If you are considering building on top of Smilee, DM us on Twitter.

Follow us on Twitter to get the latest news and insights about Smilee.

Appendix: formulas derivation

Impermanent Loss

Assuming we are providing full-range liquidity the initial quantities of tokens are:

Initial quantities of tokens.

Where L=xy is the liquidity invariant and S is the underlying price: the price of x in terms of token y.

At a certain time t quantities are:

Quantities defined at time t.

At time t, the underlying price St=S0(r+1) where r is the return of token x.

Impermanent Loss (IL) is defined as the value of a LP position minus the value of an equal-weight portfolio, divided by the initial capital invested.

Initial capital invested
LP position value
Equal-weight portfolio value

Substituing into the IL formula, we have:

Impermanent Loss

Real Yield Payoff and PnL

The value of the Real Yield position at time t is equal to the position value of a full-range liquidity provider, therefore:

The Real Yield payoff, denominated in token y

The Real Yield PnL is equal to the Real Yield payoff, minus the initial capital invested V0, plus the premium earned P.

where p = percentage premium p = P / V0.

Impermanent Gain

Impermanent Gain is defined as the opposite of IL.

Impermanent Gain

where r is the return of token x in terms of token y.

Impermanent Gain Payoff and PnL

The Impermanent Gain payoff is the initial capital multiplied by the IG

Impermanent Gain payoff

The Impermanent Gain PnL is equal to the Impermanent Gain payoff, minus the premium paid P.

Impermanent Gain PnL

Breakeven point

To find the breakeven points we have to find the returns such that the PnL of the IG buyer is equal to zero. To do that, given a percentage premium p, we just have to find the zero of the following function:

Where we have substituted

So we have:

And going back to r we obtain:

--

--