Matching
How the solver finds the largest set of transfers that moves every member toward their own target.
What the solver maximizes
Given every signed intent and the round's prices, the solver finds the largest dollar value of transfers between members such that each member sends no more than they offered, receives no more than they asked for, and gets exactly as much value back as they send.
Method
Members and assets form a flow network: sell capacity on member → asset edges, buy capacity on asset → member edges, and an exact value balance at every member. The largest crossed value is a min-cost circulation, solved with minimum-mean cycle canceling. There is no external solver and no randomness.
- Deterministic: the same input always gives the same plan.
- Integer amounts: values are quantized to $0.01 lots; raw token amounts never exceed a member's limits.
- Exact accounting: for every member and asset, matched + left over = requested.
- Honest empty results: zero overlap returns
NO_CROSS. No match is ever manufactured. - Dust: a leftover under $0.10 on a filled asset is rounding dust, too small for any market.
Checked against a reference
A separate reference matcher solves the same problem two other ways (exact rational simplex for small rounds, the HiGHS LP solver for larger ones) and shares no code with the production solver. Tests require both to agree on the optimum value for every generated round.