Transaction lifecycle
Every swap runs through one state machine, from getting the order to the receipt. Try it.
IdleGetting orderSign in walletLandingSuccess
FailedOrder expired
Current phase
IdleButton shows
SwapReady
isBusy = falseEvents
Path so far: Idle
Source: src/features/docs-site/swap-model.ts → txReducer()
Phases
Getting orderButton locked
Sign in walletButton lockedYour wallet is open
LandingButton locked
Success · Failed · Order expiredButton free
15 s: taking longerAbout 60–90 s: the blockhash expires and the order with it
Source: src/features/docs-site/swap-model.ts
An order is valid until its blockhash expires, about 60 to 90 seconds on Solana (lastValidBlockHeight). If you take
longer to sign, or the transaction can't land in time, /swap/execute fails with an expiry code and the app gets you a
new price.
Safe by construction
- Double-clickSecond click ignored
- Order expires before it landsNew price, you sign again
- Reject in walletBack to idle, nothing sent
Source: src/features/docs-site/swap-model.ts