Skip to main content

Message Types

TypeDescription
pingLatency probe; server responds with pong.
configureInitial session setup with wallets and strategy.
update_strategyChange strategy parameters mid session.
close_positionRemove a position from tracking.
request_exit_signalManually request an exit transaction.
update_walletsAdd or remove wallets mid session.
update_position_strategyOverride strategy for a single position.
update_watch_walletsAdd or update watch wallets for copy trading.
mirror_buy_resultReport outcome of a mirror buy transaction.

ping

{
  "type": "ping",
  "client_time_ms": 1706000000000
}
FieldTypeRequiredDescription
client_time_msnumberYesClient timestamp in milliseconds. Compare with pong.server_time_ms to measure latency.

configure

Sent once after receiving hello_ok. Sets the wallets to watch and the strategy to evaluate.
{
  "type": "configure",
  "wallet_pubkeys": [
    "WalletPubkey1...",
    "WalletPubkey2..."
  ],
  "strategy": {
    "target_profit_pct": 5.0,
    "stop_loss_pct": 1.5,
    "trailing_stop_pct": 3.0,
    "sell_on_graduation": false
  },
  "deadline_timeout_sec": 45,
  "send_mode": "helius_sender",
  "tip_lamports": 1000,
  "watch_wallets": [
    { "pubkey": "WatchWalletPubkey1..." },
    { "pubkey": "WatchWalletPubkey2...", "auto_buy": { "wallet_pubkey": "YourBuyWallet...", "amount_quote_units": 100000000 } }
  ],
  "mirror_config": {
    "max_positions_per_wallet": 1,
    "cooldown_sec": 30,
    "skip_creator_tokens": false,
    "max_active_sol": 5.0,
    "buy_slippage_bps": 2500,
    "min_liquidity_sol": null,
    "max_entry_drift_pct": null,
    "max_consecutive_losses": null
  }
}
FieldTypeRequiredDescription
wallet_pubkeysstring[]YesOne or more wallet public keys to monitor.
strategyobjectYesStrategy configuration. See Strategy Configuration.
deadline_timeout_secnumberNoSeconds of inactivity before the server auto-generates an exit signal. Omit or set to 0 to disable.
send_modestringNoTransaction submission mode: "rpc", "helius_sender", or "astralane". Default: "rpc".
tip_lamportsnumberNoPriority fee tip in lamports. Default: 1000 (0.001 SOL).
watch_walletsWatchWalletEntryMsg[]NoOptional list of external wallets to mirror for copy trading. Each entry has pubkey (string) and optional auto_buy (AutoBuyConfigMsg).
mirror_configMirrorConfigMsgNoOptional hardening settings for mirror trading. See Mirror Config below.

Mirror Config

The mirror_config object controls safety limits and behavior for mirror (copy) trading. All fields are optional; the server uses sensible defaults when omitted.
FieldTypeDefaultDescription
max_positions_per_walletnumber1Maximum concurrent mirrored positions per watched wallet. Additional signals are ignored until an existing position closes.
cooldown_secnumber30Minimum seconds between mirror buys from the same watched wallet.
skip_creator_tokensbooleanfalseWhen true, ignore buy signals where the watched wallet is the token creator.
max_active_solnumber5.0Maximum total SOL exposure across all active mirrored positions. New signals are skipped when this cap would be exceeded.
buy_slippage_bpsnumber2500Slippage tolerance in basis points for mirror buy transactions (2500 = 25%).
min_liquidity_solnumbernullMinimum pool liquidity in SOL required to execute a mirror buy. null to disable.
max_entry_drift_pctnumbernullMaximum allowed price drift (%) from the watched wallet’s entry price. null to disable.
max_consecutive_lossesnumbernullAfter this many consecutive losing trades from a watched wallet, the wallet is auto-disabled and a mirror_wallet_auto_disabled event is sent. null to disable.
The SDKs send configure automatically when you call StreamClient.connect() or StreamSession.connect().
All wallets in wallet_pubkeys must be registered to your account before connecting. The stream will reject unregistered wallets with error code wallet_not_registered.

update_strategy

Update the strategy without reconnecting. Takes effect immediately for all tracked positions.
{
  "type": "update_strategy",
  "strategy": {
    "target_profit_pct": 15.0,
    "stop_loss_pct": 3.0,
    "trailing_stop_pct": 7.0,
    "sell_on_graduation": true
  }
}
FieldTypeRequiredDescription
strategyobjectYesNew strategy to apply.
session.updateStrategy({
  target_profit_pct: 15,
  stop_loss_pct: 3,
  trailing_stop_pct: 7,
});

close_position

