Skip to main content

Dispatcher and Modules

The Dispatcher is Multiswap’s public contract surface.

It is an immutable selector router: function selectors are mapped to installed module implementations, and calls execute against shared Dispatcher storage.

Why one Dispatcher

One address gives users and integrators a stable entry point while protocol capabilities remain modular. In the multipool architecture, pool-aware calls include a pool argument:

Dispatcher.multiswap(pool, payAssets, receiveAssets)
Dispatcher.poolSummary(pool)
Dispatcher.quoteMultiswapForSettlement(pool, ...)

The same Dispatcher can therefore serve multiple independent pool contexts.

Module families

Current modules cover:

  • ledger and account-tree operations,
  • pool initialization and reads,
  • reserve and claim-token roles,
  • quote parameters and oracles,
  • Multiswap quotes and settlement,
  • signed intents,
  • liquidity actions,
  • deposit-phase lifecycle,
  • staking and target allocation,
  • faucet behavior on test and local networks.

Module addresses are implementation details. Integrators call the Dispatcher.

Selector installation

Each dispatchable module declares its function signatures and selectors. The owner installs or replaces the selector mapping.

This design permits narrow upgrades without moving pool state or changing the public Dispatcher address. It also means integrators must pin a reviewed ABI and monitor module changes rather than assume the code behind a selector is permanently fixed.

Pool identity

A pool address identifies an accounting subtree, not a separate router contract. Pools can hold different reserve assets, target tokens, treasury accounts, quote parameters, and lifecycle state while sharing module code.

Pool tokens can also compose hierarchically: a token that represents a claim in one pool can be registered as a reserve asset in another.

Trust boundary

The Dispatcher is not immutable protocol logic as a whole. The routing shell is immutable, but the owner controls module installation and administrative configuration. See Administration, Risk, and Security.