Turbo Mode
Build flash loan instructions 100% locally in ~91µs — no API call, no HTTP, no network. 2,000× faster than a round-trip.
Latency Comparison
| SDK | Network Calls | Build Time | Total Latency |
|---|---|---|---|
| VAEA Turbo | 0 HTTP + 2 RPC | ~91µs | ~100ms |
| VAEA Standard | 1 HTTP + 2 RPC | ~5ms | ~180ms |
| Jupiter Perps | 2-3 RPC | ~15ms | ~200-400ms |
| Marginfi Flash | 3-4 RPC | ~20ms | ~300-500ms |
| Solend Flash | 4+ RPC | ~30ms | ~400-600ms |
Code Examples
How It Works
The SDK contains a hardcoded token registry and replicates the backend's instruction builder locally:
- PDA derivation — computes flash vault, user state, config accounts
- Account resolution — derives token accounts, ATAs, lookup table addresses
- Instruction assembly — builds the borrow → your IXs → repay sandwich
localBuild() API
For full control, use localBuild() to get raw instructions without executing:
When to Use
| Criteria | Turbo (executeLocal) | Standard (execute) |
|---|---|---|
| Speed | ~100ms | ~180ms |
| API dependency | None | VAEA API required |
| Offline capable | ✅ Yes | ❌ No |
| Route updates | ❌ Uses cached registry | ✅ Always fresh |
| Best for | Bots, HFT, production | General use, prototyping |
💡 Tip
Pre-warm with flash.warmCache() at boot for even faster first execution. Combine with sendVia: 'jito' for private MEV-protected execution.borrowLocal() vs executeLocal()
Two levels of control — choose based on how much you want the SDK to handle:
| Method | Returns | Sends TX? | Use Case |
|---|---|---|---|
borrowLocal(params) | TransactionInstruction[] | ❌ No | Get instructions — you build, sign, send |
executeLocal(params, opts) | string (tx signature) | ✅ Yes | One-liner: build + sign + send + confirm |