Remove a position from tracking. The server will stop monitoring PnL and will not generate exit signals for it. Identify the position by either position_id or token_account.
{
  "type": "close_position",
  "position_id": 1
}
Or by token account:
{
  "type": "close_position",
  "token_account": "ATA..."
}
FieldTypeRequiredDescription
position_idnumberNo*Position ID to close. Mutually exclusive with token_account.
token_accountstringNo*Token account address. Mutually exclusive with position_id.
*One of position_id or token_account is required.
// By handle (from StreamSession)
session.close(handle);

// By position ID (via sender)
session.sender().closeById(1);

// By token account
session.sender().closePosition("ATA...");

request_exit_signal

Manually request the server to generate an exit transaction for a position, regardless of whether the strategy thresholds have been met.
{
  "type": "request_exit_signal",
  "position_id": 1,
  "slippage_bps": 3000
}
Or by token account:
{
  "type": "request_exit_signal",
  "token_account": "ATA...",
  "slippage_bps": 3000
}
FieldTypeRequiredDescription
position_idnumberNo*Position ID. Mutually exclusive with token_account.
token_accountstringNo*Token account. Mutually exclusive with position_id.
slippage_bpsnumberNoOverride slippage for this exit transaction.
*One of position_id or token_account is required. The server responds with an exit_signal_with_tx containing the unsigned transaction.
// Using StreamSession
session.requestExitSignal(handle, 3000);

// Using sender directly
session.sender().requestExitSignal("ATA...", 3000);
session.sender().requestExitSignalById(1, 3000);

update_wallets

Add or remove wallets from the session without reconnecting. The server will start monitoring the new set and stop tracking wallets that are no longer listed.
{
  "type": "update_wallets",
  "wallet_pubkeys": [
    "WalletPubkey1...",
    "WalletPubkey3..."
  ]
}
FieldTypeRequiredDescription
wallet_pubkeysstring[]YesUpdated list of wallets to monitor.
session.sender().updateWallets([
  "WalletPubkey1...",
  "WalletPubkey3...",
]);

update_position_strategy

Override the strategy for a single position without affecting other tracked positions.
{
  "type": "update_position_strategy",
  "position_id": 1,
  "strategy": {
    "target_profit_pct": 200.0,
    "stop_loss_pct": 5.0,
    "trailing_stop_pct": 10.0
  }
}
FieldTypeRequiredDescription
position_idnumberYesPosition to override.
strategyobjectYesStrategy override for this position only.
session.sender().updatePositionStrategy(positionId, {
  target_profit_pct: 200,
  stop_loss_pct: 5,
  trailing_stop_pct: 10,
});

update_watch_wallets

Add or update watch wallets mid-session for copy trading. Replaces the current watch wallet list.
{
  "type": "update_watch_wallets",
  "watch_wallets": [
    { "pubkey": "WatchWalletPubkey1..." },
    { "pubkey": "WatchWalletPubkey2...", "auto_buy": { "wallet_pubkey": "YourBuyWallet...", "amount_quote_units": 100000000 } }
  ]
}
FieldTypeRequiredDescription
watch_walletsWatchWalletEntryMsg[]YesUpdated list of wallets to mirror.
Each WatchWalletEntryMsg has:
FieldTypeRequiredDescription
pubkeystringYesPublic key of the wallet to watch.
auto_buyAutoBuyConfigMsgNoIf set, automatically mirror buys from this wallet.
mirror_sellbooleanNoReserved for future use. When true, mirror sells from this wallet in addition to buys. Default: false. Currently unused.
AutoBuyConfigMsg:
FieldTypeRequiredDescription
wallet_pubkeystringYesYour wallet that will execute the buy.
amount_quote_unitsnumberYesAmount in quote asset atomic units per buy.
amount_usd1_unitsnumberNoAmount in USD1 atomic units (alternative).
session.sender().updateWatchWallets([
  { pubkey: "WatchWalletPubkey1..." },
  { pubkey: "WatchWalletPubkey2...", auto_buy: { wallet_pubkey: "YourBuyWallet...", amount_quote_units: 100000000 } },
]);

mirror_buy_result

Reports the outcome of a mirror buy transaction back to the stream. Send this after you sign and submit (or fail to submit) the transaction from a mirror_buy_signal event. The stream uses this feedback to update internal state, track consecutive losses, and manage cooldown timers.
{
  "type": "mirror_buy_result",
  "mint": "TokenMint...",
  "success": true
}
FieldTypeRequiredDescription
mintstringYesToken mint address from the original mirror_buy_signal.
successbooleanYestrue if the transaction was signed and submitted successfully, false otherwise.
session.sender().mirrorBuyResult("TokenMint...", true);