Pool Unlock
By default, Angstrom's Uniswap V4 liquidity pools are 'locked' at the beginning of each block. This means initial access for Angstrom-sequenced trades (i.e., the combined results of the Arbitrage Auction and Batch Auction) is exclusively managed by the Angstrom protocol through its hook. This 'gated' model is crucial: it ensures Angstrom's off-chain matching and arbitrage discovery processes conclude before any on-chain settlement occurs against the pools. This document explains how these pools are subsequently unlocked for general DeFi interaction and composability.
Default Unlock After an Angstrom Batch
When an Angstrom batch—the on-chain transaction bundling Angstrom's matched trades and auction results—is executed, the Angstrom hook contract automatically unlocks the specific Uniswap V4 pool, making the pool available for general interaction for the remainder of that block.
Once the hook has processed the Angstrom batch and lifted its initial restrictions:
- Subsequent swaps and general interactions by any user within that block can engage with the pool's updated (post-batch) state, similar to a standard, permissionless Uniswap pool, albeit with higher trading fees than in the batch.
Unlocking in Blocks Without Trades
If a block contains no Angstrom-driven trades (meaning no arbitrage or user swaps occur for any of the angstrom liquidity pools), the pool would ordinarily remain locked post-initialization. To ensure continuous pool accessibility and uphold DeFi composability even in these scenarios, Angstrom provides two complementary unlock mechanisms:
In blocks where no Angstrom trades occur, the pool remains locked unless an explicit unlock action is taken. To provide continuous accessibility, Angstrom supports two complementary unlock mechanisms:
1. Protocol-Driven Empty-Batch Transaction (Conditional Unlock)
This mechanism serves as a foundational guarantee for pool accessibility. It is particularly important for integrators (e.g., DEX routers) that may operate on different execution timelines or prefer a protocol-guaranteed unlock, as the signature attestation for user-initiated unlocks (see below) is available only towards the end of a slot, potentially too late for their needs.
If no Angstrom trades are to be settled, an Angstrom leader will submit an empty-batch transaction. This transaction's sole purpose is to trigger the unlock logic.
Key Aspects & Intelligent Gas Management:
- Broad Accessibility: Ensures the pool can be unlocked for general use every block, providing a reliable pathway for integrators who depend on the protocol to facilitate access.
- Conditional Execution for Gas Savings: To minimize the cost of subsidizing unlocks, Angstrom collaborates with participating block builders (such as Titan, and Angstrom is actively seeking further builder partnerships). These builders are equipped to conditionally include Angstrom's empty-batch transaction only if they detect a transaction attempting to interact with the locked Angstrom pool without providing its own unlock data (i.e., a signature). If a user-initiated signature unlock has already occurred, or if no transactions target the pool in that block, the empty-batch transaction will not be included on-chain by the builder to save gas.
2. User-Initiated Off-Chain Signature Unlock
This method is primarily designed for sophisticated users, traders, or solvers who require immediate, self-initiated access to Angstrom's liquidity pools. It allows them to unlock the pool as part of their own transaction.
Mechanism Overview: This unlock method leverages an off-chain EIP-712 compliant attestation. This attestation is signed by the designated Angstrom leader validator and confirms that Angstrom's operations for the current block will result in an empty batch (no Angstrom-sequenced trades).
Obtaining and Using the Attestation Data:
The signed attestation data, which is ready to be used as hookData
, can be obtained in real-time by subscribing to Angstrom's dedicated WebSocket stream.
- For comprehensive details on how to subscribe to this stream and understand the data payload format, please refer to the
subscribeEmptyBlockAttestations
API documentation.
Once obtained from the WebSocket stream, this hookData
payload (which internally contains the attesting validator's address and the signature) is included by the user in their Uniswap V4 swap
transaction. When this transaction is processed on-chain, the Angstrom hook contract will unlock the pool immediately, allowing the user's swap and subsequent transactions in that block to proceed against the now-accessible pool.
Primary Incentive & System Benefit:
A user-initiated unlock via signature preempts the need for the protocol-driven empty-batch transaction. This directly saves the Angstrom system the gas cost of subsidizing that unlock.
More importantly for the user, if multiple transactions are targeting the same Angstrom pool within a block, collaborating block builders must sequence a transaction that actually unlocks the pool (i.e., one containing the valid signature) before any other transactions dependent on that unlocked state can succeed.
Therefore, users who proactively include the signature ensure their transaction isn't just enabling their own swap but is also logically positioned for earlier execution relative to any "free-riding" attempts that would otherwise fail or be delayed pending an unlock. This creates a strong incentive to supply the signature for reliable and favorably sequenced execution.
Summary of Behaviors
Scenario | Unlock Mechanism | Notes |
---|---|---|
Angstrom batch executed with trades | Automatic unlock as part of batch execution via hook | Standard operation; pool unlocked by the batch itself. |
No Angstrom trades; protocol prepares empty batch | Empty-batch tx conditionally included by builder | Unlocks if another tx targets the pool without a signature and there are no user supplied unlock transactions |
No Angstrom trades; user/solver acts with valid signature | Signature in hookData unlocks pool via hook | User initiates unlock; gets sequencing priority over any transactions interacting with the pool that haven't supplied the unlock data |
Angstrom's unlock strategy ensures its liquidity pools remain consistently accessible and composable with the wider DeFi ecosystem, even in blocks without Angstrom-specific trades. As an integrator you can be guaranteed that the pools will always be available for interaction.