materraldocs

Using Materral

Paper trading. Test a gap against the live market.

A paper trade replays a route's legs against the live quotes after each leg's latency, then compares the realised result with what Materral expected. No order is sent anywhere.

The trade ticket#

  1. Size#

    Start from a gap and confirm the size. The ticket prices both legs at that size from the current books and pools.

  2. Review#

    Check each leg's expected VWAP, the limit price (expected VWAP ± max slippage), the cost lines and the expected net. Max slippage defaults to 10 bps.

  3. Place#

    Place the paper trade. Each leg is submitted at once and fills after its leg latency, 2 s by default (an assumption). The trade then settles into one of the outcomes below. A route with a blocking flag, such as a stale quote or a down feed, cannot be placed.

The fill model#

The model is deliberately conservative.

  • Each leg is an immediate-or-cancel order with a limit at the expected VWAP ± max slippage.
  • It fills after the leg latency, against the live quote current at that moment, not the quote you saw.
  • Book legs fill level by level up to the limit; the rest is cancelled, so a partial fill is possible.
  • If the depth snapshot is older than the best bid/offer, that side's levels are shifted by the drift first.
  • Pool legs fill fully or revert, like a swap with a minimum output. That includes size beyond the current tick range.
  • The legs are separate, non-atomic orders. One can fill while the other fails, leaving you exposed.

What can fail, and why#

ReasonWhat happened
no_fresh_quoteThe quote was stale or missing at fill time. A leg never fills against old prices.
feed_downThe venue's feed was down at fill time.
slippageThe price moved past the limit.
exceeds_tickA pool leg needed more size than the loaded tick range could price, so it reverted.
no_liquidityNothing could be filled.
interruptedThe leg was still unfilled 15 s after it was due, usually because the page was closed or paused.

Outcomes#

  • Complete: both legs filled.
  • Legged out: the legs did not fill the same amount (one failed, or one filled only partly), leaving residual exposure. It can be unwound at market.
  • Failed: nothing filled.
  • Closed: a legged-out trade that was unwound back to flat.

Reading expected vs realised#

  • Expected net is what the route showed when you placed it, including the latency-risk charge.
  • Expected cash is the same net before the latency-risk charge. That charge is a risk allowance, not money spent, so this is what realised is compared with.
  • Realised net is the USDC result of every filled leg, its fees and gas. Leftover inventory is valued at mid and shown separately as residual; it is marked, not realised.
  • Error is realised minus expected cash. Slippage per leg is realised VWAP versus expected, against you (positive is worse).
  • Pool fees are inside the realised VWAP, not in the fee line.

What the model cannot see#

  • your queue position;
  • hidden liquidity;
  • other traders reacting to your order;
  • gas price spikes between decision and fill;
  • real transfer times between venues (rebalancing is not modelled).

Paper trades are kept in your browser's local storage. Every one is labelled PAPER.

materral docs. Read-only, no keys, no real orders. Not investment advice.