Rujira.Fin.Events.TradeRange (rujira_ex v0.0.8)

Copy Markdown View Source

A single range touched by a concentrated-liquidity trade.

The contract joins one entry per range into the trade event's ranges attribute with commas. Each entry is colon-separated. The leading segment is the range id, which itself embeds the price bounds as idx:low-high, so a full entry has the shape:

  • base-side fill: idx:low-high:base:quote:deduct:add::fee (7th slot empty)
  • quote-side fill: idx:low-high:base:quote:deduct:add:fee: (8th slot empty)

All amounts and bounds are the range's internal full-precision Decimal values, not 8-decimal token integers.

Summary

Types

t()

@type t() :: %Rujira.Fin.Events.TradeRange{
  add: Decimal.t(),
  base: Decimal.t(),
  deduct: Decimal.t(),
  fee: Decimal.t(),
  high: Decimal.t(),
  idx: non_neg_integer(),
  low: Decimal.t(),
  quote: Decimal.t(),
  side: :base | :quote
}

Functions

parse(entry)

@spec parse(String.t()) :: {:ok, t()} | {:error, term()}

parse_list(value)

@spec parse_list(nil | String.t()) :: {:ok, [t()] | nil} | {:error, term()}