Dashboard
V. of VForward Market
Hook · V. CAL

CAL.

Commitments-as-liquiditycollateralizedlimitorders.

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.

  1. 01

    Users lock ERC-20 collateral with a directional trigger price (BUY or SELL) and an expiry block.

  2. 02

    On each swap the hook checks whether the current sqrtPrice crossed the trigger in the user's favor.

  3. 03

    When triggered, collateral executes atomically against the pool via the sync / settle / take pattern.

  4. 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
);