Private Execution

How to Compare a Quote.Trade All-In Quote with a Public Exchange Price

Compare the same market, side, size, and time. Use executable prices, include all costs, and stop if either venue cannot fill the full quantity.

25 minutesIntermediateProfessional traders, bots, and analysts

What you will accomplish

  • Create a fair same-time, same-size comparison
  • Calculate volume-weighted executable price
  • Include fees and relevant costs
  • Record fill, reject, latency, and quote freshness

Before you begin

  • A defined symbol, side, and quantity
  • Access to Quote.Trade and one comparison venue
  • Synchronized timestamps
  • A spreadsheet or script using decimal arithmetic
USD price, collateral currency, and network

Prices and order values are shown in USD. The collateral currency, such as USDC or USDT, and its blockchain network are separate settings. Check the live account and market settings for allowed currencies, minimum size, and leverage.

Fair comparisonSame side, timestamp, and exact size
Public benchmarkExecutable VWAP, not last or mid
ReportPrice, availability, latency, and fill outcome
Step-by-step

Use the same market, side, size, and time

Record the market, side, exact amount, payment currency, time window, maximum quote age, and all relevant costs. Compare Buy with the ask side and Sell with the bid side.

Record the Quote.Trade price and result

Record the all-in USD price, available amount, response time, and whether the request filled, was rejected, or returned only public market data.

Quote.Trade order form showing a quantity and the resulting Buy and Sell prices
Enter the exact comparison quantity before recording the Buy or Sell price. This screenshot is illustrative; use a fresh live quote for every comparison.

Get an executable price from the comparison venue

Use a firm quote for the same amount or calculate the price from the correct side of the public order book. Include commissions and other relevant costs.

Calculate VWAP only when depth is sufficient

The helper below raises an error when the book cannot fill the full requested quantity.

python
from decimal import Decimal, InvalidOperation

def vwap(levels, requested_qty: str) -> Decimal:
    try:
        requested = Decimal(requested_qty)
    except InvalidOperation as exc:
        raise ValueError('invalid requested quantity') from exc
    if not requested.is_finite() or requested <= 0:
        raise ValueError('requested quantity must be finite and positive')
    remaining = requested
    cost = Decimal('0')
    for price, qty in levels:
        try:
            level_price = Decimal(str(price))
            level_qty = Decimal(str(qty))
        except InvalidOperation as exc:
            raise ValueError('invalid depth level') from exc
        if not level_price.is_finite() or not level_qty.is_finite() or level_price <= 0 or level_qty < 0:
            raise ValueError('invalid depth level')
        take = min(remaining, level_qty)
        cost += take * level_price
        remaining -= take
        if remaining == 0:
            break
    if remaining != 0:
        raise ValueError(f'insufficient depth; unfilled quantity={remaining}')
    return cost / requested

Compare final all-in outcomes

For BUY, lower total cost is better; for SELL, higher proceeds are better. Report rejected or insufficient-size outcomes separately from price.

Save the prices, sizes, and timestamps used

Store endpoint/venue, market, side, quantity, levels or firm quote, timestamps, fees, result, and calculation code without credentials.

Troubleshooting

Common problems and fixes

The comparison venue lacks enough depth

Record the order as not fully executable at the observed levels; do not extrapolate missing liquidity.

Quotes were captured seconds apart

Label the result invalid or widen the methodology; volatile markets make asynchronous screenshots misleading.

Payment or funding currencies differ

Convert both results to the same currency using a price from the same time, and show the conversion in the comparison.

Primary sources

Ready for the next step?

Open Quote.Trade and compare a quote

Open Quote.Trade and compare a quote