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. Deposits & Withdrawals
  4. Withdrawals
  5. Singled Sided Withdrawals

Withdrawal Price Impact

PreviousSingled Sided WithdrawalsNextImpermanent Loss

Last updated 3 years ago

Was this helpful?

Now let’s assume we are withdrawing from the BAL/WETH 80/20 Pool, we want to remove 5 WETH from the pool not knowing how many pool tokens we will need to redeem. We will be charged swap fees on the portion of our withdrawal which is “off-balance”. In this case 80% of our pool is not in the form of WETH, therefore that is the taxed portion. In this case we know we will receive the total of 5 WETH from the withdrawal, (At), this means our “sent” value will be unknown and slightly higher to compensate the swap fee we are charged.

The current pool traits are as follows:

  • Swap fee: 0.05%

  • BAL: 5,598,984

  • WETH: 5,798.4836

  • BPT: 2,816,401.77912812

This equation can be rearranged to solve for A (sent) in terms of our BPT (P_redeemed) as follows:

Using this equation, we can solve for A (sent):

For our Spot Price:

From here we can calculate the amount of pool tokens we redeemed to receive our 5 WETH:

Then, we must calculate the ratio of the pool’s invariant before and after the withdrawal.

Using the invariant ratio, we can determine the new total number of pool tokens and in the same stroke, calculate the amount of pool tokens needed to exchange for our WETH.

Knowing the amount of BPT we needed to redeem and the amount of WETH we received in the withdrawal we can determine the effective price of a pool token to compare with our spot price:

Please note the swap fee and pool traits change dynamically over time making calculations such as these valid for only a short period of time. The purpose of these examples is to deepen the understanding of our platform for those interested in are already utilizing Balancer Protocol.

At=Bt ∗ (1−(1−PredeemedPsupply)1Wt)A_{t}=B_{t} \ * \ \Bigg(1-\bigg(1-{\frac {P_{redeemed}}{P_{supply}}} \bigg)^{\frac {1}{W_{t}}} \Bigg)At​=Bt​ ∗ (1−(1−Psupply​Predeemed​​)Wt​1​)