# Venue adapters and the Gate: one adapter per pool design, admitted by a delay and a code pin

> Canonical: https://blazephoenix.xyz/learn/venue-adapters-and-the-gate/
> License: CC BY-NC-ND 4.0 (attribution + link) · © 2026 BlazePhoenix
> Updated: 2026-11-17

Eight adapter contracts on the DEX main branch let the 2.0.0 Router trade on pool designs the Core cannot price natively: Curve, Balancer, PancakeSwap Infinity, Liquidity Book and Algebra Integral. The Gate admits an adapter only after a 48-hour delay and a scan of its code, pins the hash of that code and checks it again on every swap, and counts as output only the balance change measured at the recipient. None of these adapters is deployed on mainnet yet.

Short answer: an adapter is a small contract that knows how to trade on one kind of pool the Core cannot read natively. The Gate stands in front of it. It admits an adapter only after a 48-hour delay and a scan of its code, pins the hash of that code, and checks the pin again on every swap. Whatever the adapter reports, the Router pays nothing on its word: the output is the balance change measured at the recipient.

This page describes the 2.0.0 generation of the DEX, which is not deployed yet and is scheduled to launch on 15 December 2026. None of the eight adapters is deployed on mainnet yet, and this page gives no date for any of them. Every contract fact below is read from the main branch of the DEX repository at commit 969bcc6, and each one names the file where you can check it.

## What an adapter is

The Core prices six kinds of pool natively, by reading a few storage slots: Uniswap V2, V3 and V4 (native-ETH V4 pools included), Algebra, and Solidly stable and volatile pools. Some pool designs cannot be priced that way. They keep their balances in a shared vault, take a different swap call, or let outside hook code run inside a trade.

For those, the Gate creates a thin wrapper per pool. To the Router the wrapper looks like a Uniswap V3 pool: it has the V3 `swap` call and callback, and its address is derived by CREATE2 from the pair and a venue key, by the same formula the Hub uses for every V3 factory. The wrapper forwards the input it measured arriving to the adapter of its family, and the adapter trades on the real pool.

Every adapter answers the same four questions (`IExtAdapter`): `resolve` proves from the venue's own registry that a pool is the venue's, once, when the wrapper is created; `exec` trades; `quote` and `quoteCall` give a price for off-chain routing. The Gate never reads a quote during execution.

## Why each venue needs its own

Pool designs differ in three things that matter for safety, and an adapter has to get all three right for its venue.

## The adapters on main today

At commit 969bcc6, `src/adapters` holds eight adapter contracts, plus a shared base (`ExtAdapterBase`) and the interface. The table lists what each one trades and how it holds custody.

## Where they are configured

The repository wires adapters in two places, and neither is a deployment. Fork tests run the adapters behind a Gate against live pools: on Base for the two Curve and two Balancer adapters, on Avalanche for Liquidity Book and Algebra Integral, and on BNB Chain for the two PancakeSwap Infinity adapters. Local gas-campaign scripts replay the same wiring on a local fork.

The repository's deployment table for Gate adapters (`docs/deployments/gate-adapters.tsv`) has a header and no rows. Which adapters a deployed Gate admits, and on which chain, will be an on-chain fact: read the `AdapterAccepted` and `WrapperCreated` events after launch rather than any list, this one included.

## What the Gate checks, and when it reverts

The Gate keeps one adapter per family. An adapter enters in two steps 48 hours apart (`ADAPTER_DELAY`). At the proposal the Gate walks the adapter's runtime code opcode by opcode and refuses `DELEGATECALL`, `CALLCODE` and `SELFDESTRUCT`, empty code, and an EIP-7702 delegation prefix, then records the code hash. The acceptance reverts if the code has changed since. From then on `liveAdapter` answers zero if the code at that address is no longer the pinned code, and every swap asks it.

Each swap through a wrapper then runs a fixed sequence, and any failed step reverts the whole transaction:

## Why this protects the user

The protection comes from what the Router measures, not from trusting an adapter. The Router's floors, per leg, per hop and your own minimum output, are checked against the amount that actually arrived. A wrong quote, a lying return value or a skimmed output cannot pass that check; the swap reverts instead.

The other checks narrow what a bad adapter could even attempt. It cannot keep part of the input or the output, because custody is checked on both tokens. It cannot be swapped for different code without a public 48-hour proposal, because the hash is pinned. It cannot be pointed at an arbitrary pool, because the pool is fixed once at creation from the venue's own registry, and the wrapper's address is derived, not named in calldata.

A family can also be stopped at once. `clearAdapter` makes every wrapper of that family revert from the next call, in the same block, while the native kinds are untouched. That is a brake on trading, not a power over funds: the wrapper holds no tokens between calls.

## What it does not protect

These limits follow from the design. They are stated so that you can weigh them.

## Where to check

Read the Gate in `src/BlazePhoenixGate.sol`: the three properties are stated at the top, the opcode scan is `codeIsClean`, the pin is `liveAdapter`, and the wrapper's `swap` carries the custody checks. Each adapter states its custody, identity and hook rules in the header comment of its file under `src/adapters/`. The source is published under the Business Source License 1.1 (BUSL-1.1).

**Verify it yourself:** git ls-tree --name-only origin/main src/adapters/   # eight BlazePhoenixAdapter*.sol files plus ExtAdapterBase.sol and IExtAdapter.sol at 969bcc6. Then: git show origin/main:src/BlazePhoenixGate.sol | grep -n 'ADAPTER_DELAY\|GateE(14)\|GateE(15)'

Related: https://blazephoenix.xyz/learn/a-venue-is-data/ · https://blazephoenix.xyz/learn/gate-vitality-adapter-depth/ · https://blazephoenix.xyz/learn/gated-pools-permissioned-venues/ · https://blazephoenix.xyz/learn/integrated-dexes/
