Pending-swap tracking is the process of following a signed Solana transaction from initial processing through confirmed and finalized commitment. The key condition is whether your business is recording provisional activity or authorizing an action that must not be reversed. A treasury system can show a swap as seen at processed, but should not treat that as durable settlement. When documenting how staff initiate or review a swap, how to use Byreal is a concrete example of the trading workflow that produces the transaction signature your monitor will track.
Use commitment levels as separate settlement gates
Processed means a validator has processed the transaction in a block on its view of the cluster; that block can still be skipped or displaced. Confirmed means the block has received a supermajority of stake votes, making reversal much less likely. Finalized means the block has become rooted, the strongest normal commitment level for operational settlement.
These states describe confidence in the containing block, not three executions of the swap. A transaction with a non-null err has failed at the reported commitment, even if the fee payer was charged; success requires both a sufficient commitment and err: null. Solana’s commitment documentation defines the levels, while its RPC reference describes the status fields used to observe them.
Set gates by consequence. For a treasury dashboard, processed can support a “submitted” indicator and confirmed success can support a provisional balance; for a payout batch or an irreversible reconciliation entry, wait for finalized success. Byreal fits this same distinction: the on-chain swap is the event, while your accounting policy decides when that event counts as settled.
Track the signature, then verify the swap result
Persist the transaction’s first signature, submission time, and recent blockhash context before you wait for confirmation. An RPC sendTransaction response only says the RPC accepted the signed bytes for forwarding; it does not prove the transaction landed. Subscribe with WebSocket signatureSubscribe for prompt notification at the commitment you need, and use HTTP getSignatureStatuses as a recovery check after disconnects.
getSignatureStatuses returns confirmationStatus, err, and slot data, but it has no commitment parameter: compare the returned level against your own gate. A missing status is not proof of failure; the signature may be absent from that RPC node’s recent status cache. Set searchTransactionHistory: true for older signatures, recognizing that historical lookup depends on the provider retaining transaction history.
After confirmed or finalized success, verify the transaction’s actual token-account balance changes and execution metadata before crediting the intended asset amount. A successful signature alone does not prove the expected amount reached the expected account: fees, token decimals, intermediary accounts, or a misclassified transaction can make a simple signature-to-credit mapping wrong. Store the signature, slot, commitment, error, and parsed asset deltas for an audit trail.
Handle uncertainty without creating duplicate swaps
Suppose a finance team swaps treasury assets for a scheduled payout, receives a signature, then loses its WebSocket connection while the status is still pending. It should query status from its RPC endpoint and, if still absent, check another trusted endpoint or enable historical search as the transaction ages. Do not immediately sign a second swap: the first may have landed while the monitor was offline.
A recent blockhash eventually expires, but expiry is not evidence that a submitted transaction failed; it only prevents that signed message from being newly processed after its validity window. If status remains unknown after expiry, search transaction history and reconcile the source and destination token accounts before creating a replacement. Rebroadcasting the identical signed transaction while it remains valid preserves its signature; creating a new signed transaction creates a distinct swap that could also execute.
Operational checklist:
- Persist the signature and blockhash context at submission.
- Show processed as provisional; require err: null at the policy’s commitment gate.
- Use subscriptions for speed and status queries for recovery.
- Before replacing an uncertain, expired transaction, search history and reconcile balances.
- Record finalized success and verified token deltas for settlement.