> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kuru.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Post-Fill Hooks

> Integrate synchronous maker callbacks for bounded quote refreshes.

A maker may configure one hook contract for its account after protocol access has been granted. The maker or a `TRADE` signer calls `setPostFillHook(userId, hook)`; clearing to the zero address is always permitted.

## Trigger boundary

A hook is staged when a fill removes an active maker slot:

* full fill;
* partial fill whose residual is removed as dust; or
* stale RAB touch that consumes the complete exposed chunk.

A partial fill that leaves a live residual does not trigger the hook. Staged hooks run after the current price boundary is exhausted or the taker finishes, before the engine recomputes BBO.

`PostFillContext` supplies the maker ID, market, filled slot and order, post-fill/pre-refresh BBO, and advisory remaining taker size. A returned plan may replenish the filled slot, replace an opposite-side slot, or do both. Every quote must remain post-only and pass normal tick, size, reserve, and hook-minimum checks.

## Failure and side-effect boundary

Callback reverts, callback out-of-gas, malformed output, and invalid returned refresh plans are caught so matching can continue. This is not a sandbox: when a callback returns successfully, any authorized external side effects it performed persist and can still cause the outer action to fail later.

Hook quotes reserve from true free balance or reserve released by a sibling replacement in the same refresh. They cannot reuse the reserve consumed by the fill that triggered the hook.

The gas limit bounds each callback, not the total number of callbacks or same-transaction replenishments. Taker size and transaction gas remain the outer bounds.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.