Uniswap V4 Hook · $BID Token

Every Block
Is an Auction.

BlockBid is a batch-auction DEX hook built on Uniswap V4. Every trade in the same block executes at one uniform snapshot price — making front-running and sandwich attacks structurally impossible.

BID / ETH · LIVE CHAIN DATA LIVE
 
fetching on-chain price…
ETH Buffer
—
BID Buffer
—
LP Liquidity
—
Accrued Fees
—
connecting…
—
Total Swaps
 
Hook-filled, on-chain
ETH Volume
 
Gross ETH traded
Fees Collected
 
Lifetime protocol fees
Buffer Ratio
20%
Token claims / target
Block Height
 
Ethereum mainnet
// Execution Flow
One Block,
One Price.
01
Block Snapshot
When the first swap of a new block arrives, beforeSwap rebalances the previous active block's imbalance first, then captures the current slot0 sqrtPriceX96 as the immutable clearing price. Every subsequent swap in the same block uses this frozen price.
02
Claims-Based Settlement
All user swaps are filled from ERC-6909 claim balances held inside the Uniswap V4 PoolManager — zero raw token movement per swap. Output claims are burned, input claims are minted, and a custom BeforeSwapDelta cancels the underlying AMM execution entirely.
03
Inline Rebalance
The hook keeps a 20% token claims buffer relative to total seeded supply (tokenClaimsTarget). Buy-heavy blocks reduce token claims → next block swaps ETH→BID to replenish. Sell-heavy blocks do the opposite. Uses live slot0, never a stale snapshot. No keeper required.
block_events.log LIVE
—waiting for on-chain events…—
ethereum mainnet · ~12s / block block #—
// Why BlockBid
Three Structural Edges.
Not features — properties that emerge from the batch auction design and cannot be bypassed at the protocol level.
01 / 03
⊕
Zero Intra-Block MEV
Every trade within a single block clears at the same snapshot price, regardless of transaction ordering. A bot cannot front-run a buy by placing its own first — the clearing price is locked before any trade executes. Sandwich attacks require price movement between transactions; the uniform batch price makes this mechanically impossible.
Anti-MEV
02 / 03
◈
Hook-Owned Deep Liquidity
The hook holds the sole LP position. External LP additions are permanently blocked via beforeAddLiquidity. Settlements draw from a 20% token claims buffer that is auto-replenished each block — the AMM pool acts as inventory backstop, not primary execution venue. Consistent depth even during high-volume periods.
ERC-6909
03 / 03
⟳
Self-Healing Price Discovery
The per-block inline rebalance propagates price discovery automatically: a buy-heavy block pushes prices up, and the next block's snapshot opens at the new settled price. No keeper bots. No off-chain oracles. The hook triggers rebalance on the first swap of the next active block, even after idle periods.
On-chain
// Contract
Open Source.
Verifiable.

BlockBid's full settlement logic lives in a single beforeSwap callback — price snapshotting, claims settlement, fee accrual, overflow guards, and rebalance trigger. No proxy contracts. No admin keys on the swap path.

Hook Address 0x2e522…c888 ↗
Token ($BID) 0x42d9f…f62 ↗
LanguageSolidity ^0.8.26
FrameworkFoundry
Hook FlagsBEFORE_SWAP · RETURNS_DELTA · BEFORE_ADD_LIQ
Protocol Fee1% ETH-side · immutable
Token Supply1,000,000,000 BID · fixed
LicenseMIT
BlockBidHook.sol · beforeSwap() core logic
/// @notice Batch auction core — intercepts every swap.
function beforeSwap(
    address sender, PoolKey calldata key,
    SwapParams calldata params, bytes calldata
) external returns (bytes4, BeforeSwapDelta, uint24) {

    if (_rebalancing)        // pass-through internal swap
        return (selector, ZERO_DELTA, 0);

        // ── First swap of block: rebalance prev + snapshot ──
        if (snapshotPrice[pid][bn] == 0) {
                _rebalanceInline(lastActiveBlock[pid], key);
        (uint160 sqrtP,,,) = poolManager.getSlot0(pid);
        snapshotPrice[pid][bn] = sqrtP;   // locked for block
    }

    uint160 P = snapshotPrice[pid][bn];   // uniform price

        // ── Compute amounts at frozen price ─────────────────
        uint256 amtIn  = calcIn (params, P);
        uint256 amtOut = calcOut(params, P);

        // ── 1% ETH fee (input or output side) ───────────────
        uint256 fee = ethSide / 100;
    accruedFees       += fee;
    totalFeesLifetime += fee;   // lifetime cumulative
    totalVolumeETH    += ethSideGross;
    totalSwaps++;               // on-chain swap counter

        // ── Settle via ERC-6909 claims (no token transfer) ───
    poolManager.burn(address(this), outputCur.toId(), amtOut);
    poolManager.mint(address(this), inputCur.toId(),  amtIn);
    emit Swapped(sender, zfo, amtIn, amtOut, P);

        // ── Cancel AMM: return custom BeforeSwapDelta ────────
        return (selector, toBeforeSwapDelta(specAmt, fillAmt), 0);
}
// Get Started

Trade at the
Clearing Price.

Submit a swap and settle at the block's uniform price. No bots can get ahead of you — the price is locked before any trade executes.