Place & Manage Orders
Trade through a DeepBook BalanceManager. Create and share the on-chain escrow account, deposit funds, rest a limit bid on the book, list and cancel it, then fire a market buy that fills immediately.
The account model behind every order
- ›The BalanceManager lifecycle: create it, share it on chain, then register it with the client so later calls can find it.
- ›Resting a limit order that sits on the book versus taking with a market order that fills now.
- ›Settled versus owed reconciliation: the difference between what an order moved and what you can actually withdraw.
Five sections, end to end
-
Open the account
The BalanceManager create, share, then re-extend sequence that registers the account with your client.
src/sandbox.ts -
Deposit & rest
Fund the BalanceManager, then place a bid priced to rest on the book instead of filling immediately.
src/orders.ts -
Inspect & cancel
Read your open order IDs back from the chain, then clear the book with a single cancel-all.
src/orders.ts -
Take liquidity
Fire a market buy that fills immediately, and reconcile the settled balance against what is owed.
src/orders.ts -
Drive it
Wire the smoke UI, handle the sandbox warmup retry, and pass the live test gate.
src/App.tsx · src/main.tsx
Start this lesson
/acc-deepbook-course:start # then pick "Place & Manage Orders"
Already installed? Run the start command and choose this lesson from the catalog.
New here? Follow the install steps first. The course brings up a local sandbox and gates each section with pnpm vitest run.