Use casesHow it worksDocsLaunch app

Blog · October 2, 2026

Testing flash loans in plain Rust

Warp the clock, deal tokens, seed a pool, sign as someone else — then assert the repay and the revert.

The wedesak-kit runs your program and the loan in one process. A full borrow, two swaps and a repay complete in milliseconds, so you can afford a test for every revert path rather than one happy-path script.

The cheatcodes cover the states that are hard to reach on a live cluster: warp_to_slot for expiry and oracle staleness, set_account for a pool at a precise price or a position at a precise health factor, deal for balances, and prank for permission checks.

What the kit does not do is fork mainnet. We think that is the right trade: snapshot the handful of accounts your route touches once, commit them as fixtures, and your tests stop depending on an RPC being up.

← All posts