Architecture
Autopilot is composed of:
On-chain contracts (DLL)
The DLL contract enforces:
quote/route validation (including signature verification),
settlement mechanics across selected LP wallets,
token transfers according to the quote,
safety checks (e.g., price sanity via oracle bounds).
Off-chain backend (quoting + selection)
The backend is responsible for:
maintaining wallet liquidity availability,
computing prices,
selecting which LP wallets participate in execution,
returning a signed quote used by the on-chain settlement.
Execution flow
At a high level:
Barter receives a swap request.
Barter requests a quote from the Autopilot backend.
Backend computes pricing and selects LP wallets for execution.
Backend returns a signed quote.
Barter submits the quote to the DLL contract on-chain.
DLL verifies the signature and executes settlement:
distributes input tokens across selected LP wallets,
collects output tokens back from those wallets,
delivers output to the recipient.
Key property: execution is structured to reduce exposure to common MEV patterns (e.g., sandwiching), but public blockspace cannot guarantee absolute MEV immunity.

Internal router: wallet selection
Selecting “the best priced wallets” is not always optimal because execution touches multiple wallets and each wallet interaction has gas overhead.
The backend selection problem is effectively:
maximize execution quality,
while accounting for the per-wallet execution gas overhead,
optionally randomize or diversify selection among equivalent wallet sets.
This design enables distributed execution across wallets while mitigating inefficient over-splitting caused by per-wallet gas overhead.
Last updated