Message Types
| Type | Description |
|---|---|
ping | Latency probe; server responds with pong. |
configure | Initial session setup with wallets and strategy. |
update_strategy | Change strategy parameters mid session. |
close_position | Remove a position from tracking. |
request_exit_signal | Manually request an exit transaction. |
update_wallets | Add or remove wallets mid session. |
update_position_strategy | Override strategy for a single position. |
update_watch_wallets | Add or update watch wallets for copy trading. |
mirror_buy_result | Report outcome of a mirror buy transaction. |
ping
| Field | Type | Required | Description |
|---|---|---|---|
client_time_ms | number | Yes | Client 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.
| Field | Type | Required | Description |
|---|---|---|---|
wallet_pubkeys | string[] | Yes | One or more wallet public keys to monitor. |
strategy | object | Yes | Strategy configuration. See Strategy Configuration. |
deadline_timeout_sec | number | No | Seconds of inactivity before the server auto-generates an exit signal. Omit or set to 0 to disable. |
send_mode | string | No | Transaction submission mode: "rpc", "helius_sender", or "astralane". Default: "rpc". |
tip_lamports | number | No | Priority fee tip in lamports. Default: 1000 (0.001 SOL). |
watch_wallets | WatchWalletEntryMsg[] | No | Optional list of external wallets to mirror for copy trading. Each entry has pubkey (string) and optional auto_buy (AutoBuyConfigMsg). |
mirror_config | MirrorConfigMsg | No | Optional hardening settings for mirror trading. See Mirror Config below. |
Mirror Config
Themirror_config object controls safety limits and behavior for mirror (copy) trading. All fields are optional; the server uses sensible defaults when omitted.
| Field | Type | Default | Description |
|---|---|---|---|
max_positions_per_wallet | number | 1 | Maximum concurrent mirrored positions per watched wallet. Additional signals are ignored until an existing position closes. |
cooldown_sec | number | 30 | Minimum seconds between mirror buys from the same watched wallet. |
skip_creator_tokens | boolean | false | When true, ignore buy signals where the watched wallet is the token creator. |
max_active_sol | number | 5.0 | Maximum total SOL exposure across all active mirrored positions. New signals are skipped when this cap would be exceeded. |
buy_slippage_bps | number | 2500 | Slippage tolerance in basis points for mirror buy transactions (2500 = 25%). |
min_liquidity_sol | number | null | Minimum pool liquidity in SOL required to execute a mirror buy. null to disable. |
max_entry_drift_pct | number | null | Maximum allowed price drift (%) from the watched wallet’s entry price. null to disable. |
max_consecutive_losses | number | null | After 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. |
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.
| Field | Type | Required | Description |
|---|---|---|---|
strategy | object | Yes | New strategy to apply. |
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.
| Field | Type | Required | Description |
|---|---|---|---|
position_id | number | No* | Position ID to close. Mutually exclusive with token_account. |
token_account | string | No* | Token account address. Mutually exclusive with position_id. |
position_id or token_account is required.
request_exit_signal
Manually request the server to generate an exit transaction for a position, regardless of whether the strategy thresholds have been met.
| Field | Type | Required | Description |
|---|---|---|---|
position_id | number | No* | Position ID. Mutually exclusive with token_account. |
token_account | string | No* | Token account. Mutually exclusive with position_id. |
slippage_bps | number | No | Override slippage for this exit transaction. |
position_id or token_account is required.
The server responds with an exit_signal_with_tx containing the unsigned transaction.
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.
| Field | Type | Required | Description |
|---|---|---|---|
wallet_pubkeys | string[] | Yes | Updated list of wallets to monitor. |
update_position_strategy
Override the strategy for a single position without affecting other tracked positions.
| Field | Type | Required | Description |
|---|---|---|---|
position_id | number | Yes | Position to override. |
strategy | object | Yes | Strategy override for this position only. |
update_watch_wallets
Add or update watch wallets mid-session for copy trading. Replaces the current watch wallet list.
| Field | Type | Required | Description |
|---|---|---|---|
watch_wallets | WatchWalletEntryMsg[] | Yes | Updated list of wallets to mirror. |
WatchWalletEntryMsg has:
| Field | Type | Required | Description |
|---|---|---|---|
pubkey | string | Yes | Public key of the wallet to watch. |
auto_buy | AutoBuyConfigMsg | No | If set, automatically mirror buys from this wallet. |
mirror_sell | boolean | No | Reserved for future use. When true, mirror sells from this wallet in addition to buys. Default: false. Currently unused. |
AutoBuyConfigMsg:
| Field | Type | Required | Description |
|---|---|---|---|
wallet_pubkey | string | Yes | Your wallet that will execute the buy. |
amount_quote_units | number | Yes | Amount in quote asset atomic units per buy. |
amount_usd1_units | number | No | Amount in USD1 atomic units (alternative). |
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.
| Field | Type | Required | Description |
|---|---|---|---|
mint | string | Yes | Token mint address from the original mirror_buy_signal. |
success | boolean | Yes | true if the transaction was signed and submitted successfully, false otherwise. |

