SpiritSwap V2
  • 👻SpiritSwap V2 introduction
  • ✅Getting Started
  • 🗺️Roadmap
    • 🚉Canto Chain
  • 📖General Resources
  • 📢Marketing Material
  • CORE FEATURES
    • 🏧Exchange
      • 🦄vAMM
    • 🏬Liquidity
      • 🦄vAMM
      • ⚖️Balanced AMM (V2.1)
    • 💰Protocol Fees
      • 🦄vAMM fees - 0.18%
      • 🔀Stable Swap fees - 0.04% (customizable fees)
      • ⚖️(V2.1)Weighted pool fees - Dynamic
    • 👩‍🌾Yield Farms
      • 📟Gauges
      • ♻️Permissionless Ecosystem Farms (V2.5 Update)
    • 🗝️inSPIRIT
    • 🌉Bridge
    • 🧪Subcore Feature
      • 🔑Wrapped inSPIRIT
      • 🔖Ola Lending
  • TOKENOMICS
    • 🌎Overview
      • 💪REAL YIELD
    • 🪙$SPIRIT
      • ⏳Emissions
      • ❌Risks
    • 🗝️inSPIRIT
      • 🔄inSPIRIT weekly distribution
      • 🗳️Governance over SnapShots
      • 🔥Farm Boost
      • 🤑Bribes
  • BLOCKCHAIN DATA
    • ☄️Contracts
  • SOULLY'S HOW TO
    • 👨‍💻Pull SpiritSwap data feeds using Covalent API
    • 🦮Guide Overview
    • 🦊How to - Connecting to Metamask
    • 🌉How to - Bridge
    • 🔁How to -Exchange
      • 📔How to - Swapping Tokens & Limit Orders
    • 💦How to - Liquidity
    • 🧑‍🌾How to - Yield Farming
    • 🗝️How to - inSPIRIT
    • 📊How to - Dashboard / Portfolio
    • 💵How to - Lending and Borrowing
    • ✍️How to - Gauge Voting and Bribes
    • 🌾How to - Create a farm
    • ✅How to - Verify Contracts
      • 📃Verify Gauge Contract
    • 🖥️How to - Apply for Whitelist
  • CANTO
    • 🌉Bridging to Canto EVM
  • ARCHIVED
    • 🐵Ape mode
    • ☄️Contracts
Powered by GitBook
On this page
  1. CORE FEATURES
  2. Exchange

vAMM

SpiritSwap provides users a simple way to swap tokens on Fantom via automated liquidity pools

PreviousExchangeNextLiquidity

Last updated 3 years ago

SpiritSwap provides users a simple way to swap tokens on Fantom via automated liquidity pools. In a swap, one token is sold to buy another token. The rate of the swap is determined by the AMM with the equation: x∗y=kx*y=kx∗y=k

Where x = the number of $AAA tokens, y = the number of $BBB tokens, and k is a constant. The trader is charged a 0.18% fee to make a swap.

In Figure 1, a trader is swapping $AAA token for $BBB tokens. The trader sends 100 $AAA tokens to the AMM. A 0.18% fee is applied and 0.18 $AAA tokens are not included in the swap. The remaining 99.82 $AAA tokens are swapped in the AMM to $BBB tokens. Since the AMM will be losing $BBB tokens, it must gain $AAA tokens to keep k constant. The equation:

(1,000+99.7)∗(10−y)=10,000(1,000+99.7)*(10-y)=10,000 (1,000+99.7)∗(10−y)=10,000

Can be solved for y to give the number of $BBB tokens that the trader will receive. The 0.18% fee of 0.18 $AAA tokens are directly added to the liquidity pool reserves, slightly increasing the value of k.

🏧
🦄