Maya Protocol One-Stop-Shop
  • Introduction
    • 🍫What is Maya Protocol?
      • Getting Started
      • Roles
        • Liquidity Providers
        • Swappers
        • Arbitrageurs
        • Node Operators
      • Maya Protocol Native Assets
    • 🌐Maya Ecosystem
      • User interfaces & Wallets
      • Tools
    • 🍫How to buy CACAO?
    • 🛣️Roadmap 2025
  • Deep Dive
    • 🚶‍♂️Step-by-Step Guides
      • Set up a MAYAChain wallet
        • Using El Dorito Club
        • Using THORWallet web APP
        • Using THORWallet Mobile APP
        • Through MAYANode cli
        • By importing Ledger hard wallet into Ctrl Wallet
      • Custom Memos
        • Swap
        • Add Liquidity
        • Withdraw Liquidity
    • 🛠️How It Works
      • Technology
      • Incentive Curve
      • Fees
      • Governance
      • Constants and Mimir
      • Security
      • Dynamic Inflation
      • Liquidity Nodes
      • Impermanent Loss Protection (ILP)
      • ELI5
        • What is Threshold Signature Scheme (TSS)?
    • 💵DeFi Products
      • Synthetics
      • Liquidity
    • 🔐Audits
    • 🎭Maya Masks
    • ❓FAQs
  • Blockchain Explorer
    • 🔎MayaScan
      • 🪙MRC-20 Tokens
      • 🖼️M-NFTS
  • Airdrop
    • 🪂$MAYA Airdrops Guide
  • Media
    • 📽️Aaluxx Interviews
    • 🐦Twitter Spaces
    • 🔗Links
  • Contribute
    • 😎Ambassador Program
    • 🎨Content Creators Guide
  • Node Docs
    • 🖥️MAYANodes
      • MAYANode Overview
      • Cluster Launcher
        • Setup - Linode
        • Setup - Azure
        • Setup - Hetzner Bare Metal
        • Setup - Google Cloud
        • Setup - HCloud
        • Setup - Digital Ocean
        • Setup - AWS
      • Deploying
      • Joining
      • Managing
      • Pooled MAYANodes
      • Alerting
      • Leaving
      • 🛑Emergency Procedures
      • ✔️ CHECKLIST
      • Multi-node Deployment
      • Fullnode Installation Guide
    • Bonding & Unbonding Guide
    • Bare Metal Node Guides
  • MAYACHAIN DEV DOCS
    • Introduction
      • MAYAName Guide
      • Swapping Guide
        • Quickstart Guide
        • Fees and Wait Times
        • Streaming Swaps
      • Add MAYAChain to your Wallet
    • Examples
      • Tutorials
      • Typescript (XChainJS) WIP
        • Query Package
        • AMM Package
        • Client Packages
        • Packages Breakdown
        • Coding Guide
      • SwapKit SDK
    • Concepts
      • Connecting to MAYAChain
      • Querying MAYAChain
      • Transaction Memos
      • Asset Notation
      • Memo Length Reduction
      • Network Halts
      • Fees
      • Delays
      • Sending Transactions
      • Math
    • Aggregators
      • Memos
      • EVM Implementation
    • CLI
      • Multisig
      • Offline Ledger Support
    • Protocol Development
      • Adding New Chains
      • Chain Clients
        • UTXO
        • EVM Chains
        • Cosmos Chains
      • ERC-20 Tokens
      • THORChain Version Updates I
      • THORChain Version Updates II
  • White Paper
    • 📖Maya Whitepaper 2.0
      • Introduction
      • 🍫Fair Launch
        • Philosophical perspective FL
        • Economic overview FL
        • Technical overview FL
      • 🪙$MAYA token
        • Philosophical perspective MT
        • Economic overview MT
        • Technical overview MT
      • 🌊Liquidity Nodes
        • Philosophical perspective LN
        • Economic overview LN
        • Technical overview LN
      • 🔒Security Nodes
        • Philosophical perspective SN
        • Economic overview SN
        • Technical overview SN
      • 🔴Aztec Chain & $AZTEC token
        • Philosophical perspective AC
        • Economic overview AC
        • Technical overview AC
      • ⚖️Stable Pools & Route Optimization
        • Philosophical perspective RO
        • Economic overview RO
        • Technical overview RO
      • 👣Roadmap. Maya 3.0
        • Philosophical perspective 3.0
        • Economic overview 3.0
        • Technical overview 3.0
  • Website
  • GitLab
  • Archive
    • Liquidity Auction
    • THORChads Airdrop
    • Add ETH, USDC, or USDT through THORWallet using Metamask + Ledger
    • $MAYA Airdrop for Maya Mask Holders
    • Maya Integration Guide
    • Roadmap 2023
