multiversx-flash-loan-patterns
Installation
SKILL.md
MultiversX Atomic Lend-Execute-Verify Pattern
A pattern for operations that temporarily lend assets, execute an external callback, and verify repayment — all atomically within a single transaction.
What Problem Does This Solve?
You want to lend tokens to a contract, let it execute arbitrary logic, and guarantee repayment (plus fee) before the transaction completes. If repayment fails, the entire transaction reverts.
When to Use
| Scenario | Use This Pattern? |
|---|---|
| Flash loans | Yes — the canonical use case |
| Atomic swaps with verification | Yes — send tokens, verify counterparty sent back |
| Temporary grants (execute-then-return) | Yes — lend tokens for computation, verify return |
| Cross-shard operations | No — atomicity requires same-shard |
| Simple transfers | No — overkill |