AI Market Making for Small Treasuries: Can You Get the Cash Back?
Conceptual DN illustration of cash and token inventory. No specific product or return is depicted.
Decentralised News Research · Treasury operations
The practical question is whether the treasury can meet its obligations when quoting stops. A screen showing a healthy account value is only one piece of that answer. Some quote currency may support open bids, some value may sit in tokens, and a withdrawal may still need conversion, processing or approval.
This guide covers unleveraged spot market making on an order book. It provides an original DN Treasury Cash and Inventory Planner, a partial-fill ledger and a cost comparison. It does not evaluate AMM liquidity positions, borrowing or derivatives. All worked amounts are synthetic; no exchange account was funded or tested for this article.
1. Give each balance a job
For this worksheet, the operating account and exchange account are separate. The operating reserve contains cash already received and usable for the bills in scope. Exchange quote currency is the asset used to price trades; base inventory is the token being bought and sold. Dollar-denominated reporting does not make every asset a bank dollar.
| Question | Record | What it establishes |
|---|---|---|
| Can we pay the bills? | Usable operating cash, obligations and their deadlines. | Coverage from money already at the payment destination. |
| What is committed to trading? | Reconciled free quote, holds, open orders, fills and distinct unresolved commitments. | A snapshot of trading restrictions and potential exposure. |
| What might an exit recover? | Inventory quantity, assumed executable prices, costs and an available transfer route. | A conditional recovery estimate until execution and receipt are confirmed. |
Coinbase's account response exposes separate balance, hold and available fields, along with account currency and profile. These are useful evidence fields, but their names do not prove cash has reached a bank. Match the account, asset and observation time before combining balances with orders or fills. [3]
2. A $7,000 account can contain only $3,497 of free quote
Synthetic opening snapshot: an organisation has $12,000 in its operating account and $8,000 of bills due over the next 30 days. Separately, its exchange account holds $5,000 of USD quote currency and 20 units of an invented token, EXAMPLE. The valuation mark is $100 per unit. There is no leverage, pending deposit or additional exchange restriction in this simplified ledger.
The bot has an open bid for 15 units at $100. Assume the venue reserves a 0.2% quote-currency fee alongside that bid: $1,500 + $3 = $1,503 held. Coinbase documents this kind of initial limit-buy reservation and base-asset holds for sell orders. Its rule is evidence for the distinction; the worked fee and amounts here are invented. [1]
| Item | Amount | Interpretation |
|---|---|---|
| Operating cash already received | $12,000 | Held outside the exchange. |
| Bills within 30 days | $8,000 | Leaves a $4,000 banked buffer before other obligations. |
| Total exchange quote | $5,000 | Includes both free quote and the bid hold. |
| Quote held for the bid | $1,503 | Restricted for an order; not a separate loss. |
| Venue free quote | $3,497 | $5,000 minus $1,503, under this ledger's assumptions. |
| Additional uncertainty reserve | $500 | A distinct unresolved request, assumed absent from the observed hold or debit. |
| Provisional planning headroom | $2,997 | $3,497 minus the separate $500 reserve. Reconcile the unknown request before further quoting. |
| Total EXAMPLE inventory | 20 units | Includes 5 units held in open asks; those 5 are not extra assets. |
| Marked exchange assets | $7,000 | $5,000 quote plus $2,000 marked inventory. This is not bank cash. |
Do not subtract the $1,503 again from an already-free balance. Equally, do not reserve the $500 again if a refreshed record shows that the same commitment is already held or debited. The manual reserve is a planning allowance for a separately identified uncertainty, not evidence that another order is safe to place.
In this disjoint ledger: total quote = venue free quote + bid hold.
Provisional headroom = max(0, venue free quote − additional reserve).
Real accounts may have frozen funds, pending transfers, other assets or liabilities. Reconcile those explicitly; this two-bucket identity is a model assumption, not a universal interpretation of every API balance.
3. Cancel the remainder, reconcile the fills
Coinbase's cancellation documentation says a successful response identifies the cancelled order. An error can mean it has already filled. A sent request or local timeout is an unknown outcome; it is not the documented successful response. Cancellation also does not reverse earlier executions. [2]
Continue the opening example. Six units fill before the cancellation request, and two more fill before confirmation. Each purchased unit costs $100 plus the assumed 0.2% quote-paid fee. For illustration, the remaining hold equals the unused order notional plus its proportional fee reserve. Actual venue hold readback takes precedence over that assumption.
| Synthetic stage | Total quote | Bid hold | Free quote | Owned inventory |
|---|---|---|---|---|
| Before fills | $5,000.00 | $1,503.00 | $3,497.00 | 20 units |
| 6 fill; cancellation outcome unknown | $4,398.80 | $901.80 | $3,497.00 | 26 units |
| 2 more fill before confirmation | $4,198.40 | $701.40 | $3,497.00 | 28 units |
| Remaining 7 confirmed cancelled | $4,198.40 | $0.00 | $4,198.40 | 28 units |
The final release is $701.40. Releasing the original $1,503 in the model would invent $801.60 of cash already spent on eight units and their fees. The separate $500 unresolved request is still unresolved: provisional headroom becomes $3,698.40, while the pause-and-reconcile condition remains.
A practical shutdown record contains the order identifiers, cancellation result, all deduplicated fills and fee assets, terminal order state, remaining holds and an aligned balance snapshot. Stop the quote loop from creating replacement orders while reconciling. A missing order record alone is weak evidence: Coinbase notes that an order with no lifetime matches may have its record purged. [2]
4. Marked inventory needs an exit price and a destination
Return to the opening 20-unit inventory; this is separate from the 28 units in the cancellation sequence. Its $2,000 mark is a valuation. If an exit actually achieves an average $95 per unit with a 0.2% quote-paid selling fee, the conditional proceeds are $1,896.20. An adverse scenario with an $80 mark and a $79 average exit produces $1,576.84.
Conditional sale proceeds = units sold × average execution price × (1 − selling fee rate).
Those figures exclude withdrawal, conversion and other separately applicable costs. Neither is a guaranteed executable quote or a promise about when money will arrive. The five units initially held in asks must be released or their fills reconciled before treating all 20 as available to another sale.
Order constraints matter at small sizes. Binance documents price ticks, quantity steps, market-order quantity filters and notional limits. The practical inference is that a residual position may require rounding or fail a minimum order rule. Check the chosen symbol's actual settings; the documentation's example numbers are not current account parameters. [4]
Binance's wallet documentation separately exposes free, locked, frozen and withdrawing amounts, plus network withdrawal enablement, minima, fees and busy status. These fields illustrate why tradability and withdrawal access need separate checks. A crypto withdrawal also differs from a completed fiat transfer to the account paying the bills. [6]
The treasury should name the destination, required currency and deadline, then record conversion and transfer assumptions separately. If receipt is unknown, leave it unknown. Counting the same pending transfer at both its origin and destination overstates liquidity.
5. Positive spread earnings can coexist with a loss
The next example is an independent 30-day scenario, not a continuation of the cancellation ledger. Start with $5,000 quote and 20 EXAMPLE units marked at $100, for $7,000. Assume the bot completes exactly 100 matched one-unit buy/sell pairs at $99.50 and $100.50, with a 0.2% fee on each leg paid in quote.
Each completed pair earns $1 gross and pays $0.40 in combined fees. The resulting $60 trading cash gain raises quote to $5,060. The original 20-unit inventory remains, but its ending mark is $90. Separately, the operator pays $40 of bot and infrastructure costs outside this exchange balance.
| Component | Calculation | Result |
|---|---|---|
| Gross completed-pair spread | 100 × ($100.50 − $99.50) | +$100 |
| Trading fees | 100 × 0.002 × ($99.50 + $100.50) | −$40 |
| Inventory markdown | 20 × ($90 − $100) | −$200 |
| Outside operating costs | Deducted once, because absent from exchange balances | −$40 |
| Net change | $100 − $40 − $200 − $40 | −$180 |
| Net ending value | $5,060 + (20 × $90) − $40 | $6,820 |
A control that simply kept the same starting mix ends at $6,800 before any separately assumed control costs. The bot is $20 ahead of that control while still $180 below its own starting value. Relative improvement and absolute profit answer different questions. Neither ending figure assumes all inventory has been sold.
In this deliberately fixed-price model, contribution is $0.60 per completed pair. It takes 67 whole pairs to cover $40 of fixed costs if the inventory mark is unchanged, and 400 to cover both the $200 markdown and $40 costs. These are conditional algebraic thresholds, not expected fills, a trading target or a forecast. If contribution is zero or negative, no positive finite pair count covers positive fixed costs under the same assumptions.
Fee currency changes the ledger. Binance's commission guide uses fictional examples and describes fees paid from received assets or, when applicable, BNB. A base-asset fee changes inventory quantity; a third-token fee needs its own balance and valuation. The 0.2% quote-paid assumption here is not a live fee quote for any venue. [5]
When using actual execution prices and fee-inclusive ending balances, do not deduct the same costs again. Likewise, a separate slippage or adverse-selection diagnostic should not become a second expense if the underlying price effect is already in the recorded trades and ending inventory. See DN's net-P&L audit guide for a broader evidence record.
6. Decide what the AI is allowed to change
Hummingbot's documented V1 Pure Market Making strategy uses configured prices, sizes and refresh logic. It includes an option to wait for cancellation confirmation before creating replacement orders; the documentation notes that not waiting requires enough available balance. These are deterministic automation controls, not evidence of an AI model's trading performance. [7]
Its older inventory-skew guide, explicitly marked v0.29.0, describes changing bid and ask amounts toward a target base-asset share and suppressing one side outside a tolerance range. That changes quoting intentions. It does not establish that inventory was sold, that prices stayed stable or that operating cash was recovered. [8]
DN's proposed control design: an AI supervisor may summarise balances, flag exceptions and propose parameter changes. A separate deterministic layer should enforce approved assets, spending and exposure bounds, order-state checks and stop conditions. Record the approved configuration and any change; a narrative explanation is not the enforcement component.
| Responsibility | Suitable evidence | Failure condition |
|---|---|---|
| AI supervision | A timestamped explanation or change proposal linked to observed data. | The model treats stale or incomplete balances as certain. |
| Quote and exposure control | Enforced bounds that include current holdings and possible fills from open bids. | New orders can bypass the configured limit or unresolved state. |
| Treasury oversight | A named operator, protected operating reserve, cash deadline and reconciled exit record. | Bills depend on an unperformed sale or an unverified withdrawal. |
This design is a DN proposal, not a tested integration. Do not let a favourable spreadsheet result justify expanding a bot's permissions. Review the specific enforcement path using our AI agent spending-limits checklist.
7. Use the DN Treasury Cash and Inventory Planner
Download the editable DN planner (.xlsx). It contains the synthetic cash snapshot, partial-fill sequence and separate 30-day cost scenario. Change the labelled inputs in a spreadsheet application to see how the planning amounts change. The workbook contains no macros, external data feeds or account connections.
The on-page checklist below is a review aid. Ticks stay in this page session, are not submitted to DN, and do not certify an account or execute a trade. Untick items to reset your review. The calculations and assumptions remain visible above without downloading anything.
What should make the review stop?
Pause the strategy review if an order or transfer outcome is unknown, records do not reconcile, the operating reserve is insufficient for the stated obligations, or the exit depends on an unavailable route. Positive provisional headroom does not clear these conditions. Resolve the evidence gap before making a funding or quoting decision.
How should the planner be adapted?
Keep a clean copy of the synthetic defaults, then work on a separate copy. Identify every input's unit, source and timestamp. Extend the ledger for other assets, restrictions or liabilities instead of forcing them into one free-balance figure. A spreadsheet can check arithmetic; it cannot establish that a venue will execute or settle an action.
8. When this is a useful exercise
This worksheet is useful for an operator assessing a separate experimental trading allocation, with a defined loss capacity and operating bills already covered. It is a poor basis for deploying payroll, tax money or other funds whose availability depends on an untested exit. The point is to make those dependencies visible before the allocation decision.
For a wider treasury process, use the DN autonomous treasury framework. For venue execution evidence, the execution-quality guide addresses a different question. Neither substitutes for the account-specific cash and order record used here.
Methodology and limits
DN reviewed the eight primary documents below on 20 October 2026 and designed the worksheet from the distinctions they expose. Coinbase and Binance serve as documentation examples. Their inclusion is not a ranking, a current access determination or a recommendation to deposit funds. Hummingbot's cited pages describe V1 behaviour and do not establish current performance for a particular connector or deployment.
The opening ledger uses one quote asset, one base asset, no borrowing and mutually exclusive free/held quote buckets. Its $500 reserve concerns a different unresolved request not already captured in those buckets. The cancellation example assumes proportional release of the unused fee reserve and no other fills or transfers. Real venue records override these simplifications.
The 30-day comparison assumes all 100 one-unit pairs complete at the stated prices and fees, with no external capital flows, unchanged base quantity and $40 of costs outside the exchange. It excludes tax, a terminal liquidation and transfer costs. Its comparator uses the same starting mix and ending mark. The liquidation illustration uses the opening 20 units and is separate from both that comparison and the cancellation sequence.
For a boundary containing only the exchange, flow-adjusted change is ending marked equity minus starting marked equity minus external deposits plus external withdrawals, then less costs paid outside that boundary. Transfers between accounts already inside a combined bank-and-exchange boundary are internal. Use a consistent boundary before calculating a return.
No live fee schedule, profitability rate, drawdown, fill probability or time-to-bank was measured. The workbook and native checklist are educational planning aids. They cannot verify order status, guarantee liquidity or establish suitability for an organisation.
Primary sources
- Coinbase Exchange API: Create a new order — initial holds, executions and remaining funds.
- Coinbase Exchange API: Cancel an order — success, rejection and order-record caveats.
- Coinbase Exchange API: Get a single account by ID — balance, available, hold and profile fields.
- Binance's official Spot API repository: Filters — price, quantity and notional constraints.
- Binance Spot API: Commission Rates — fee components and asset-specific examples.
- Binance Wallet REST API: Capital — balance categories and network withdrawal fields.
- Hummingbot V1: Pure Market Making — configured quoting, refresh and cancellation confirmation.
- Hummingbot V1: Inventory Skew — an older guide explicitly updated as of v0.29.0.
Frequently asked questions
Is the available exchange balance the same as operating cash?
No. The worksheet separates venue free quote from money already received and usable in the account that pays expenses. An exit may still require an inventory sale, conversion, withdrawal and settlement. Record those conditions before counting expected proceeds against a cash deadline.
Does cancelling a market-making order recover the whole original amount?
Only the unfilled remainder can be released. Earlier fills remain recorded as purchases or sales, including fees. In the synthetic 15-unit bid, eight units fill and only the seven-unit remainder is cancelled; the final release is $701.40 under the stated hold assumptions.
Can a bot earn spreads and still lose money?
Yes. In the independent DN example, 100 completed pairs produce $60 after trading fees. A $200 inventory markdown and $40 of outside operating costs leave a $180 overall loss. Comparing total value with the same starting asset mix helps separate relative improvement from absolute profit.
Does the DN planner connect to an exchange or recommend a trade?
No. It is an editable workbook with synthetic defaults, supported by an on-page evidence checklist. It has no exchange connection, wallet connection, trading permissions or live market feed. Positive provisional headroom does not resolve unknown order states or establish a safe allocation.
Editorial disclosure, freshness and corrections
This article uses neutral official reference links and includes no affiliate offer or sponsored product ranking. Documentation availability does not establish eligibility, current account access or a verified LIVE promotional status. Compensation does not determine the worksheet's findings.
Change log: 20 October 2026 — first publication; source review, original synthetic ledgers and planner. Recheck the selected venue, market and account before relying on operational details. Send corrections through the DN contact page, identifying the section, source and date without sharing credentials or private account records.