πŸ”€ Routing & Routes

Routing & Routes

How VAEA Flash routes your borrow request through lending protocols and swap providers to deliver any token.

How Routing Works

text
flash.executeLocal({ token: 'mSOL', amount: 5000 })
       ↓
1. Is mSOL a direct route token?
   β†’ Check Marginfi: NO  β†’  Check Kamino: NO  β†’  Check Save: NO
       ↓
2. Use synthetic route:
   β†’ Borrow SOL from Marginfi (cheapest, deepest liquidity)
   β†’ Swap SOL β†’ mSOL via Sanctum (~0.03% cost)
   β†’ Execute your logic with mSOL
   β†’ Swap mSOL β†’ SOL via Sanctum
   β†’ Repay SOL + VAEA fee to Marginfi

Protocol Priority

PriorityProtocolStrengths
1stMarginfiDeepest liquidity for SOL, USDC, USDT β€” lowest borrow cost
2ndKaminoBest for cbBTC, JLP β€” alternative liquidity for SOL/USDC
3rdSave (Solend)Fallback for major tokens when others are at capacity

Fallback is automatic and transparent β€” you don't specify which protocol to use. If Marginfi is at capacity, VAEA silently falls back to Kamino, then Save.

Swap Providers

ProviderUsed ForTypical Slippage
SanctumLSTs (mSOL, bSOL, INF, laineSOL)~0.03%
JupiterEverything else (BONK, TRUMP, PENGU…)~0.05–0.12%
ℹ️ Note
Sanctum is preferred for LSTs because it offers stake account routing with near-zero slippage.

Fallback Behavior

text
Request: Borrow 10,000 SOL
  ↓
Marginfi: 8,000 SOL available β†’ NOT ENOUGH
  ↓ fallback
Kamino: 15,000 SOL available β†’ βœ“
  ↓
Borrow 10,000 SOL from Kamino
πŸ’‘ Tip
You can force a specific source with source: 'kamino' in the options, but auto-routing handles 99% of cases optimally.