> ## 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 lets you add extra spread for specific addresses or programs, letting you distinguish toxic flow from retail flow.

**Examples:**

* **Reduce cyclic arbitrage:** Add spread for trades involving competing venue programs or specific bot addresses that buy from your pool and sell to a competing AMM.
* **Be more competitive with retail traders:** Keep your base spread tight for retail flow (e.g. txns carrying the Phantom/Solflare fee accounts 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.

> **Full replacement** This is a full replacement of all existing triggers. Always pass the complete final list you want on-chain — not just the new entries.

```rust theme={null}
use hadron_sdk_v2::types::{UpdateSpreadConfigParams, SpreadTriggerInput};

let ix = pool.update_spread_config(&admin, &UpdateSpreadConfigParams {
    triggers: vec![
        SpreadTriggerInput {
            account: competing_amm_pool,
            program_id: competing_amm_program_id, // trigger fires when this program touches the account
            spread_bps: 25,                       // add 25 bps to penalise arb flow
        },
        SpreadTriggerInput {
            account: some_account,
            program_id: some_program_id,
            spread_bps: 10,
        },
    ],
});
```

| **Param**                      | **Type**                  | **Description**                                                                                                                          |
| ------------------------------ | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `admin`                        | `&Pubkey`                 | Spread config admin signer                                                                                                               |
| `params.triggers`              | `Vec<SpreadTriggerInput>` | Full list of spread triggers to store (replaces previous list)                                                                           |
| `params.triggers[].account`    | `Pubkey`                  | Account key to match against the instruction context                                                                                     |
| `params.triggers[].program_id` | `Pubkey`                  | Program that must use `account` for the trigger to fire. Replaces v1's `match_mode` — triggers are scoped to a specific calling program. |
| `params.triggers[].spread_bps` | `u16`                     | Extra spread in basis points to add when matched. Must be non-zero.                                                                      |
