Post-Trade Elasticity: The Complete Multiswap Model
Multiswap is a multi-asset exchange built from three native quantities: reserve, scale, and marginal price. The Post-Trade Elasticity Model specifies how those quantities change under an atomic swap, how LP Token liquidity actions extend the same state space, and which internal safety properties follow from the resulting coefficient dynamics.
The model has one central distinction:
- a token can move along a fixed elastic curve because its reserve changes;
- an operation can move the token to a different elastic curve because its coefficient changes.
This distinction unifies the reserve-to-price homomorphism with the complete price law. Swaps keep every Reserve Asset coefficient fixed. Liquidity actions can change the coefficients of nonparticipating Reserve Assets through one common multiplier. The complete transformation remains multiplicative. The reserve ratio describes the fixed-coefficient case, while the coefficient ratio extends the same structure to liquidity actions.
This article develops the complete framework from first principles. It covers atomic -to- swaps, finite-step divergence, market depth, user-controlled splitting, LP Token liquidity, the exact liquidity-dispersion boundary, gauge-invariant safety, a qualified value-flow entropy, parameter changes, deposit phases, and the current implementation boundary.
Status: Exact-arithmetic research model, August 2026. The swap equations assume positive reserves and scales, one fixed homogeneous elasticity , fee-free post-trade settlement, and exact enforcement of the equations below. The liquidity-dispersion and projective safety theorems use ; the constant-weight boundary has its own exact swap and liquidity identities. The Solidity branch now implements Reserve Asset swaps, proportional LP Token liquidity, receive fees, Surplus settlement, and oracle-valued deposit phases using
FloatLib. The updated model is deployed on Robinhood Testnet. General unequal liquidity actions discussed below remain mathematical analysis rather than supported contract operations; security review remains a separate obligation.
1. Native Multiswap state
Let a pool contain Reserve Assets. Reserve Asset has reserve
scale
and marginal price
Scale is the market-value magnitude assigned to the Reserve Asset in the pool's internal numeraire. Marginal price is scale per unit of reserve.
The LP Token has reserve , scale , and marginal price
Its scale is total Reserve Asset scale:
This identity is fundamental. Reserve Asset scales are the components; LP Token scale is their sum. Weights are derived market-value ratios,
whose values follow from reserve and scale.
For a signed reserve change , define
The sign is from the pool's perspective:
- means the pool receives the token;
- means the pool sends the token.
The final reserve is
Every supported operation must leave every reserve and scale strictly positive.
2. Elasticity and the coefficient
Choose one homogeneous scale elasticity
and define price elasticity by
When a token stays on the same elastic curve, its scale changes as
Because ,
Define the token's elasticity coefficient by
Then
and
The coefficient identifies the elastic curve. Changing with fixed moves the token along that curve. Changing moves the token to another curve.
2.1 The constant-weight boundary
At
the fixed-coefficient scale law becomes
Every Reserve Asset scale and LP Token scale remain constant during a swap, so every derived market-value weight remains constant:
The coefficient, price law, and normalized value flow reduce to
Thus is the constant-weight boundary of Post-Trade Elasticity.
2.2 The reserve-only homomorphism
When ,
For successive reserve ratios,
Thus
is a homomorphism while the coefficient and elasticity remain fixed.
2.3 The complete homomorphism
For a general coefficient change,
The reserve ratio and coefficient ratio together determine the price ratio. The complete map is
This larger map is also a homomorphism. Over two consecutive operations, both coefficient ratios and reserve ratios multiply and telescope:
The fixed-coefficient reserve homomorphism is therefore a restriction of the coefficient-and-reserve homomorphism. A complete protocol specification states how every operation changes alongside the price equation.
For two tokens,
This equation separates relative reserve motion from relative coefficient motion exactly.
2.4 Why the homomorphism matters
The homomorphism gives marginal-price state a finite path-independence property. Consider two successive states
along one fixed elastic curve. The cumulative reserve ratio is
and the cumulative price response is
Given fixed and , the final marginal price depends exclusively on the cumulative reserve ratio. A reserve change executed in one step or divided into many steps reaches the same final marginal price whenever it reaches the same final reserve.
The complete homomorphism extends this endpoint consistency to coefficient motion. For successive operations,
and therefore
Given fixed , any sequence reaching the same final reserve and coefficient reaches the same final marginal price. A closed state loop satisfies
and therefore
This is exact price-state round-trip closure.
The path-independence statement applies to marginal-price state in the complete state space. Finite settlement and scale accretion carry additional execution information. Dividing one reserve change into several swaps preserves its final marginal price and changes the accumulated finite-step divergence. Liquidity-action ordering can also produce different final coefficients because each is calculated from the state at which its action executes. The complete homomorphism then maps each realized final pair to one final price.
This structure matters for four practical reasons:
- Splitting consistency: one-step and multi-step reserve paths share the same price endpoint at fixed coefficient.
- Composability: reserve ratios and coefficient ratios multiply cleanly across operations.
- Round-trip analysis: a closed reserve-and-coefficient loop closes the marginal price exactly.
- Auditability: the final marginal price can be reconstructed from the initial price and the two cumulative state ratios.
3. Post-trade value flow
Post-Trade Elasticity settles a complete finite token change at the token's final marginal price:
For a fixed-coefficient swap leg,
Therefore
Define normalized value flow by
Its derivative is
for every . Each admissible normalized value flow therefore determines exactly one relative reserve change.
The normalized function has the useful identity
4. Atomic multi-asset swaps
An atomic Multiswap transaction can receive distinct pay assets and send distinct receive assets. It executes directly as one multi-asset swap.
Each token appears at most once in the transaction. A leg depends only on that token's own pre-swap reserve, scale, and assigned value flow. The legs are coupled only by transaction-level value-flow conservation.
For every specified pay leg,
determines
Total pay value flow is
For receive leg , let be its positive value-flow allocation, with
Assign
The receive change is the unique satisfying
Summing all legs gives
This is the complete atomic -to- swap rule. It requires one normalized-flow evaluation for each pay leg and one monotone inversion for each receive leg.
All swap legs preserve their Reserve Asset coefficients:
Consequently, the reserve-only homomorphism applies to every swap leg.
5. Finite-step divergence and scale accretion
Scale satisfies the exact discrete product rule. Define
Then
The first term is the leg's post-trade value flow,
and the second term is the revaluation of its opening reserve,
Therefore
For a fixed-coefficient leg, Post-Trade Elasticity gives
and
Their sum is
A second exact decomposition separates the linear elastic response from finite-step curvature:
where
Comparing the two decompositions gives
Equivalently,
For , the function is strictly concave, so
with strict inequality for every nonzero finite leg.
Locally,
For a swap,
Therefore
for every nontrivial finite swap with .
At the constant-weight boundary ,
Transaction-level value-flow conservation then gives
5.1 Connection to value leakage
The value-leakage accounting identity measures the change in Reserve Asset value after subtracting the consideration exchanged through the trade:
Post-trade settlement sets
which gives
The acquired-reserve term
expresses zero value leakage. The opening-reserve revaluation remains as the leg's net income.
The three quantities have distinct accounting roles:
- is consideration exchanged at the post-trade marginal price;
- is revaluation of the opening reserve;
- is finite-step curvature in the elastic scale law.
Transaction-level value-flow conservation then gives
Equality holds at . Every nontrivial finite swap with gives strict inequality. Thus post-trade settlement gives acquired reserves their post-trade value at execution. LP Token scale accretion can be read equivalently as aggregate opening-reserve revaluation, aggregate swap net income, or aggregate finite-step curvature.
A swap keeps LP Token reserve fixed. Define
For every nontrivial finite swap with , increases while remains fixed, so
Swap divergence therefore accumulates in the LP Token coefficient while every Reserve Asset coefficient remains fixed.
At , both and remain fixed during swaps.
6. Two-asset price impact and market depth
For an swap,
and
Gross relative price impact is
Value-flow conservation also gives the exact identity
The initial slope is
For equal scales, the initial slope is .
6.1 The balanced midpoint
When
the receive change has the exact solution
The gross relative price curve is exactly linear:
6.2 Small scale elasticity
At the exact constant-weight boundary , normalized value flow is
with inverse
For an swap,
As ,
so
For equal scales, the limiting receive change is .
For ,
as .
When is small and positive, the receive reserve approaches depletion extraordinarily slowly. The limit therefore gives a strong soft reserve barrier, while the exact boundary gives the finite capacity above.
For a balanced pair, the large-input estimate needed to reach is
6.3 The capacity limit
As and ,
For a balanced pair, this becomes
The price curve approaches a hockey stick at the pool's capacity boundary.
6.4 Normalized depth
A dimensionless market-depth curve plots cumulative output fraction against gross relative price impact. It depends only on:
- scale ratio ;
- scale elasticity ;
- normalized input .
This makes normalized depth a natural basis for comparing capital efficiency across pools while keeping token units distinct from economic depth.
7. Splitting a finite swap
The divergence of a small step is second order:
If a fixed economic action is divided into comparable sequential swaps, each step is approximately and the accumulated divergence is approximately
Finer splitting therefore reduces the LP Token scale accretion generated by post-trade settlement. In the continuously divided limit, the finite-step contribution vanishes.
This is an execution property of the state equations. Every subtrade remains an ordinary safe post-trade swap. A permissionless protocol accommodates splitting across transactions, addresses, routes, and blocks. Fees, rounding, and external execution policy must be evaluated with that behavior in mind.
8. LP Token liquidity actions
A liquidity action includes the LP Token and one or more Reserve Assets in one atomic transaction. It is distinct from a Reserve Asset swap, although it uses the same post-trade value-flow function for its participating legs.
Suppose the action includes the LP Token and of the pool's Reserve Assets. For every participating token,
Transaction-level value-flow balance is
The participating Reserve Asset legs determine exactly one LP Token leg because is strictly increasing.
The LP Token and participating Reserve Assets remain on their elastic curves:
and
Thus
and
for every participating Reserve Asset.
When , every nonparticipating Reserve Asset keeps the same reserve and receives the same scale multiplier:
The aggregate identity determines
Therefore every nonparticipating Reserve Asset coefficient changes by
Its reserve remains fixed, and its price changes by the same factor:
This is exactly where the coefficient-and-reserve homomorphism is required. The reserve-only homomorphism remains valid for participating tokens, while the coefficient factor describes the complement transformation.
8.1 Constant-weight liquidity
At , every participating scale and the LP Token scale remain fixed:
For , the complement multiplier becomes
Therefore every Reserve Asset scale, LP Token scale, derived weight, and coefficient remains fixed during the liquidity action. The value-flow equation
determines the LP Token leg from the participating Reserve Asset legs.
For , the complement is empty and disappears from the state transition. The scale identity holds automatically because every scale remains fixed.
Each participating price follows
Thus heterogeneous liquidity legs can change relative prices, while proportional legs preserve every relative price.
The constant-weight boundary therefore has well-defined liquidity equations for every participating set. The projective LP-backing proof in Section 10 uses concavity for . The liquidity system therefore requires its own extraction-safety proof.
8.2 Gauge-coordinate liquidity updates
The physical liquidity equations place on every nonparticipating Reserve Asset. A scale accumulator factors that common transformation into one constant-time update.
Represent every effective Reserve Asset scale and the LP Token scale as
with
Here is the common scale accumulator and is the stored scale coordinate. Apply the gauge transformation
For every nonparticipating Reserve Asset , keep the stored scale coordinate fixed:
Its effective scale then receives the required physical transformation:
Every participating Reserve Asset receives an inverse gauge compensation:
Reconstructing its effective scale gives
The LP Token receives the same inverse compensation:
Therefore
The definition of guarantees
The ledger can derive from the Reserve Asset children. An explicitly cached root scale uses the same expression above.
For a single-Reserve-Asset liquidity action , the complete stored update is therefore
Thus moves from an update over the full Reserve Asset complement into one accumulator update plus inverse- updates for the LP Token and participating Reserve Asset.
8.3 Gauge coefficients and the complete homomorphism
Define stored coefficient coordinates by
For a nonparticipating Reserve Asset,
For every participating Reserve Asset,
The LP Token follows the same rule:
The complete homomorphism makes the physical price effects explicit. For a participating Reserve Asset,
For the LP Token,
For a nonparticipating Reserve Asset,
The gauge transformation changes the coordinate representation while preserving the physical liquidity action. The complete homomorphism connects the accumulator update, the inverse participant compensations, and the resulting effective prices in one multiplicative law.
9. Liquidity admissibility and dispersion
This section assumes . Section 8.1 gives the exact boundary equations.
For , an action is admissible only when
Using value-flow balance to eliminate , the exact condition is
Equality gives ; a value above one gives .
The condition is invariant when every participating multiplier is multiplied by the same positive factor. It therefore measures relative dispersion among the participating Reserve Asset changes independently of their common level.
The weighted power-mean inequality gives
Equality holds exactly when
9.1 Single-asset liquidity
For , the dispersion expression reduces to
The action is admissible for every finite . Every nontrivial single-Reserve-Asset liquidity action satisfies
Its state-independent lower bound is zero. Every finite action has positive , with approaching zero near an action boundary.
It has price impact because the active Reserve Asset and LP Token change reserves while the complement coefficients contract.
9.2 All-Reserve-Asset liquidity
For with , every Reserve Asset participates, the complement is empty, and disappears from the equations. The aggregate scale identity is possible exactly when
for every Reserve Asset.
This is proportional all-Reserve-Asset liquidity. Every Reserve Asset price receives the same multiplicative response, so Reserve Asset relative prices remain constant. The action has zero relative price impact.
9.3 Partial multi-asset liquidity
For , admissibility depends on the exact dispersion inequality above. Participating scales and relative dispersion determine the sign of .
Proportional partial liquidity has
For a proper participating subset,
Substitution into the dispersion expression gives
so every finite proportional action with is admissible. More general unequal partial liquidity is admissible exactly when its dispersion expression is below one. In either case, the projective proof in Section 10 applies whenever .
9.4 The exact two-Reserve-Asset boundary
For two participating Reserve Assets, exactly when
The boundary depends only on
and is invariant under a common scaling of the two changes. When , the admissible interval for therefore scales with .
At
the two boundaries are
Between the two boundaries . At either boundary ; beyond the interval . This closed form makes the dispersion boundary explicit.
10. Gauge-invariant safety
The balance identity
and the elastic state equations imply
Summing over Reserve Assets gives
The normalized identity alone does not yet choose a direction of safe motion. It only says that the Reserve Asset terms must add to one. The direction comes from asking what part of the state is physical and what part is only a common scale gauge.
Why ratios?
Multiplying every scale by the same positive factor multiplies every price and every coefficient by that factor. It does not change any reserve amount, scale share, or relative price. In particular,
and
do not change. A safety test based on an absolute coefficient would therefore depend on the chosen common scale representation.
The corresponding gauge-invariant coefficient coordinate is
The LP Token coefficient belongs in the denominator because the LP Token is the derived claim on the complete Reserve. The ratio compares Reserve Asset 's elastic curve with the elastic curve of one unit of the pool claim. It removes both the common scale gauge and the raw reserve-size effect.
Why must the ratios not increase?
At the endpoint,
There are two ways an endpoint could make a Reserve Asset term larger:
- the Reserve amount per LP Token can increase; or
- the Reserve coefficient can be written up relative to the LP Token coefficient.
Only the first is additional quantity backing. The second changes the relative valuation curve.
Multiswap therefore uses the componentwise projective condition
Under this condition, the endpoint cannot rely on a relative coefficient increase. Replacing each endpoint coefficient ratio by its opening ratio can only increase the left side:
That is the exact inequality needed for the LP-backing theorem below.
The condition is componentwise rather than aggregate. One Reserve Asset cannot receive a relative coefficient write-up merely because another Reserve Asset supplies enough value to conceal it in a scalar total. This separability is also what makes the certificate persist through later actions.
10.1 LP-backing theorem
Apply the endpoint balance identity and the projective inequalities:
Using the opening identity,
Because is concave for , Jensen's inequality gives
The endpoint Reserve basket per LP Token cannot be worth less at the opening Reserve prices.
This implication explains the direction of the projective inequality. A nonincrease in every forces sufficient quantity backing at the opening prices. An increase in one ratio would break this proof, although it would not by itself prove that the endpoint fails every possible aggregate safety test.
10.2 Composition
The ratios compose directly. If every primitive action satisfies
then every finite sequence satisfies
This is the round-trip-plus-subsequent-action theorem for the closed Reserve--LP system. A scalar one-action backing inequality does not supply this componentwise state certificate. The ratio order does: each later action starts from ratios that are no larger than those before it.
Status of the criterion
Within this article, “projectively safe” means exactly that every Reserve Asset ratio is nonincreasing. The condition is therefore necessary and sufficient for membership in this projective partial order.
The LP-backing theorem proves that the order is an economically meaningful sufficient safety certificate. It does not prove that every endpoint outside the order is economically unsafe. Establishing a necessary-and-sufficient criterion over every possible protocol action would require showing that any relative coefficient increase can be converted into a harmful admissible sequence. That stronger converse remains open.
10.3 Supported operation classes
For an atomic -to- swap, Reserve coefficients remain fixed, LP Token supply remains fixed, and post-trade value flow plus concavity makes the derived LP scale nondecreasing. Every ratio therefore satisfies the projective condition.
For an admissible liquidity action with , participating Reserve coefficients and the LP Token coefficient remain fixed. Each nonparticipating Reserve coefficient receives the multiplier . Participating ratios remain unchanged and complement ratios decrease.
For proportional liquidity, every Reserve and the LP Token changes by the same reserve factor. Every and remains unchanged. Absolute may decrease on provision, but every receives the same factor, so every relative LP Token price
is unchanged.
Thus, under exact arithmetic and the stated admissibility conditions:
- atomic -to- swaps with are safe;
- proportional liquidity with is safe; and
- unequal partial liquidity is safe whenever its exact dispersion condition gives .
11. Value-flow entropy
For , the projective order admits one useful dimensionless summary. Fix positive reference coefficients and and define
This quantity is called value-flow entropy. It is an additive logarithmic measure of the model's one-sided coefficient evolution. Shannon entropy uses probability distributions; physical entropy uses thermodynamic state variables; value-flow entropy uses coefficient ratios.
For a swap,
For single-asset liquidity, complement coefficients receive the same multiplier :
For proportional all-Reserve-Asset liquidity, every coefficient is preserved, so
For an LP Token burn, increases and therefore increases.
Every supported finite sequence satisfies
At , swaps, liquidity actions, and LP Token burns preserve every coefficient. Value-flow entropy is therefore constant across these operations:
The name “entropy” is justified by three exact properties:
- it is additive under composition because coefficient ratios multiply;
- it is nondecreasing under every supported operation;
- its finite-step production vanishes in the continuously divided limit.
The word entropy applies here through additive monotonicity under state composition. In this model, the essential structure is an additive monotone on state transitions.
12. Externally owned Surplus
Surplus is an open-system extension, not another Reserve account. CavalRe-owned CAV is posted as an exact same-token asset--liability pair:
| Debit | Credit |
|---|---|
| Surplus CAV | CavalRe Payable CAV |
The two balances inherit the same CAV price and cancel under every repricing. A pure Surplus sale changes no Reserve or LP Token coordinate and is projectively neutral.
A mixed sale may route independent pay and receive fractions through Reserve. Its external matched journals remain neutral; its complete Reserve endpoint must satisfy
The detailed journals, general endpoint test, safe equal-fraction subfamily, and round-trip interpretation are developed in Externally Owned Surplus.
13. Elasticity changes
The equations above assume one fixed and . If elasticity changes from to , then
so the complete transition is
The complete expression retains both exponents:
An elasticity change is therefore a distinct parameter transition.
One policy holds and fixed, allowing the new elasticity to change and according to the state equations. A second policy holds , , and fixed by changing . Each policy defines a distinct protocol action with distinct economic consequences.
The production candidate keeps elasticity fixed during trading. Any future elasticity transition uses a paused, explicitly specified process analyzed together with its coefficient rule. A dedicated transition theorem governs that boundary.
14. Deposit phases and other protocol actions
A deposit phase uses an independent capitalization and distribution specification. Its rules govern reserve, scale, ownership, and distribution accounting.
Fees, reward distributions, Treasury transfers, oracle updates, and administrative state changes each carry an explicit reserve, scale, and coefficient rule.
The Post-Trade Elasticity Model governs swaps and supported LP Token liquidity actions; adjacent protocol modules carry their own specifications.
15. Solidity implementation and boundaries
The existing Multiswap ledger representation already provides the native state required by the model:
- every Reserve Asset has reserve and scale;
- the LP Token has reserve and scale;
- the ledger tree enforces .
The coefficient is derived directly:
It follows from reserve, scale, and the pool elasticity. Liquidity's common complement transformation can use the existing scale-accumulator pattern with constant-time writes.
The swap implementation and its validation address:
- one fixed pool-wide elasticity;
- normalized value-flow evaluation;
- monotone inversion for receive legs;
- atomic -to- value-flow allocation;
- duplicate-token validation;
- positive-reserve and positive-scale enforcement;
- exact-input output rounding in favor of the pool;
- token-unit receive minimums for the public exact-input API;
- stale-quote and reentrancy protection;
- exact updates to the Reserve Asset scales and LP Token scale.
The liquidity engine additionally requires:
- proportional validation for every participating subset, including and ;
- exact LP Token value-flow solving;
- positive- enforcement for single-asset liquidity;
- scale-accumulator updates for the nonparticipating complement;
- projective-ratio invariant tests;
- LP Token burn accounting.
The TypeScript reference implementation covers:
- exact two-asset swaps;
- atomic multi-asset swaps;
- single-asset liquidity;
- coefficient transitions;
- divergence and value-flow entropy;
- round trips and mixed-operation sequences;
- elasticity, scale, and trade-size grids;
- the reduction of finite-step production under splitting.
The Solidity implementation uses FloatLib, explicit inverse paths at and , and a numerical inverse for other supported elasticities. Public swaps use exact pay amounts and per-asset receive minimums. Liquidity operations support proportional participating reserves only, using the scale accumulator for the complement. Coefficients are derived rather than stored.
Surplus settlement first computes the direct quote and checks the entire receive basket for conservative top-up coverage. A qualifying basket receives a second quote with reduced pay amounts entering reserves; Surplus funds the difference so the user receives the direct quote’s amounts. Deposit phases instead add oracle-valued amounts and scales to existing state, with re-sealing and effective-to-base-scale conversion. See Quote Engine and Deposit Phase Lifecycle for the implementation details.
These implementation facts do not extend the exact-arithmetic proofs to every rounding path, administrative transition, or token behavior. Security review and independent validation remain necessary.
16. Established results and open boundaries
Under exact arithmetic and the stated domain qualifications, the model establishes:
- fixed-coefficient reserve changes have a multiplicative reserve-to-price homomorphism for ;
- normalized post-trade value flow is strictly monotone and uniquely invertible;
- atomic -to- swaps conserve transaction-level post-trade value flow;
- every nontrivial finite swap with produces positive divergence;
- proportional liquidity is admissible and projectively safe for every ;
- unequal partial liquidity is admissible and projectively safe when ;
- the ratios provide a gauge-invariant safety certificate;
- that certificate protects opening-price Reserve backing per LP Token; and
- the certificate composes across every finite sequence in the closed Reserve--LP system.
Further engineering and research topics include:
- fixed-point power evaluation, solver accuracy, and pool-favorable rounding;
- fee, Rewards, and Treasury accounting;
- moving external prices, arbitrage, MEV, and oracle use;
- elasticity transitions;
- independently priced claims and unmatched liabilities;
- token-behavior eligibility;
- validation of oracle-valued deposit settlement; and
- implementation security and independent audit.
Conclusion
Post-Trade Elasticity is a state-transition model for atomic Reserve Asset swaps and controlled LP Token liquidity.
Its swap core is
Its state geometry is
Swaps and admissible liquidity operations make every projective coefficient ratio nonincreasing. This ratio order is the model's internal safety certificate and composes across finite sequences.
The complete lesson joins the reserve power law with an explicit coefficient law. Every protocol action declares both parts of its state transition:
Once both are explicit, swaps, liquidity, gauge-invariant safety, and open-system extensions fit into one consistent Multiswap framework.
