Skip to main content

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.

Hadron lets you add or subtract 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: Offer tighter spreads (negative spread_bps) to transactions with clear signs of retail origin, such as the Phantom/Solflare fee accounts or the Jupiter Ultra fee accounts.

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.
use hadron_sdk::types::{UpdateSpreadConfigParams, SpreadTriggerInput};

let ix = pool.update_spread_config(&admin, &UpdateSpreadConfigParams {
    triggers: vec![
        SpreadTriggerInput {
            account: competing_amm_program_id,
            spread_bps: 25,           // add 25 bps to penalise arb flow
            match_mode: Some(1),      // AfterProgramId
        },
        SpreadTriggerInput {
            account: phantom_fee_account,
            spread_bps: -5,           // subtract 5 bps to reward retail flow
            match_mode: None,         // defaults to Anywhere (0)
        },
    ],
});
ParamTypeDescription
admin&PubkeySpread config admin signer
params.triggersVec<SpreadTriggerInput>Full list of spread triggers to store (replaces previous list)
params.triggers[].accountPubkeyAccount or program key to match against the instruction context
params.triggers[].spread_bpsi32Extra spread in basis points. Positive adds spread (penalises flow); negative subtracts spread (rewards flow)
params.triggers[].match_modeOption<u8>0 = Anywhere (match if account appears anywhere in the transaction accounts list); 1 = AfterProgramId (match only if account appears immediately after the program ID in the accounts list)