# Gate vitality and adapter depth: asking the venue

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

How a gated venue reports that it is alive and how deep it is: the wrapper counts material swaps (MATERIAL_SHIFT), Gate.vitalOf reads the depth the adapter declares from the venue's own balances and caps it by what the venue holds, and Quoter.gateVitalOf exposes it. A discovery signal for the 2.0.0 generation, not a price source.

For a gated venue, the registry's two questions, is it alive and how deep is it, are answered by the BlazePhoenixGate from two readings: a use count the wrapper keeps itself, and a depth the adapter declares from the venue's own balances, capped by what the venue contract holds. Gate.vitalOf returns the three figures (vitality, depth18, psi) in the Hub's units.

These figures are a discovery signal, not a price source. No swap reads them; prices come from quotes, and execution is checked against measured balance changes. The Gate arrives with the 2.0.0 generation, scheduled for 15 December 2026, and is not deployed yet.

## What does a wrapper count as use?

A wrapper writes its use counter, vitalSlot, in its swap function and nowhere else, in the slot layout the Hub uses for registered pairs, through Core's tickSlot and stampTs. A swap counts when it delivers a non-zero output and is material on both sides of the venue: the input must be at least 2^-16 of the venue contract's balance of the input token, and the output at least 2^-16 of its balance of the output token, each compared in its own token. That threshold is MATERIAL_SHIFT = 16, about 0.15 basis points.

Dust therefore pays gas and buys no vitality. The count decays in wall-clock time: Core.vitality shifts it right once per 24,576 seconds since the last update, and after 32 steps, about 9.1 days, a slot reads as dead.

## How does Gate.vitalOf compute its three numbers?

vitalOf returns zeros unless this Gate created the wrapper and the wrapper's family has a live adapter: a cleared family cannot execute, so it does not rank. Otherwise, v is Core.vitality over vitalSlot. The depth, depth18, is the second return value of the wrapper's quote, called with an input of zero under a gas cap of GATE_QUOTE_GAS (500,000 gas), and a failed call reads as zero.

That declared depth is then capped by BPC.heldMass18: the larger of the venue contract's two token balances, normalised to 18 decimals and read with balanceOf. psi is Core's composite fitness over the slot with the depth bucket of that capped depth, without the bridge or concentration bonus.

```
v       = Core.vitality(wrapper.vitalSlot, now)
depth18 = min(adapterDeclared18, heldMass18(venue, token0, token1))
psi     = Core.psi(slot with depthBucket(depth18), now, no bonus)
# depthBucket(d) = min(15, floor(log10(d / 1e15)))
```

## How do adapters declare depth18?

Each adapter reads depth in the form its venue answers, and seven of the eight adapters send the result through one producer, ExtAdapterBase._depth18, which calls Core.shortSide18: the shorter of the two sides, each normalised by its token's decimals. The PancakeSwap Infinity CL adapter converts the pool's liquidity at its current price with Core.depthFromL18, the registry's own depth for concentrated pools. The declared depth never reads the trade size: the interface requires depth18 not to depend on the input amount.

## Why is the declared depth capped?

A declared depth is the adapter's statement; the cap is a measurement. vitalOf takes the smaller of the two, so an adapter cannot report more mass than the venue contract physically holds. heldMass18 is the same producer the registry applies to concentrated venues, so a declared depth meets the same cap at both doors.

For the Curve adapters the depth is read when the venue's own price probe reports it is not mid-operation. For Balancer, the venue contract a wrapper points at is the Vault, so the cap is what the Vault holds of the pair; the Balancer adapters quote by eth_call (quoteCall), and their view quote declares depth with an output of zero.

## How do you read it from outside?

Quoter.gateVitalOf takes the wrapper, the two tokens and the venue key. It checks the wrapper's identity with BPC.gateWrapperLive, the same check the Router applies to a kind 9 leg, and then returns Gate.vitalOf for it. The Quoter adds no figure of its own. Placeholders stand in for addresses until the 2.0.0 deployment is published.

```
cast call <quoter> "gateVitalOf(address,address,address,uint24)(uint256,uint256,uint256)" <wrapper> <tokenA> <tokenB> <venueKey> --rpc-url <your node>
```

## What vitality does not do

Vitality and depth decide nothing at execution. The wrapper's swap never reads its quote, and the Router's floors come from what it measures in the transaction and from the caller's minimum. In this design the Solver does not plan Gate legs, so gated venues are reached through explicit routes, and these figures describe them for whoever builds those routes.

**Verify it yourself:** git clone https://github.com/blazephoenixxyz-crypto/Blaze-Phoenix-Dex && cd Blaze-Phoenix-Dex && grep -n 'MATERIAL_SHIFT\|function vitalOf' src/BlazePhoenixGate.sol && grep -n 'function gateVitalOf' src/BlazePhoenixQuoter.sol && grep -n 'function _depth18' src/adapters/ExtAdapterBase.sol

Related: https://blazephoenix.xyz/learn/venue-adapters-and-the-gate/ · https://blazephoenix.xyz/learn/gated-pools-permissioned-venues/ · https://blazephoenix.xyz/learn/trust-minimised-routing/ · https://blazephoenix.xyz/learn/pool-vitality/ · https://blazephoenix.xyz/learn/vitality-discovery-lifecycle/ · https://blazephoenix.xyz/learn/hub-slot-registry/
