Hook · V. CAL
CAL.
Commitments-as-liquidity—collateralizedlimitorders.
ERC-20 collateral commitments auto-execute when price reaches a trigger.
Type
Forward Market
Status
—
Version
v1.0.0
Pools
0
Mechanics
How it works.
- 01
Users lock ERC-20 collateral with a directional trigger price (BUY or SELL) and an expiry block.
- 02
On each swap the hook checks whether the current sqrtPrice crossed the trigger in the user's favor.
- 03
When triggered, collateral executes atomically against the pool via the sync / settle / take pattern.
- 04
Expired commitments are auto-refunded; owners may cancel any active commitment at any time.
Integration
Code sample.
// Post a BUY commitment: purchase token0 with token1 at trigger price
uint256 id = calHook.submitCommitment(
poolKey,
CALHook.Direction.BUY,
triggerSqrtPrice, // execute when spot <= this price
expiryBlock, // auto-refund after this block
token1Amount // collateral to spend
);