Powered by GitBook

Social Media

  • Twitter
  • Telegram
  • Discord
On this page

Was this helpful?

Export as PDF
  1. Deep Dive
  2. How It Works

Impermanent Loss Protection (ILP)

What is Impermanent Loss Protection (ILP) and how does it work?

Impermanent Loss refers to the temporary loss that liquidity providers (LPs) may experience when providing liquidity to decentralized exchanges (DEXs). It arises due to the constant fluctuations in the prices of crypto assets. MAYAChain aims to address impermanent loss through its Impermanent Loss Protection mechanism.

Maya Protocol ILP Rules:

  1. Impermanent Loss Protection is funded from the Maya Protocol Reserve, which is 10% of CACAO supply (10m CACAO). Refilled constantly and automatically with 10% of the protocol fees (transaction & swap fees).

  2. ILP on Maya starts on the 50th day after depositing liquidity, and coverage is capped at 100%.

    • If ASSET outperforms CACAO, full coverage is after 150 days (50 days after initial deposit + 100 days in LP).

    • If CACAO outperforms ASSET, full coverage is after 450 days (50 days after initial deposit + 400 days in LP).

  3. ILP is calculated at the time the user withdraws liquidity.

    • If the ASSET outperforms CACAO, the ILP is 1% daily. So, if the user withdrew after 150 days, they would get 100% protection. If the user withdrew after 100 days, they would get 50% protection.

    • If CACAO outperforms the ASSET, the ILP is 0.25% daily. So, if the user withdrew after 450 days, they would get 100% protection. If the user withdrew after 250 days, they would get 50% protection.

    • If fees cover the Impermanent Loss, the LP isn’t eligible for ILP.

  4. ILP is paid and reset after full withdrawal, not affected by partial withdrawals, and only reset but not paid on top-ups.

  5. ILP is always recorded and calculated symmetrically (ASSET-CACAO). So even if you deposited asymmetrically (single asset), the deposit values are NOT the amounts the user deposited. They are the immediate symmetrical (ASSET-CACAO) value of what the user deposited.

The impermanent loss protection can be mathematically Calculated using the following process.:

  1. Calculate the amount to cover in CACAO.

  2. Calculate the percentage of coverage.

Step 1: Calculate the amount to cover in CACAO.

Where:

A0 = Initial ASSET amount deposited.

A1 = ASSET amount to be redeemed upon withdrawal.

R0 = Initial CACAO amount deposited.

R1 = CACAO amount to be redeemed upon withdrawal.

P1 = LP ratio of the pool upon withdrawal.

Amount to cover in CACAO = ((A0*P1)+R0) – ((A1*P1)+R1)

Example:

Assuming the ASSET is USDT and the LP initial amounts were (100 USDT + 1,000 CACAO), and (80 USDT + 1100 CACAO) at withdrawal, and the LP ratio of the pool is 1% (0.01).

((100*0.01)+1000) – ((80*0.01)+1100) = 1001 – 1100.8 = -99.8 CACAO

Step 2: Calculate the percentage of coverage.

First we need to determine if CACAO was outperforming (400, after 50, days to full coverage) or underperforming (100, after 50, days to full coverage).

In the above case CACAO has been underperforming. So 100 days to full coverage.

As a rule of thumb, if you deposit 2 assets, and at withdrawal you got more of an asset and less of the other compared to the initial deposit, the asset you got more of, is the asset underperforming. Think of it like this; people were giving away the less desirable asset and taking more of the other.

Now we need to calculate the length of time liquidity has been deposited, to determine percentage of coverage.

Blockchains don’t have clocks, but they have blocks, and we can derive the time from the number of blocks per second. In Maya’s case it’s around 6 seconds per block, or 14,400 a day.

So,

Percentage of coverage = (block no. at withdrawal – block no. at deposit - 50 days of blocks)/ (number of blocks a day * number of days to full coverage)

Example:

Block no. at withdrawal = 2,456,000.

Block no. at deposit = 900,000.

Percentage of coverage = (2,456,000 – 900,000 -(14,400 * 50))/ (14,400 *100) = 0.58 or 58%.

This means that LP will be protected with (99.8 CACA0 * 0.58) = 57.88 CACAO.

PreviousLiquidity NodesNextELI5

Last updated 5 months ago

Was this helpful?

🛠️