Tick
Tick-based pricing utilities for DEX price conversions.
Prices on Tempo's stablecoin DEX are discretized into integer ticks with a tick size of 0.1 bps
(where price = PRICE_SCALE + tick and PRICE_SCALE = 100_000). Orders must be placed at ticks
divisible by TICK_SPACING = 10 (1 bp grid), within bounds of ±2000 ticks (±2%).
Examples
import { Tick } from 'ox/tempo'
const price = Tick.toPrice(100) // "1.001" (0.1% above 1.0)
const tick = Tick.fromPrice('0.999') // -100Functions
| Name | Description |
|---|---|
Tick.fromPrice | Converts a price string to a tick. |
Tick.toPrice | Converts a tick to a price string. |
Errors
| Name | Description |
|---|---|
Tick.InvalidPriceFormatError | Error thrown when a price string has an invalid format. |
Tick.PriceOutOfBoundsError | Error thrown when a price string results in an out-of-bounds tick. |
Tick.TickOutOfBoundsError | Error thrown when a tick value is out of the allowed bounds. |
Types
| Name | Description |
|---|---|
Tick.Tick | Tick type. |

