SoroswapAggregator is the contract a caller actually swaps against. It holds the
registry of adapters, and it splits one trade across them according to a distribution the
caller supplies.
Source:
contracts/aggregator.
Interface
Vec<Vec<i128>>: one inner vector of step amounts per
protocol the trade was split across, in distribution order.
Types
DexDistribution is how the caller says “send this fraction of the trade through that
protocol”. parts is a weight, not a percentage: each protocol receives
amount * parts / total_parts. See
Aggregator Operation for the exact formula
and how the remainder is handled.
A distribution may name at most MAX_DISTRIBUTION_LENGTH entries.
The adapter registry
The set of protocols the aggregator can reach is stored on chain and managed by the admin, not hardcoded:update_adaptersregisters or replaces adapters, keyed byprotocol_id.remove_adapterdrops one.set_pausecloses a protocol to new swaps without removing its registration, which is the reversible option when an underlying protocol looks unhealthy.
Every one of these is admin only.
set_admin transfers that role, and upgrade replaces
the aggregator’s own code with a new WASM hash.