Skip to content

A partial-fill example

The seller places a 1 BTC sell target order. Yesterday’s reference is 80,000 USDC, and the target is 79,000 USDC per 1 BTC. All costs are excluded.

The first 0.4 BTC fills at 76,000. Conversion returns 30,400 USDC. The scaled target is 31,600, so the buyer adds 1,200 USDC. The entry gap is 5%, giving q = 2.5.

The remaining 0.6 BTC fills later at 72,000. Conversion returns 43,200 USDC. Its target is 47,400, so the buyer adds 4,200 USDC. The gap is 10%, giving q = 5.

One order, two independent fills. Funding and payouts are in USDC; H = 100,000 USDC/BTC.
BTC sizeEntry priceqBuyer paymentFunded capBuyer payoutSeller payout
0.476,0002.51,20031,60020,00011,600
0.672,00054,20047,40047,4000

The first buyer allocation is 20,000 USDC, below that fill’s cap. Its seller receives 11,600 USDC.

The second raw buyer allocation is 60,000 USDC. That fill holds only 47,400, so its buyer receives 47,400 and its seller receives zero.

Together, buyers receive 67,400 USDC and the seller receives 11,600 USDC. The total remains the funded 79,000 USDC.

Adding the raw allocations first would give 80,000 USDC. Applying one combined 79,000 cap would then give buyers all funds. That would wrongly take the 11,600 USDC owed to the seller from the first fill.

Each cap must be applied before payouts are added.

After the first fill, the seller could cancel the open 0.6 BTC remainder. The unused reservation would be released. The completed 0.4 BTC fill would still settle using its own terms.

A later direct swap of the remainder would also leave the earlier fill unchanged. Read the partial-fill rules.