Hook · II. BCS
BCS.
Bilateralcommitmentsettlementonatriggerprice.
Two-party OTC commitments auto-settle when spot crosses a trigger.
Type
Settlement
Status
—
Version
v1.0.0
Pools
0
Mechanics
How it works.
- 01
Two counterparties register a bilateral commitment containing a trigger sqrtPrice and the size of each leg.
- 02
On every swap the hook reads live price via StateLibrary.getSlot0 against the pool's current state.
- 03
When spot crosses the trigger, the commitment settles atomically in a single transaction.
- 04
Collateral transfers via ERC-20 safeTransfer — no intermediary custody, no escrow contract.
Integration
Code sample.
// Register a bilateral OTC commitment
bcsHook.submitCommitment(
poolKey,
counterparty, // address of other party
triggerSqrtPrice, // execution price as sqrtPriceX96
token0Amount, // amount of token0 to deliver
token1Amount // amount of token1 to receive
);