The Thermodynamic Structure of Multiswap
Multiswap's Post-Trade Elasticity Model was not derived from thermodynamics. It was developed as a market-design framework: define Reserve Asset states, couple trades through execution value, preserve aggregate accounting, and identify state transitions that cannot weaken the pool's safety position.
Yet the resulting mathematics has a distinctly thermodynamic structure.
The pool has a state space. Value-flow balance constrains exchanges across its boundary. Coefficient inequalities define a cone of locally admissible processes. Finite coefficient multipliers integrate those inequalities across complete transitions. A logarithmic entropy summarizes the resulting irreversible motion. The execution-price rule acts as a constitutive law: it determines whether the balance equations naturally carry an ordinary swap through the admissible region.
This is more than a verbal analogy, but less than an identification with physical thermodynamics. Multiswap does not have a literal temperature, heat bath, or molecular entropy. The precise claim is structural:
The Post-Trade Elasticity Model has the same mathematical separation between state, balance laws, admissibility, entropy production, and process law that makes thermodynamics a general theory of physical processes.
That separation is useful. It clarifies what coefficient safety proves, what execution pricing contributes, why entropy is informative but incomplete, and why a state-safe operation can still have unfair consideration or MEV exposure.
This article develops that structure from first principles for positive scale elasticity,
It assumes exact arithmetic, positive reserves and scales, and homogeneous elasticities. The thermodynamic interpretation is a mathematical framework for reasoning about the model, not a claim that every thermodynamic theorem automatically applies to Multiswap.
1. The Multiswap state space
Consider a Multiswap pool with Reserve Assets. Reserve Asset has reserve
scale
and marginal price
Scale elasticity and price elasticity satisfy
Each Reserve Asset has elasticity coefficient
Equivalently,
and
The LP Token is indexed by . It has reserve , scale
price
and coefficient
The complete pool state is therefore described by positive reserve and scale coordinates subject to the aggregate scale identity.
Thermodynamics begins from the same kind of abstraction. It does not track every molecule. It identifies a macroscopic state and asks which transitions between states are possible. Multiswap similarly abstracts away from the path by which tokens arrived and begins with the current ledger state.
The important question is not merely:
It is:
That is where the thermodynamic structure appears.
2. Balance laws: the first-law layer
For a transition from to , scale changes according to the exact discrete product rule
The two terms have different meanings.
The first is the final-price value of the reserve transferred through the pool boundary:
The second is the revaluation of the reserve already inside the pool:
Under post-trade execution, define signed execution value flow for Reserve Asset
The general execution value-flow identity couples the LP Token leg to all Reserve Asset legs:
An ordinary reserve-only swap has no LP Token flow. Therefore
and the general identity specializes to
In that special case, the pool receives and sends Reserve Asset quantities whose signed values balance at their respective post-trade prices.
The state must also preserve the ledger identity
These equations form the first-law layer of the model. They are accounting and balance conditions. They determine how a valid transaction fits together, but they do not by themselves determine whether the resulting state is coefficient-order admissible.
That distinction is essential. In thermodynamics, an energy balance permits both spontaneous and impossible processes. The second law supplies a direction. In Multiswap, execution value-flow balance and aggregate scale consistency likewise admit transitions that can move the pool against the coefficient order. Another condition is required.
3. Coefficient order: the second-law layer
The Post-Trade Elasticity coefficient order requires
for every Reserve Asset and
for the LP Token.
Reserve Asset coefficients may remain fixed or contract. The LP Token coefficient may remain fixed or expand.
This order supplies the missing direction of admissibility. A transition that balances execution value but expands even one Reserve Asset coefficient leaves the componentwise order. A transition that dilutes the LP Token coefficient does the same.
The order is compositional. If every primitive transition satisfies the coefficient directions, then any finite sequence of those transitions satisfies them as well. The pool carries its safety certificate forward into the next action.
This is the Multiswap analogue of the second law: balance laws alone do not select permitted processes; a monotone state order does.
The analogy should be stated precisely. The coefficient order is not derived from the physical second law, and a coefficient is not a temperature or chemical potential. The mathematical correspondence is that both theories add a directional admissibility condition to balance equations that do not themselves select a direction.
4. The local admissible-process cone
Differentiate
The relative differential is
Using gives
Reserve Asset admissibility therefore requires
For the LP Token,
At any positive state, these are linear inequalities in the local changes and . Together with
they define a tangent cone of admissible state motion.
This is one of the strongest thermodynamic parallels. In nonequilibrium thermodynamics, the second law restricts local process directions through nonnegative entropy production. Multiswap's coefficient inequalities similarly divide infinitesimal state changes into:
- boundary directions, where a coefficient remains fixed;
- interior directions, where the coefficient moves strictly toward safety;
- forbidden directions, where a Reserve Asset coefficient expands or the LP Token coefficient contracts.
The cone is more informative than a list of approved transaction types. It permits systematic discovery of new operations. A candidate transition can be generated from funded token movements and tested directly against the cone before a complete settlement rule is designed.
5. Finite processes and local production
A local differential does not certify an arbitrary finite jump. The exact endpoint multiplier for token is
Finite admissibility requires
for every Reserve Asset and
for the LP Token.
Define nonnegative component production values
for the LP Token and
for Reserve Asset .
Every componentwise coefficient-order admissible transition has
and
For a sequence of transitions indexed by ,
Taking logarithms gives
Coefficient certificates multiply; their logarithmic production values add. This is exactly the algebra needed for an entropy-like process measure.
It also explains why intermediate states matter. A final endpoint can have an acceptable scalar summary even if one intermediate action violates a componentwise coefficient direction. Requiring every primitive transition to carry nonnegative local production gives an inductive process proof rather than an endpoint coincidence.
6. Value-flow entropy
The componentwise production values admit an aggregate logarithmic monotone. Choose positive reference coefficients and define value-flow entropy, up to an additive constant, by
Its change across a transition is independent of the reference state:
Equivalently,
Whenever every componentwise coefficient condition holds,
The factor is a positive normalization. It affects the scale of the Reserve Asset contribution, not the sign or the underlying componentwise order.
This entropy has three important properties.
First, it is a state-function difference. It depends only on the initial and final coefficients.
Second, it is additive across sequential transitions because logarithmic coefficient ratios add.
Third, it is nondecreasing under every componentwise coefficient-safe primitive.
Those properties justify calling an entropy within the Multiswap process theory. The term does not assert a microscopic statistical interpretation. It identifies a macroscopic state monotone that accumulates irreversible coefficient motion.
6.1 Entropy is weaker than the second-law order
The scalar entropy is not the primary safety condition.
It is possible for one Reserve Asset coefficient to expand,
while sufficiently large safe movements elsewhere keep
Positive aggregate entropy can therefore conceal a local coefficient violation.
The authoritative second-law analogue is the vector condition
Entropy is a projection of this partial order. It is valuable for diagnostics, long randomized sequences, and measuring accumulated safety margin, but it does not replace the individual certificates.
This makes Multiswap's structure richer than a theory governed by one scalar inequality. It has a family of componentwise monotones and an aggregate entropy constructed from them.
7. Reversible boundaries and irreversible motion
The thermodynamic language of reversible and irreversible processes is useful only if applied carefully.
A fixed-coefficient Reserve Asset leg satisfies
That leg moves along the boundary of the local coefficient-order cone. It produces no Reserve Asset coefficient entropy:
A proportional all-Reserve-Asset liquidity action preserves every coefficient. It is the closest Multiswap analogue of a reversible process:
Other operations move strictly into the coefficient-order cone:
- a supported single-asset liquidity action contracts complement coefficients;
- LP Token under-minting expands ;
- burning LP Tokens without withdrawing reserves expands ;
- direct permanent-reserve allocation contracts a Reserve Asset coefficient, expands , or both.
Each has
when the coefficient movement is strict.
An ordinary post-trade swap requires more care. Every Reserve Asset leg remains on its fixed-coefficient boundary, but the complete value-flow-conserving transaction increases the LP Token coefficient. Therefore a nontrivial finite swap is not globally reversible in the coefficient order.
For post-trade execution and ,
while
The swap is boundary motion at the Reserve Asset legs and positive dissipation at the pool level.
That is a sharper statement than calling swaps reversible or irreversible without qualification. The local legs preserve their constitutive coefficients; coupling them through execution generates system-level entropy.
8. Execution pricing as a constitutive law
Coefficient order defines the admissible state region. It does not determine how a trade couples token flows to price changes.
Let
be the final marginal price and consider the linear execution rule
The parameter describes the execution price:
- uses the opening price;
- uses the endpoint midpoint;
- uses the post-trade price.
For general , signed execution value flow is
The exact scale decomposition is
The general execution value-flow identity is
Summing the Reserve Asset scale changes therefore gives
For a reserve-only swap, , so
Every nonzero fixed-coefficient leg has
Execution before the final price therefore introduces a negative term when . It can overwhelm the safe opening-reserve revaluation and reduce the LP Token coefficient.
For , post-trade execution has the global finite-trade property
for every nontrivial fixed-coefficient reserve-only swap.
Within
is the unique fixed linear execution rule with that property for every finite admissible swap. For each fixed , sufficiently large asymmetric swaps can produce
Execution pricing therefore plays the role of a constitutive law. The second-law order says which direction is admissible. The constitutive rule couples flows and state changes. A valid constitutive law must produce nonnegative entropy throughout its claimed operating domain.
Post-trade execution is not the definition of coefficient safety. It is the execution law that makes ordinary finite swaps satisfy coefficient safety automatically.
9. Dissipation without fees
In conventional market language, dissipation is often identified with an explicit fee. Multiswap's coefficient entropy shows that the concepts are distinct.
A fee-free post-trade swap can have
The entropy arises from nonlinear state revaluation under value-flow-conserving execution, not from a separately charged token amount.
Fees can add further pool-favorable value flow, but they are not the source of the basic coefficient theorem. They require their own accounting rule:
- which account receives the fee;
- whether the fee changes reserves or only external claims;
- how scale changes with the token movement;
- which rounding direction preserves every coefficient inequality.
Calling all positive entropy a fee would obscure the model. The more accurate hierarchy is:
Both may be dissipative in the sense of increasing the pool's safety monotones, but they arise from different mechanisms.
10. Boundary flows and protocol-funded processes
Thermodynamics distinguishes a system from its surroundings. Multiswap requires the same boundary discipline.
Every value-flow-coupled operation satisfies
An ordinary reserve-only swap has , so the general identity reduces to
A permanent-reserve allocation is different. Surplus or another protocol account supplies external tokens to the pool. The transition can be coefficient-safe, but the positive reserve change must be funded across the system boundary.
For example, suppose Surplus contributes without minting LP Tokens, leaves every other Reserve Asset unchanged, changes only scale, and keeps fixed. The coefficient order then admits the interval
That interval describes admissible endpoints. It does not create the contributed . The Surplus account supplies it.
This distinction prevents a common error: treating a favorable state inequality as if it were a source of value. The coefficient order constrains how funded value can be incorporated. It does not fund the process.
Every complete operation therefore needs both an internal admissibility proof and an external boundary-flow account:
That is the financial analogue of separating a thermodynamic system's internal state production from heat, work, and matter crossing its boundary.
11. Entropy does not prove fairness
The thermodynamic framework proves state admissibility. It does not decide who deserves the benefit of an irreversible transition.
Suppose protocol-owned reserves are added without issuing LP Tokens, or LP Tokens minted by the contribution are burned. The operation can satisfy
and every componentwise coefficient condition.
Yet a temporary liquidity provider may enter before the allocation, hold LP Tokens when value is deposited, and exit afterward with part of that value. The proportional entry and exit can preserve all coefficients, while the allocation between them increases entropy.
The complete sequence is state-safe and economically contestable.
Likewise, an ordinary user swap can be coefficient-safe while remaining exposed to transaction ordering. A minimum receive protects the user's execution boundary, but it does not determine who captures the value of a protocol-funded LP Token burn.
Thermodynamic admissibility therefore does not imply:
- fair execution;
- correct ownership allocation;
- resistance to sandwiching or backrunning;
- appropriate protocol sale timing;
- adequate user slippage protection.
Those are boundary-condition and mechanism-design questions. The state theory tells us whether the pool remains inside its safety order after the action. It does not replace economic policy.
12. The useful correspondence
The Multiswap-to-thermodynamics mapping can now be stated precisely.
| Multiswap structure | Thermodynamic role |
|---|---|
| Positive state | Macroscopic state |
| Aggregate scale and execution value-flow balance equations | First-law layer |
| Componentwise coefficient order | Second-law admissibility |
| Differential conditions on | Local admissible-process cone |
| Finite multipliers | Integrated process certificates |
| Logarithmic production values | Componentwise entropy production |
| Value-flow entropy | Aggregate state monotone |
| Constant-coefficient motion | Boundary process |
| Strict coefficient improvement | Irreversible motion |
| Execution-price rule | Constitutive law |
| Surplus contribution or LP Token burn | Protocol-funded boundary process |
| Fees and pool-favorable rounding | Potential additional coefficient production; exact accounting required |
The table is a structural correspondence, not a historical claim. Multiswap was not obtained by assigning financial names to thermodynamic variables. The same mathematical architecture emerged from the protocol's own requirements.
13. Where the analogy stops
Several limitations should remain explicit.
No literal physical entropy
is a protocol state monotone. No microscopic counting argument has been supplied, and no claim is made that it equals physical entropy.
No identified temperature or heat
Price is an intensive financial quantity, but this article does not identify price with temperature. Execution value flow resembles boundary energy accounting structurally; it is not heat.
No automatic Onsager theory
The local coefficient cone resembles nonequilibrium entropy-production constraints, but no linear force-flux matrix, reciprocity theorem, or near-equilibrium kinetic model has been derived.
Positive scale elasticity only
The strict finite-swap production theorem used here assumes
The boundary is degenerate for the coefficient order and requires a separate state-potential analysis. This article does not extend the thermodynamic conclusions to that boundary.
Exact arithmetic
Production code uses finite precision. Pool-favorable rounding must preserve the componentwise inequalities at every primitive step. A positive theoretical entropy does not excuse one adverse per-token rounding direction.
Candidate operations are not implemented operations
The coefficient-order cone identifies mathematically admissible candidates. A candidate becomes a supported protocol operation only after its consideration, account movements, authorization, rounding, MEV controls, and property tests are fully specified and implemented.
These limits strengthen the framework by keeping the proven structure separate from suggestive but undeveloped extensions.
14. A thermodynamic test architecture
The interpretation leads directly to a layered property-test design.
State domain
Require
First-law layer
Require
and, for every value-flow-coupled action,
For an ordinary reserve-only swap, also verify the specialization
Second-law layer
For every Reserve Asset, require
For the LP Token, require
Entropy diagnostic
Require
and report every componentwise production value . The scalar check is diagnostic; the componentwise conditions remain authoritative.
Boundary-flow layer
Verify that every positive token movement is funded, every negative movement reaches its declared recipient, LP Token issuance and destruction match the operation, and user minimum-receive or maximum-pay conditions are enforced.
Process composition
Randomize long sequences of swaps, proportional liquidity, single-asset liquidity, Surplus counter-actions, LP Token under-minting, permanent-reserve contributions, transfers, and burns. Assert the same layered conditions after every primitive, not merely after the final sequence.
This architecture tests balance, admissibility, entropy, and funding separately. A failure says which layer of the process theory was violated.
Conclusion
Multiswap's Post-Trade Elasticity Model has developed the mathematical architecture of a thermodynamic process theory.
The pool state is described by reserves and scales. Execution value-flow balance and aggregate scale consistency form a first-law layer. Componentwise coefficient order supplies a second-law direction. The differentials define the local cone of admissible processes. Finite multipliers integrate those conditions across complete transitions. Their logarithms produce an additive value-flow entropy.
Post-trade execution occupies a separate and equally important role. It is the constitutive law that couples reserve flow to price change so every nontrivial finite ordinary swap produces positive LP coefficient motion when
The resulting hierarchy is
The framework does not prove fairness, supply external value, or eliminate MEV. Those remain questions of boundary flow, ownership, and mechanism design.
What it does provide is a general theory of admissible Multiswap processes: balance laws say what must balance, coefficient order says which way the state may move, entropy measures accumulated irreversible motion, and execution pricing determines whether ordinary market activity follows that direction automatically.
