LogoLogo
  • Learn about Balancer
  • Background
    • Team Goal
  • Fundamentals
    • White Paper
      • The Value Function
        • USDC WETH WBTC 33/33/33
        • BAL WETH 80/20
        • Price Change Proof
      • Spot & Effective Price
        • Spot Price
        • Effective Price
        • Price Impact
        • Price Impact - With Swap Fees
      • Trading Formulas
        • Out-Given-In
          • Including Swap Fees
        • In-Given-Out
          • Including Swap Fees
        • In-Given-Price
          • In-Given-Price Proof
          • Arbitrage 80/20
          • Arbitrage 50/50
        • Summary
      • Deposits & Withdrawals
        • Deposits
          • Proportional Deposits
            • BAL / WETH 80/20
          • Single Sided Deposits
            • Price Impact; 10,000 BAL
            • Price Impact; 100,000 BAL
          • Multi-token Deposits
            • Price Impact WMATIC / MTA / WETH
            • Price Impact [2] WMATIC / MTA / WETH
        • Withdrawals
          • Proportional Withdrawals
            • BAL/WETH 80/20
          • Singled Sided Withdrawals
            • Withdrawal Price Impact
    • Impermanent Loss
      • 50/50 Pools
      • 80/20 Pools
      • Multi-token Pools
    • veBAL Tokenomics
      • TLDR
      • Vote-Escrowed Governance
      • Financial Implications
        • Boosting BAL Incentives
          • Minimum veBAL for Max Boost
          • Maximum Boost
          • Calculating my Boost
          • Boost Delegation for Contract Wallet
        • Protocol Revenue Distribution
        • Gauge Voting
      • Inflation Schedule
      • veBAL FAQ
  • More Information
    • For Developers
      • GitHub Integration
    • For Support
    • References & Related Content
  • Documented Questions
    • Coming soon
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Fundamentals
  2. White Paper

Spot & Effective Price

This section will outline spot price and effective price with the end goal of explaining how price impact, also known as slippage in some cases, is calculated.

PreviousPrice Change ProofNextSpot Price

Last updated 3 years ago

Was this helpful?

In order to understand how swaps are going to alter the price of tokens in a pool we must understand the relationship between the spot and effective prices tokens assign to one another as pools go on and off balance. In theory trades in any market are working with a mechanism of price impact. Supply and demand is the root logic, where as you take more of something out of circulation, it becomes more valuable. For example people consume more of a certain product, the price will go up because there is less of it. This happens in an extreme way when swapping a large amount of tokens. The value of what you want goes up, the value of what you are selling in turn will go down.

Dissecting the spot price and effective price functions followed by some small scale and real scale examples will bring us to understand price impact.

The Spot Price as defined in the Whitepaper:

SPio=BiWiBoWoSP_{i}^{o}={\frac {\frac {B_{i}}{W_{i}}}{\frac {B_{o}}{W_{o}}}}SPio​=Wo​Bo​​Wi​Bi​​​

Where the variables represent the following:

  • SP(i^o) is the spot price of the input and output tokens in the pool.

  • B(i) is the balance of the token coming into the pool (input)

  • W(i) is the weight of the token coming into the pool (input)

  • B(o) is the balance on the token going out of the pool (output)

  • W(o) is the weight of the token going out of the pool (output)

Important to note that these variables are from a pool in a stagnant state. Do not incorporate the swap you are planning in to do by adding or subtracting the balance changes you will create in your swap at this point.

Balancer Labs Documentation:

Swaps Fees standard Math
Swap documentation for developers
Smart Order Router