Executing Transactions
To execute on Angstrom pools, the pool must be unlocked. This requires either executing a transaction knowing a bundle will execute in the block, or, passing in an unlock attestation to a UniswapV4 swap call.
- A safe way of doing is to always pass in a unlock attestation, as it removes any overhead of checking for a bundle, because: either a bundle executes and it gets ignored, or there is no bundle and the unlock attestation is valid.
Naive UniswapV4 Swap Call
Either pass in the encoded unlock attestation to the hook_data field of the V4 swap call on an angstrom pool, or don't and be sure the pool will be unlocked from a earlier tx in the block (atomicity guarantee).
/// UniswapV4 Pool Manager swap()
function swap(PoolKey memory key, IPoolManager.SwapParams memory params, bytes calldata hookData)
external
onlyWhenUnlocked
noDelegateCall
returns (BalanceDelta swapDelta);
PoolKey memory angstromPoolKey = ...;
IPoolManager.SwapParams memory params = ...;
/// optional, but recommended to guarantee the pool will be unlocked
bytes calldata encodedUnlockAttestation = ...;
PoolManager.swap(angstromPoolKey, params, encodedUnlockAttestation);
Using the Angstrom Adapter
The Angstrom Adapter provides an interface that will handle the full execution and settlement of a UniswapV4 swap on an Angstrom pool.