Pool Accounting
Multiswap records economic state in a double-entry ledger. Token custody, Reserve Assets, LP claims, Surplus, Rewards, Treasury, and epoch balances have explicit accounts.
Assets and claims
Reserve Asset accounts are debit-normal. Claim and liability accounts are credit-normal. This orientation lets the same ledger machinery represent asset movement and the issuance or retirement of claims.
A pool has Reserve Asset, Claim Token, and Protocol groups. Each token has the subaccounts needed for its role and lifecycle. An LP Token represents backing through the claim side of this structure.
Reserve and scale
A reserve balance measures tokens. Scale measures accounting value. The ledger maintains base-scale totals; a common accumulator produces effective scales for quoting and price reads.
Converting an amount to an ERC-20 token unit is distinct from updating accounting scale. Scale totals are maintained through double-entry movements, with exact balancing entries.
A quote describes movements
A QuoteItem separates token movement buckets from scale and value-flow fields. Pay quotes direct amounts into accounts; receive and fee quotes identify their sources. Settlement checks the invariants and applies these instructions atomically.
Surplus funds a payout from inventory outside trading reserves. Rewards and Treasury have their own accounts. The ledger’s account balances identify these internal allocations within the Dispatcher’s aggregate token custody.
Portfolio ownership
An LP-owned pool has LP claims on its backing. Protocol-owned reserves have a different ownership allocation. The selected pool’s roles and claim structure determine which liquidity operations are valid.
Read Reserves, Scale, and Price for the public state model and Dispatcher and Modules for the execution architecture.