🦓
Zebra Docs
  • 🏠HOME
  • 💡Overview
    • About Zebra
    • Roadmap
    • Contact Us
  • 🧭Product Guides
    • How to Set Up Scroll Wallet
    • How to cross-chain assets to Scroll Mainnet
  • 1️⃣V1 guide
    • How to Swap
    • How to Add Liquidity
    • How to Create a Liquidity
  • 2️⃣V2 guide
    • How to migrate liquidity from Zebra v1 to v2
    • 🎯V2 Liquidity Guidelines
      • How to add a liquidity
      • How to remove liquidity from V1
      • 🚀Getting started with V2
        • Why is liquidity position ownership represented by tokens or NFTs?
        • How to collect fees from a liquidity pool on Zebra v2
  • ❓Q&A
    • Do I get "liquidated" if the price goes outside of my range?
    • Why is my liquidity position not evenly split between the two tokens?
    • How to change the price range of a liquidity position
    • Why does the price input automatically round?
    • What are fee tiers?
    • What is a liquidity provider (LP) fee?
  • 🦓Product
    • Swap
    • Fees
  • 🔐Contracts and Security
    • Contracts
    • Security Audit
  • 🗃️OTHERS
    • Media
    • FAQ
Powered by GitBook
On this page
  1. Q&A

Why does the price input automatically round?

PreviousHow to change the price range of a liquidity positionNextWhat are fee tiers?

Last updated 1 year ago

When providing liquidity using Zebra v2, your input price will always round to the nearest

This is because Zebra v2 divides prices up into intervals known as ticks.

The size of tick spacing is relative to the fee tier. The tick spacing is double the size of the fee tier. For example, a tick for 0.30% fee tier pool will be 0.60% in size.

This spacing does not apply to the 0.01% fee tier. The 0.01% fee tier has a size of 0.01%.

There is a tick for every price 1.0001n, where n is an integer. This is the number generally seen quoted on exchanges and data sources. This would be the price of 1 token relative to a single token of the other. Here are the pricing formulas:

Basic_math_example__4__pdf.png

Here is an example of how the price is rounded to the nearest tick:

A liquidity provider (LP) wishes to deposit into the ETH/USDC pool with:

  • 0.30% fee tier

  • price range of 1,000 to 5,000 USDC per ETH

The nearest low price tick for the $1000 would be 207240.*

We then use the price1 formula from above to get USDC price of 1000.302013.

The nearest high price tick for the $5000 would be 191160.*

We then use the price1 formula from above to get the USDC price of 4993.922001.

With these price inputs of 1,000 and 5,000, the liquidity positions price inputs will round to 1000.3 and 4,993.92 USDC per ETH.

*This number was calculated using this formula.

Basic_math_example__10__pdf.png
Basic_math_example__10__pdf.png
❓
tick.