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.
SDK Build + Send Latency
Time from "I want a flash loan" to "TX is sent to the network". On-chain confirmation (~400ms/slot) is the same for everyone.
| Mode | RPC Calls Before Send | IX Build Time | Send-to-Network |
|---|---|---|---|
| VAEA Turbo | 2 (blockhash + send) | ~91µs | ~100ms |
| VAEA Standard | 3 (API + blockhash + send) | ~5ms | ~180ms |
| Direct Marginfi SDK | 5+ (banks, vaults, oracles, blockhash, send) | ~20ms | ~300-500ms |
| Direct Kamino SDK | 4+ (reserves, oracles, blockhash, send) | ~15ms | ~250-400ms |
ℹ️ Note
VAEA Turbo is faster because the VAEA SDK pre-resolves all protocol accounts (Marginfi banks, vaults, oracles) into a hardcoded local registry. Direct SDKs must fetch these accounts via RPC on every call because their state changes. The actual on-chain execution uses the same protocols — the speed gain is in TX construction, not execution.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 |