Skip to main content

Post-Trade Execution

Multiswap solves Reserve Asset swaps using the prices after the reserve exchange.

For asset i, let da_i be the signed reserve change and P'_i its ending pool price. The leg’s signed value flow is:

Σi=Pidai.\Sigma_i=P'_i\,da_i.

Pay legs have positive flow; receive legs have negative flow. For the complete fee-free reserve exchange:

iΣi=0.\sum_i\Sigma_i=0.

Every asset uses the same pool scale unit. Value conservation compares amounts expressed in that common scale unit.

How the engine finds an amount

Let opening reserve be a_i, scale be s_i, relative reserve change be r_i = da_i / a_i, and pool scale elasticity be e_s.

sigma_i = r_i * (1 + r_i)^(e_s - 1)
Σ_i = s_i * sigma_i

The pay amounts determine incoming value flow. Receive allocations assign that value across assets. The engine inverts the normalized function sigma_i to find each receive reserve change.

The entire reserve leg is valued at its ending price. The order is one finite action; splitting it into multiple transactions produces a sequence of separately priced actions and can change the combined result.

Price impact and fees

Price impact comes from the reserve and scale changes required by the exchange. A fee is an explicit allocation from the gross receive quote. User receive quotes are net of that fee.

Surplus settlement can use a smaller reserve exchange and fund the difference from inventory held outside reserves. The reserve exchange and the user’s complete payout then have different sources. See Fees and Surplus.

Value retention and LP earnings

The zero-sum value-flow identity means the reserve exchange receives the value it pays out when every leg is valued at its ending pool price. That is the value-retention property of post-trade execution.

Trading fees are explicit income alongside that exchange. Current settlement credits them to Rewards accounts; the pool’s payout rules determine their distribution or reinvestment for LPs. The portfolio’s market exposure and its trading income together define the LP economics. See Portfolio Exposure and Trading Income.

Scope of the accounting statement

Balancing value at ending pool prices connects reserve execution to the resulting pool valuation. Returns measured at external prices depend on market movements and asset performance. Administrative and capitalization actions follow their own accounting rules.

The docs describe implemented operations. Proofs, comparisons, and proposed extensions are published in the blog.