LogoLogo
  • ☠️Introduction
    • What is Clipper?
    • How Clipper Makes Money for LPs
    • How LPs Earn from Arbitrage
    • Clipper's Benchmark: No Impermanent Loss
      • Clipper vs. CPMMs vs. HODLing
      • Appendix: Math
    • Why Clipper Has Better Trading Prices
    • DAO Protocol Fees
    • DAO Governance
  • βš”οΈHow to Use Clipper
    • Liquidity Pools
      • Depositing & Withdrawing
      • Farming Pools
    • Trading
    • Community Adventures
    • FAQs
  • πŸͺ™Governance Token
    • Community Governance
    • β›΅SAIL Primer
      • Clipper Fundamentals
      • DEX Market Structure
      • SAIL Supply & Circulation
      • SAIL Farming
      • veSAIL
      • Token Listings
  • πŸ΄β€β˜ οΈDisclaimers & Technical
    • Audits
    • Smart Contracts
      • Subgraph
        • Entities
        • Queries
    • Integrating with Clipper RFQ
      • Introduction
      • Guides
        • How to use clipper RFQ API?
        • Estimate Clipper Prices
        • Interacting with the Clipper Exchange contracts
        • Integration Examples
          • Swap Native token β†’ Shorttail
          • Swap Shorttail β†’ Native token
          • Swap Shorttail β†’ Shorttail
          • Complete Swap Flow
      • API Reference
        • API v2
          • Overview
          • Pool v2
          • Quote v2
        • API v1
          • Overview
          • Pool
          • Quote
          • Sign
      • Troubleshooting & FAQs
    • Terms of Service
    • Privacy Policy
  • β›΅Come Aboard
    • Discord
    • Twitter
    • Github
Powered by GitBook
On this page
  • Setup
  • Calculating Daily Returns & Benchmarks
  • Daily Crypto Basis Returns
  • Rebalanced Portfolio Benchmark
  • CPMM Loss Benchmark

Was this helpful?

  1. Introduction
  2. Clipper's Benchmark: No Impermanent Loss

Appendix: Math

Setup

Each day we have five relevant values:

  • Yesterday’s asset prices in dollars, p’

  • Today’s asset prices in dollars, p

  • Yesterday’s (human) quantity vector, q’ on a per LP token basis

  • Today’s (human) quantity vector, q on a per LP token basis

  • Our target wealths vector, v, which we take to be wealth fractions:

βˆ‘ivi=1Β Β Β viβ‰₯0\sum_i v_i = 1 \ \ \ v_i \geq 0iβˆ‘β€‹vi​=1Β Β Β vi​β‰₯0

Observe that v should tend to be proportional to the actual wealth (q_i*p_i) on each asset i.

Calculating Daily Returns & Benchmarks

All of these benchmarks are designed so that 0 represents no change. Since the values are expected to be small, they may not need to have log taken for additive basis points.

Daily $ Returns

βˆ‘ipiqiβˆ’βˆ‘ipiβ€²qiβ€²βˆ‘ipiβ€²qiβ€²\frac{\sum_i p_iq_i - \sum_i p'_iq'_i}{\sum_i p'_iq'_i}βˆ‘i​pi′​qiβ€²β€‹βˆ‘i​pi​qiβ€‹βˆ’βˆ‘i​pi′​qi′​​

This measures how much the portfolio increased in $ terms since yesterday.

Daily Crypto Basis Returns

βˆ‘ipiqiβˆ’βˆ‘ipiqiβ€²βˆ‘ipiqiβ€²\frac{\sum_i p_iq_i - \sum_i p_iq'_i}{\sum_i p_iq'_i}βˆ‘i​pi​qiβ€²β€‹βˆ‘i​pi​qiβ€‹βˆ’βˆ‘i​pi​qi′​​

This value will be negative if we would prefer yesterday’s portfolio to today’s portfolio at today’s prices.

Rebalanced Portfolio Benchmark

βˆ‘i(pipiβ€²)viβˆ’1\sum_i \left(\frac{p_i}{p'_i}\right) v_i - 1iβˆ‘β€‹(pi′​pi​​)viβ€‹βˆ’1

This is our target benchmark for Clipper: our daily dollar gain should track it closely and ideally outperform.

Observe that a rebalanced portfolio can outperform a static (”held”) portfolio consisting of any (!) initial combination of the assets themselves. For instance, imagine the two-asset case consisting of a risky asset and a stablecoin. On day one, the risky asset doubles in price. On day two the risky asset returns to its original value. It can be verified that a 50-50 rebalanced portfolio will return 1.125x, vs. 1x for simply holding any combination of assets for the two days.

CPMM Loss Benchmark

In the CPMM, we have that:

∏qivi=Cβˆ‘ivilog⁑qi=log⁑C\begin{align*} \prod q_i^{v_i} & = C \\ \sum_i v_i \log q_i & = \log C \end{align*}∏qivi​​iβˆ‘β€‹vi​logqi​​=C=logC​

Day-to-day, the portfolio of the CPMM changes to have wealth proportional to the new set of prices. By working out this constant log-sum, we get the following expression for how much β€œimpermanent” loss a CPMM mechanism takes on:

∏i(pipiβ€²)viβˆ’βˆ‘i(pipiβ€²)viβˆ‘i(pipiβ€²)vi\frac{\prod_i \left( \frac{p_i}{p'_i} \right)^{v_i} - \sum_i \left( \frac{p_i}{p'_i} \right)v_i}{\sum_i \left( \frac{p_i}{p'_i} \right)v_i}βˆ‘i​(pi′​pi​​)viβ€‹βˆi​(pi′​pi​​)viβ€‹βˆ’βˆ‘i​(pi′​pi​​)vi​​

This value is at most 0 when the prices are the same. Clipper’s crypto performance (loss or gain) should substantially outperform this benchmark.

PreviousClipper vs. CPMMs vs. HODLingNextWhy Clipper Has Better Trading Prices

Last updated 1 year ago

Was this helpful?

☠️