DeFi Rate Limit Lab
Production-style transaction flow for rate-limited borrows.
Compare the two limiter mechanisms with the same reusable execution workflow: preflight on the public client, explicit wallet prompt, receipt confirmation, and visible failure states.
Network
Base Sepolia
Wallet
--
Flow
simulate -> wallet -> confirm
Model
single active mechanism
BucketedRateLimiter
Strict rolling window
Hard ceiling across the most recent rolling hour. Use this when you want deterministic recent-volume controls.
Window Limit
--
Used Now
--
Remaining
--
Recent Buckets
One slot per on-chain bucket. Old slots fall out of the rolling hour automatically.
50 min ago
0 units
40 min ago
0 units
30 min ago
0 units
20 min ago
0 units
10 min ago
0 units
Now
0 units
Borrow Workflow
The execution path is fixed: validate input, run a public-client simulation, prompt the wallet, then wait for confirmation.
Execution Status
Ready
Use the preflight step to verify the rolling-window cap before the wallet prompt appears.
Validate input
completeDisplay amount 250,000 maps to raw contract amount 250000.
Simulate on public client
pendingRun publicClient.simulateContract(borrow(250000)) to catch limiter reverts before the wallet prompt.
Prompt wallet
pendingAsk the wallet to sign and broadcast the prepared borrow request with zero ETH value.
Confirm onchain
pendingWait for the receipt so the UI only reports success after settlement.
Status Logs
0 entriesNo execution logs yet. Run simulate or send to populate the audit trail.
Preflight Preview
Simulation output appears here
Run the simulation to confirm the window state for the typed amount before you prompt the wallet.