šŸ“š
Duality Documentation
  • What is Duality?
  • Concepts
    • AMMs and Orderbooks
    • Liquidity Pools
    • Ticks
    • TickLiquidity
      • Pool Reserves
        • Fees
      • Limit Order Tranches
    • Liquidity Iteration
    • Swaps
    • Overview
  • Module Documentation for Developers
    • DEX Module
      • Transaction Messages
        • Deposit
        • Withdrawal
        • MultiHop Swap
        • Place Limit Order
        • Cancel Limit Order Message
        • Withdraw Filled Limit Order
      • Queries
  • Dictionary
  • Advanced Concepts
    • Replicating Market Makers
    • Shared Liquidity
  • User Interface
Powered by GitBook
On this page
  1. Concepts

Ticks

Overview of how Ticks work on Duality

Ticks are the fundamental unit of accounting within the dex. Each tick is an integer between 352437 and -352437. All tradeable liquidity, in the form of either `PoolReserves` or `LimitOrderTranche`s is stored at a specific tick. The price of liquidity being stored at tick is determined by the function:

p(i)=1.0001ip(i) = 1.0001^{i}p(i)=1.0001i

Some examples:

  • Price of tick 0:0:0: p(0)=1.00010=1p(0) = 1.0001^0 = 1p(0)=1.00010=1

  • Price of tick 400040004000 : p(4000)=1.00014000ā‰ˆ1.4917p(4000) = 1.0001^{4000} \approx 1.4917p(4000)=1.00014000ā‰ˆ1.4917​

  • Price of tick āˆ’4000-4000āˆ’4000 : ​p(āˆ’4000)=1.0001āˆ’4000ā‰ˆ0.6703p(-4000) = 1.0001^{-4000} \approx 0.6703p(āˆ’4000)=1.0001āˆ’4000ā‰ˆ0.6703

More specifically price refers to the rate at which Token1 can be converted to Token0. Logically, the converse rate for converting Token0 to Token1 can be expressed as:

price0To1(i)=1/1.0001iprice0To1(i) = 1/1.0001^{i}price0To1(i)=1/1.0001i

PreviousLiquidity PoolsNextTickLiquidity

Last updated 10 months ago