Files
lapa_v3/README.md

74 lines
6.5 KiB
Markdown

┌───────────────────────────────────────────┐
│ ENTRADAS │
│ │
LIVE │ (A) Yellowstone Geyser -> txu │
(suscripción) ───▶│ (SubscribeUpdateTransaction) │
│ │
REPLAY │ (B) Archivo tx.bin (VersionedTx bincode) │
(logs/frames/bin) └───────────────┬───────────────────────────┘
┌───────────────────────────────────────────┐
│ main.rs │
│ - configura adapters[] │
│ - configura RPC │
│ - selecciona fuente: (A) o (B) │
└───────────────┬───────────────────────────┘
(A) txu │ (B) tx.bin
directo │ load_versioned_tx
┌───────────────────────────────────────────┐
│ engine.rs │
│ to_snapshot() -> TxuSnapshot │
│ - version (legacy/v0) │
│ - account_keys + (ALT lookups opc.) │
│ - instrucciones (orden + data) │
│ - compute budget ixs │
└───────────────┬───────────────────────────┘
│ TxuSnapshot
┌─────────────────────────────────────────────────────────┐
│ protocols.rs │
│ adapters[] = [ Meteora, PumpFun, Bonk, ... ] │
│ │
│ ┌──────────────┐ probe() ┌─────────────────────┐ │
│ │ Meteora │◀───────────▶│ TxuSnapshot │ │
│ └─────┬────────┘ └─────────────────────┘ │
│ │ (si reconoce) │
│ ▼ │
│ extract_plan() -> SwapPlan │
│ - PDAs/vaults del pool (NO cambiar) │
│ - mints/cantidades (si las decodificas) │
│ - ixs crudas (incl. ComputeBudget) │
│ │
│ build_message(SwapPlan, my_owner) -> PreparedMessage │
│ - sustituye: payer + ATAs del bundler → TUS ATAs │
│ - conserva: PDAs/vaults/Program IDs │
│ - WSOL/ATA lifecycle (si faltan, marca crear) │
│ - v0+ALT: reutiliza ALT o expande claves │
└─────────┬───────────────────────────────────────────────┘
│ PreparedMessage (mensaje SIN firmar)
┌───────────────────────────────────────┐
│ main.rs │
│ - inyecta recent_blockhash (RPC) │
│ - agrega ixs extra (create ATA/WSOL)│
│ - firma con tu Keypair │
└───────────────┬──────────────────────┘
│ VersionedTransaction firmado
┌──────────────────────────────────────────────────┐
│ rpc.rs │
│ getLatestBlockhash() │
│ simulateTransaction() ──▶ (CUs, logs, errores) │
│ sendTransaction() ──▶ signature (base58) │
└───────────────────┬──────────────────────────────┘
┌────────────────────────────┐
│ Resultado │
│ - ok: firma/slot │
│ - fail: motivo/log │
└────────────────────────────┘