Skip to content

DCA and execution

DCA partial take-profit fills: what remains?

Two partial exits leave five units exposed. A worked ledger separates realized gains, retained cost and cash still to recover.

An ivory tray of tiles beside a lime gate connects by a cord to a smaller tray with lime and ivory tiles.
Illustration for dca and execution; examples in this article are educational.

A DCA bot should record each confirmed take-profit fill, reduce the deal's remaining quantity, allocate acquisition cost to the units sold, and retain the rest as open exposure. A partial fill does not close the deal. Keep the remaining inventory, its allocated cost and the exit order's unfilled quantity separate before deciding what happens next.

A profitable first sale can coexist with a losing deal later. The useful question is therefore not just how much of the take-profit order filled, but what the bot still owns and which instructions can still change that holding.

Start with the deal, the order and the executions

A deal can contain several entry orders and one or more exit orders. Each exit order can produce several executions. A fill reduces inventory; an order-status update describes an instruction. They should meet in the ledger without becoming interchangeable.

For example, Bybit's order-stream documentation distinguishes cumulative executed quantity from remaining unexecuted quantity. Its product categories and field applicability matter: do not treat every field as universally available across spot and derivatives. The general partial-fill guide explains the wider order lifecycle. Here the focus is how a partially executed DCA exit divides one deal into sold and still-held units.

A take-profit trigger is another event again. Bybit's Spot TP/SL instructions explain that a conditional limit order is placed when triggered, while its execution depends on liquidity and price movement. A triggered label is insufficient evidence of a sale.

Reconstruct the inventory before allocating its cost

The following is an original hypothetical example of an unleveraged long spot deal in a fictional ABC/USDT market. It is an operational accounting convention, not a tax cost-basis prescription or a KLINEO feature specification.

Assume a purchase fee of 0.10% paid in USDT in addition to every purchase, and a sale fee of 0.10% deducted from USDT proceeds. No fee removes ABC. Ignore borrowing, transfers, rebates and other charges. These are invented inputs, not current venue rates.

The confirmed DCA entries are:

EntryABC acquiredPrice, USDT/ABCPurchase notionalPurchase feeCost assigned to inventory
Initial purchase6100600.000.60600.60
Averaging purchase580400.000.40400.40
Total11—1,000.001.001,001.00

Use actual executions rather than treating planned safety orders as acquisitions. The price-tick collision worksheet examines why distinct planned ladder levels can map to the same executable price; the inventory ledger still needs what actually filled.

The gross entry VWAP is 1,000 / 11, approximately 90.9091 USDT/ABC. Under this example's fee-inclusive weighted-average convention, unit cost is 1,001 / 11 = 91.00 USDT/ABC. Label those numbers differently so a fee-inclusive cost is not mistaken for an exchange execution price.

Follow one exit through two partial fills

Suppose a limit sell for all 11 ABC at 93 USDT fills four units, then another two units. Five remain unfilled on the same working order. The worksheet allocates the pre-sale average cost to each unit sold.

Exit observationNewly sold ABCCumulative sold ABCNet proceeds from new fillCost allocated to new fillNew realized resultABC still heldCost still held
First fill44371.628364.000+7.6287637.000
Second fill26185.814182.000+3.8145455.000

For the first fill, gross proceeds are 4 × 93 = 372; the sale fee is 372 × 0.001 = 0.372. Net proceeds are 371.628. Cost assigned to the sold units is 4 × 91 = 364, leaving a realized gain of 7.628 USDT.

After both fills, net proceeds total 557.442, allocated cost of sales totals 546, and realized gain totals 11.442 USDT. The remaining five units carry 455 USDT of cost. Their average cost remains 91 USDT/ABC: selling part of a weighted-average holding has not changed the acquisition cost per remaining unit.

A cumulative update of four followed by six means six sold, not ten. Retain distinct fills and compare their totals with authoritative order state. Binance Spot account trade records provide trade IDs, order IDs, quantities, quote quantities, commission and commission asset for this reconciliation. An order ID alone cannot distinguish all executions belonging to it.

Use allocation equations that survive the next fill

Immediately before a sale, let Q be remaining units and C their allocated cost. For a newly confirmed sale of q units with net proceeds N, this worksheet uses:

  • Cost allocated to sale: A = C × q / Q.
  • New remaining quantity: Q_new = Q − q.
  • New remaining cost: C_new = C − A.
  • Realized result from this sale: R = N − A.

Apply these only when Q > 0 and 0 < q ≤ Q. Zero inventory makes the division undefined. A fill apparently exceeding owned quantity is a reconciliation exception, not a reason to accept a negative spot holding. Use unrounded ledger precision and round for display; the final disposal should clear the allocated cost it actually consumes.

This convention makes the bridge checkable: 546 allocated to sold units + 455 retained = 1,001 original cost. Different explicit allocation conventions may produce different realized and unrealized splits. They must still reconcile to the same complete cash flows and inventory under the same valuation assumptions.

Cash still to recover is a different number

After the two fills, the original cash outlay less sale receipts is 1,001 − 557.442 = 443.558 USDT. That is cash not yet recovered. It is not the remaining inventory cost of 455. The difference is the 11.442 gain already realized.

Replacing 455 with 443.558 in the inventory-cost column would fold that realized gain into the remaining units. Adding the gain again later would count it twice. A display may deliberately show a cash-recovery threshold, but it needs that label and its own calculation basis.

Suppose the remaining five units eventually sell at 80 USDT with the same assumed fee. Net receipts would be 5 × 80 × 0.999 = 399.60. That final portion loses 399.60 − 455 = −55.40; combined with the earlier +11.442, the completed deal loses 43.958 USDT. The independent cash check is 557.442 + 399.60 − 1,001 = −43.958.

The earlier take-profit fills were profitable. They did not make the residual risk-free. For target construction and fee-denomination differences, use the fee-aware take-profit guide.

Decide what happens to the five remaining units

The table assumes no later entries or outside transactions. In practice, verify these items before replacing or declaring completion:

CheckEvidence neededWhy it changes the residual decision
Existing exit still working?Current order state and final cumulative fillsA replacement can compete with an old live remainder
Another entry filled?Confirmed entry executions after the exit beganRemaining quantity and its weighted cost may have changed
Protective instruction still applies?Product-specific stop and linked-order stateTriggering one leg can affect another instruction
Quantity executable?Current quantity step, minimums and available balanceA small residual may be dust rather than a valid new order
Deal time limit reached?Original deal clock and the specified deadline ruleA partial exit need not reset the holding period

For that last decision, the maximum-deal-age guide separates a time-based exit policy from merely waiting for the target again. Preserve the original deal identity and clock unless the written policy explicitly defines a new one.

A cancel request is not a confirmed cancellation, and canceling the unfilled remainder does not reverse prior sales. If a final fill races with cancellation, reconcile it before sizing another exit. If fees consume base units, or another process sells the asset, the simple quantity subtraction above needs those additional debits.

A deal can be complete only under an explicit residual policy: fully sold, or a recorded non-tradable remainder with its quantity, cost and ownership retained. The open-deal inventory report shows how that residual belongs in wider results. Hiding five units or a small dust balance behind a closed label breaks the record.

Method and limits

This AI-assisted article uses primary venue documentation reviewed on 23 October 2026 and original hypothetical arithmetic. It illustrates a weighted-average spot ledger, not tax treatment, exchange guarantees or verified KLINEO handling of every partial exit. Derivative contracts, base-paid fees and third-asset charges need their own units and accounting rules.

Keep the context with the example.

Each worked example is illustrative, with its sources and assumptions in the article. Read our editorial standards for authorship, verification and corrections.