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

# Hedging

> Turn a trader's WhatsApp confirmation or an API request into a broker order you approve in the Inbox, then record the fill.

A **hedge** is a futures position that offsets the price risk of a physical contract; the broker's **fill** says how many lots were done and at what price. Mercora turns a trader's confirmation into a broker order you approve, then records the fill. It never sends an order without an operator's click.

> [!NOTE]
>
> Available when the **Hedging** module is turned on for your workspace. Ask your workspace admin.

## How a hedge flows

1. A trader posts a confirmation in a WhatsApp hedge group, or your system sends a hedge request through the API.
2. Mercora matches a hedge rule, works out the lots and broker order, and puts the plan in the **Inbox**.
3. You check it and send the order to the broker's WhatsApp group.
4. The broker's reply (the fill) is matched to the hedge.
5. The fill completes the hedge sheet row and, if connected, is booked in your CTRM.

## Set up hedging

A workspace admin sets this up under **Settings → Integrations → WhatsApp**, once Mercora's number is in the trader and broker groups (see [WhatsApp](https://docs.mercora.io/integrations/whatsapp.md)) and, for the hedge sheet, [Google Sheets](https://docs.mercora.io/integrations/google-sheets.md) is connected.

### Route the WhatsApp groups

Under **WhatsApp Group Routings**, set the traders' group to `hedge-source` and the broker's group to `broker-confirm` (with the broker's name). Mercora reads only routed groups, and posts in them only what you approve.

### Add hedge rules

Under **Commodity Hedge Rules**, add one rule per origin keyword and book (a commodity on an exchange). Each rule sets:

* the **Origin keyword** in a trader's message that selects it;
* the **Commodity**, **Exchange** and **Currency**;
* **Tonnes per lot**, to convert the physical quantity;
* the **Futures symbol template**, for example `QC{month}{y}`, or `{ref}` to use the origin's reference;
* the **Default broker name**, **Supplier label** and **Hedge sheet** tab to log to;
* optionally, the **Agiblocks position** a filled future is allocated to.

**Attach broker fills automatically** (off by default) attaches a fill that passes every check without review. Turn it on only if nobody else orders that contract in the broker group.

## Review a hedge plan

Open the hedge in the **Inbox**. The broker message on the card **is** the order: edit its text if needed. Under **Also on approve**, choose whether to add a row to the hedge sheet and put a thumbs-up on the trader's message. Then:

* **Send order to** the broker asks you to confirm, then posts it. A sent order can't be recalled.
* **Accumulate** parks the hedge to combine with a later one on the same futures month.
* **Already filled** (in the ▾ next to Send) records an order placed outside Mercora.
* **Dismiss** drops the hedge.

> [!WARNING]
>
> If WhatsApp sending isn't turned on for your workspace, **Send order** approves the hedge without sending anything. The trader sends the order by hand.

If no rule matches, no broker group is set up, or the contract is already hedged, the card says so.

## Record the fill

When the broker replies, the hedge shows **Fill captured · waiting on you** (unless it was attached automatically): click **Attach**, or **Dismiss — not this hedge's fill**. If no reply was captured, use **Record the fill by hand**; if the order wasn't filled, **Close without a recorded fill**. A hedge still waiting long after its order is flagged **No fill · overdue**.

The recorded fill completes the hedge sheet row and, with the **Derivatives** module on, is added to the [futures ledger](https://docs.mercora.io/records/derivatives.md).

## Hedges in Agiblocks

With **External systems sync** and its **Hedging sync** switch on, each fill is booked as a future in Agiblocks and allocated to the rule's position. It reads **Sent to Agiblocks · not yet confirmed** until Mercora finds it there.

If a step fails, the hedge shows **Agiblocks failed** in **Needs you**. **Retry booking** or **Retry allocation** checks Agiblocks first, so nothing is booked twice. **Mark as handled** records that you dealt with it in Agiblocks yourself; the failed attempt stays on record. See [External systems](https://docs.mercora.io/integrations/external-systems.md).

## Request a hedge from your own systems

Your systems can list your hedge rules, request a hedge on a physical contract, and check its status through the API. A requested hedge lands in the Inbox like any other, marked "Requested by"; nothing goes to a broker from the API. See the [API reference](https://docs.mercora.io/api-reference/introduction.md).

## Permissions

Your role needs **Hedging** (edit) to review plans, send orders and record fills, and **External sync** under Hedging to push to Agiblocks and handle failed bookings. If the module is turned off, active hedges are hidden from the Inbox. See [Roles and permissions](https://docs.mercora.io/concepts/roles-and-permissions.md).

## Next steps

* [Derivatives](https://docs.mercora.io/records/derivatives.md): see recorded fills in the futures ledger.
* [External systems](https://docs.mercora.io/integrations/external-systems.md): book fills as futures in Agiblocks.


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