Multiswap Safe Operations Cheat Sheet
Scope: The operation classes below describe mathematical safety results. Current contracts expose Reserve Asset swaps and proportional LP liquidity; general coefficient updates and unequal liquidity baskets are not public operations. See Liquidity Operations.
This is the compact safety reference for the exact-arithmetic, claim-free Multiswap Reserve--LP system.
1. State
Derivation: native state and elasticity, followed by the normalized Reserve--LP identity.
For Reserve Asset ,
with . The LP Token is derived:
Therefore
2. Safety test
Derivation: Gauge-Invariant Safety.
An atomic action is projectively safe when
The test is unchanged by a common positive rescaling of every scale and coefficient.
3. Economic consequence
Derivation: Why the Condition Protects LP Backing.
The ratio test and the normalized balance identity imply
The ending Reserve basket per LP Token cannot be worth less at opening Reserve prices.
The proof uses
and Jensen's inequality for the concave function .
4. Composition
Derivation: Composition.
If every primitive action satisfies the ratio test, then every finite sequence satisfies
for every Reserve Asset. This covers splits, round trips, and subsequent actions within the same closed state model.
5. Operation classifier
Derivations: supported closed-system operations and general externally owned Surplus safety.
| Operation | Endpoint behavior | Result |
|---|---|---|
| Atomic -to- swap, | Reserve coefficients fixed; fixed; derived does not decrease | Safe |
| Proportional liquidity, | Participating ratios unchanged; complement ratios multiply by | Safe |
| Admissible unequal liquidity, | Same ratio behavior when the dispersion condition gives | Safe |
| Proportional liquidity | Every and is unchanged | Safe |
| Pure externally owned Surplus sale | No price-forming coordinate changes | Neutral |
| Mixed externally owned Surplus sale | Independent Reserve fractions | Test the complete Reserve endpoint |
6. Swap check
Derivations: post-trade value flow and finite-step scale accretion.
For a swap, every Reserve coefficient remains fixed and LP Token supply does not change. Post-trade value flow gives
Concavity gives
Thus does not fall while every is fixed, so every satisfies the safety test.
7. Liquidity check
Derivations: LP Token liquidity actions, liquidity admissibility and dispersion, and partial multi-asset liquidity.
For an liquidity action, participating Reserve Assets and the LP Token remain on their elastic curves:
for participating , and
When , every nonparticipating Reserve Asset receives the common complement multiplier
Admissibility requires
For a proper participating subset, an admissible nontrivial action has . Participating ratios are unchanged and every complement ratio decreases.
For proportional participating deposits or withdrawals,
and every proper subset satisfies the dispersion condition. This enables proportional -to- liquidity provision without requiring all Reserve Assets.
When , admissibility requires full proportionality. Every Reserve and LP Token amount changes by the same factor, so every projective coordinate is unchanged. Absolute prices may move together, but relative LP Token prices
remain unchanged.
8. Journal-entry gate
Derivation: Per-Entry Safety Procedure.
Before applying the ratio test:
- write every equal-amount debit and credit inside its own token ledger;
- identify entries touching for every , including ;
- retain all journals, but remove exact same-token matched price-taking asset--liability pairs from the repricing calculation;
- calculate one complete atomic endpoint; and
- enforce positivity, operation-specific admissibility, and the ratio inequalities.
Accounting balance is mandatory but does not determine the safety direction by itself.
9. Scope
The proof applies directly to the exact-arithmetic claim-free Reserve--LP system and to open actions whose external accounts cancel as exact same-token matched pairs. Independently priced claims, unmatched liabilities, administrative changes to price-forming state, fees, and fixed-point rounding require explicit extensions and tests.
