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
  3. Spot & Effective Price

Effective Price

Here a guide and example of how effective price is calculated will be shown below. Please reference prior portions of this section, trading formulas, or the whitepaper for references.

PreviousSpot PriceNextPrice Impact

Last updated 3 years ago

Was this helpful?

Next, we will look at the Effective Price which in short will consider the impact on the price you are making on the tokens as you make a trade. Note investing in a pool if it is not of perfect proportion is using the same principle in calculating price impact. The white paper shows the following formula:

EPio=AiAoEP_{i}^{o}={\frac {A_{i}}{A_{o}}}EPio​=Ao​Ai​​
  • EP(i)^(o) represents the effective price of the token input in terms of the token output

  • A(i) represents the number of tokens one will input (sell)

  • A(o) represents the number of tokens one will output (buy)

This equation is not much use to us as we want to predict the effective price, and with the formula above we can only do this knowing the number of tokens we will get out of a trade. With the effective price increasing as we buy more of a token the above equation needs to be manipulated.

This brings us to the the Out-Given-In Function (see proof on )

Ao=Bo ∗ ( 1−(BiBi+Ai)WiWo )A_{o}=B_{o} \ * \ \Bigg( \ 1-\bigg({\frac{B_{i}}{B{i}+A_{i}}}\bigg)^{\frac{W_{i}}{W_{o}}} \ \Bigg)Ao​=Bo​ ∗ ( 1−(Bi+Ai​Bi​​)Wo​Wi​​ )

Through substituting this equation into our Effective Price equation, we get the following relationship based strictly on variables which are known prior to a trade.

EPio=AiBo ∗ ( 1−(BiBi+Ai)WiWo )EP_{i}^{o}={\frac {A_{i}}{B_{o} \ * \ \Bigg( \ 1-\bigg({\frac{B_{i}}{B{i}+A_{i}}}\bigg)^{\frac{W_{i}}{W_{o}}} \ \Bigg) }}EPio​=Bo​ ∗ ( 1−(Bi+Ai​Bi​​)Wo​Wi​​ )Ai​​

Example Calculations for (BAL WETH 60/40 on Arbitrum)

Known pool trait values:

We are willing to trade 10 WETH in. We will determine how much BAL we will receive and what the price impact of our trade is. We well repeat this for 100 WETH to compare the results.

With these known values we can solve our effective price equation.

The same equation for 100 WETH yields the following:\

Clearly much more WETH is needed to buy a single BAL token, this adds up and grows as the amount going into a trade does. The market is being moved by the trade (within the confines of the pool).

Using this information, we can now calculate the price impact based on ratio between the spot price and the effective price. In theory the spot price equals the effective price only for extremely small trades. (See Balancer )

whitepaper
whitepaper