Flash Loan

Um flash loan é um tipo de empréstimo sem garantia na finança descentralizada (DeFi) que permite aos usuários emprestar ativos sem fornecer nenhuma garantia, desde que o empréstimo seja pago dentro do mesmo bloco de transação.

Conteúdo pendente de tradução. Exibindo a versão em inglês.

Topologies: 1. Primary-Replica (One writer, many readers). 2. Multi-Primary (Anyone can write). 3. Peer-to-Peer. Methods: Statement-based (log commands), Row-based (log data changes). Challenges: Network partitions, split-brain, data drift, bandwidth consumption.

        graph LR
  Center["Flash Loan"]:::main
  Rel_arbitrage["arbitrage"]:::related -.-> Center
  click Rel_arbitrage "/terms/arbitrage"
  Rel_decentralized_exchange_dex_order_book_aggregation["decentralized-exchange-dex-order-book-aggregation"]:::related -.-> Center
  click Rel_decentralized_exchange_dex_order_book_aggregation "/terms/decentralized-exchange-dex-order-book-aggregation"
  Rel_dex_exploits["dex-exploits"]:::related -.-> Center
  click Rel_dex_exploits "/terms/dex-exploits"
  classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
  classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
  classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
  classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
  linkStyle default stroke:#4b5563,stroke-width:2px;

      

🧒 Explique como se eu tivesse 5 anos

Imagine you are writing a story in a shared Google Doc with a friend. Every time you type a letter, it appears on your friend's screen instantly. That is replication. If your computer explodes, your friend still has the whole story on their screen. If you were just taking 'Backups', your friend would have to wait until you emailed them a copy every hour, which would be much slower.

🤓 Expert Deep Dive

Technically, replication is governed by the 'CAP Theorem' (Consistency, Availability, Partition Tolerance). In 'Synchronous Replication', a write is only successful once all replicas confirm they have received it. This ensures 'Strong Consistency' but increases latency. In 'Asynchronous Replication', the master confirms the write immediately and sends the update to replicas in the background. This is faster but introduces 'Replication Lag'—a period where the replica is slightly behind the master. A major challenge in multi-master setups is 'Partial Replicated Data', where two users update the same record on different masters at the same time, necessitating 'Conflict Resolution' strategies like 'Last Write Wins' or 'Causal Ordering' using 'Vector Clocks'. In the world of NoSQL, 'Eventual Consistency' is often accepted as a trade-off for massive horizontal scale.

📚 Fontes