Onchain.DEX.Router.Route (onchain v0.7.0)

Copy Markdown View Source

The result of an Onchain.DEX.Router.route/5 query: the output-maximizing path through a candidate pool set.

  • :path — token addresses (normalized lowercase hex) from input to output.
  • :pools — pool addresses (normalized lowercase hex), one per hop.
  • :amount_in / :amount_out — raw integer amounts (caller normalizes with Onchain.Decimal).
  • :hops — number of pool hops (length(pools)).

Summary

Types

t()

@type t() :: %Onchain.DEX.Router.Route{
  amount_in: non_neg_integer(),
  amount_out: non_neg_integer(),
  hops: non_neg_integer(),
  path: [String.t()],
  pools: [String.t()]
}