Smart Retry
Automatic transaction retry with priority fee escalation (ร1.5 per attempt) and intelligent error classification. Never retries program errors.
How It Works
Code Examples
Error Classification
| Classified As | Error Patterns | Action | Retried? |
|---|---|---|---|
| expired | Blockhash not found, expired, block height exceeded | Rebuild TX with fresh blockhash + retry | โ |
| congestion | All other errors (timeout, network) | Priority fee ร1.5, wait 400ms, retry | โ |
| program_error | InstructionError, Custom(...), custom program error | Stop immediately โ your logic has a bug | โ Never |
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
maxAttempts | number | 3 | Maximum number of send attempts |
strategy | 'none' | 'adaptive' | adaptive | none = single attempt, adaptive = smart retry |
onRetry | (attempt, reason) => void | undefined | Callback fired on each retry for logging |
โ ๏ธ Warning
Program errors (logic bugs in your instructions) are never retried. This prevents wasting SOL on transactions that will always fail.๐ก Tip
When using Jito Bundles, Smart Retry escalates the tip amount instead of the priority fee.