Skip to main content
Every swap on a Hadron pool is priced from the oracle price and a spread you define:

The quoting equation

For an input of amount_in, the program computes:
You set everything except the fee: the oracle price, the base spread, both curves and the clamp.
  • A final spread of 0.999 means 10 bps of spread around your oracle price, on both the bid and the ask.
  • Oracle price is quote atoms per base atom in Q32.32, as are factors (1.0 = 2^32).
  • The clamp caps the spread factor at 1.0 by default, so you never quote better than your oracle price. See Risk controls.
  • The fee, and any token transfer fee, comes off the input first. See Fees.

Your curves

Each side of the pool (bid and ask) has two curves you define:
  • price_curve(input_amount) sets the factor by trade size, so larger trades can be priced wider.
  • inventory_curve(your_inventory) sets the factor by your inventory, so your price skews as your position moves without you sending an update.
Each curve can be evaluated in two ways: The quoting equation: price_curve is stateless or stateful, inventory_curve is in % mode or integrated The quoting equation: price_curve is stateless or stateful, inventory_curve is in % mode or integrated
  • Stateless (the default). Every trade reads the price curve from the start, so identical trades get identical prices.
  • Stateful (integrated). Trades use up the curve like a book and pay the average across the depth they take, so a burst of orders walks down it. It refills at a rate you set, or when your crank refills it.
  • % mode. The inventory axis is your share of value in base, as a %. This way you can set how your quotes skew at, for instance, an 80/20 imbalance.
  • Integrated. The inventory axis is your token balance, and the factor is averaged over the inventory move the trade causes.
Strategy examples shows each one in action.

Fees

Hadron charges a protocol fee in parts per million of the input. It’s taken before pricing and sent to the fee recipient. Rates vary by asset type, and high-volume makers get rebates. Fee revenue on a pool can be split between Hadron and you, or across several of your wallets or clients. Contact us for rates (see Fees).