Price

Type Alias Price 

Source
pub type Price = u32;
Expand description

Each tick represents 0.0001 (1/10,000) of the base unit Examples:

  • $0.6543 = 6543 ticks
  • $1.0000 = 10000 ticks
  • $0.0001 = 1 tick (minimum price increment)

Why u32?

  • Can represent prices from $0.0001 to $429,496.7295 (way more than needed)
  • Fits in CPU register for fast operations
  • No sign bit needed since prices are always positive