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

# Segmenting Flow

Hadron allows you to segment flow i.e add extra spread for certain addresses or programs to distinguish toxic flow from retail flow.

**Examples:**

* **Reduce cyclic arbitrage:** Reduce arbitrage from cyclic trading e.g. bots that buy from your pool and sell to a competing AMM pool. You can do this by adding a spread for trades involving a competing venue or specific addresses.
* **Be more competitive with retail traders:** Keep your base spread tight for retail flow (e.g. txns carrying the Phantom/Solflare fee account or the Jupiter Ultra fee accounts) and add spread only on the toxic/arb flow you target with triggers.

## **updateSpreadConfig**

Replace the pool’s spread trigger list in one call.

<Warning>
  This is a **full replacement** of existing triggers, so pass the complete final triggers array you want on-chain.
</Warning>

```typescript theme={null}
pool.updateSpreadConfig(admin, {
  triggers: [
    {
      account: competingAmmPool,
      programId: competingAmmProgramId, // trigger fires when this program touches the account
      spreadBps: 25,
    },
    {
      account: someAccount,
      programId: someProgramId,
      spreadBps: 10,
    },
  ],
});
```

| Param                        | Type                     | Description                                                                                                                                 |
| :--------------------------- | :----------------------- | :------------------------------------------------------------------------------------------------------------------------------------------ |
| admin                        | PublicKey                | Spread config admin signer.                                                                                                                 |
| params                       | UpdateSpreadConfigParams | Update payload.                                                                                                                             |
| params.triggers              | SpreadTriggerInput\[]    | Full list of spread triggers to store (replaces previous list).                                                                             |
| params.triggers\[].account   | PublicKey                | Account key to match against the instruction context.                                                                                       |
| params.triggers\[].programId | PublicKey                | Program that must use `account` for the trigger to fire. Replaces v1's `matchMode` — triggers are now scoped to a specific calling program. |
| params.triggers\[].spreadBps | number                   | Extra spread in basis points to apply when matched. Must be non-zero (encoded on-chain as `u16`).                                           |
