Ledger Accounting
Multiswap is ledger-native. Pool state is represented in structured ledger groups rather than only in ERC20 balances.
Ledger Groups
Important pool groups include:
Reserve AssetsReservesSurplusProtocolStakeRewardsRecoveredUser DepositsUnclaimed
Reserve assets are debit-side tokens. Claim tokens are credit-side tokens. The target token can be either a reserve asset, such as CAV, or a claim token, such as an LP token in a claim-token pool.
Scale
Scale is the pool's internal unit of value. Reserve assets have token reserves and scale balances. A token's pool price is its scale divided by its reserve amount.
The pool also exposes priceOfUSD(), which connects oracle USD prices to the
pool's scale numeraire. The current genesis phase intentionally has no anchors,
so priceOfUSD() is one for epoch 1.
Stake And Target Scale
Stake lives under:
<Target Token> / Stake / <Reserve Asset> / <account>
Target scale is derived from stake:
targetScale(target token) = totalStaketargetScale(reserve asset) = stake(target token, reserve asset)- reserve targets use
totalTargetScale = 2 * totalStake - claim targets use
totalTargetScale = totalStake
For reserve targets, the target token has a fixed 50% target weight. For claim targets, the claim token owns the backing basket, so reserve assets share the full target-scale denominator.