How to Backtest CS2 Trade-Up Expected Value

Updated

API reference: GET /v1/schema · POST /v1/market/buff/history · POST /v1/prices/history

cs2.sh supplies the item metadata, float-range input prices, and output bid history needed for a CS2 trade-up EV backtest. Contract legality and outcome probabilities must come from the backtest's own rules model.

A useful backtest prices each input at the BUFF bucket containing its float, then values every possible output from a bid observed in the same time bucket. Using one exterior-wide floor can understate the cost of low-float inputs.

Data inputs for a trade-up EV backtest#

Requirement cs2.sh data
Resolve item identity and attributes GET /v1/schema fields such as market_hash_name, rarity, collections, wears, float_range, StatTrak state, and marketplace IDs
Cost an exact-float input BUFF float buckets with ask, avg_ask, bid, and active-order volumes
Track float-aware costs over time Per-bucket BUFF OHLC at 30m, 1h, or 1d since May 19, 2026
Value possible outputs Per-source bid OHLC from POST /v1/prices/history

BUFF divides each item into base, float, fade, and float_fade buckets. Match an input float where min is inclusive and max is exclusive. The stable bucket_id links the current bucket definition to its history.

The schema can identify collection membership, rarity, wear rows, native float bounds, and whether StatTrak or Souvenir forms exist. It does not return a precomputed trade-up contract, legal outcome set, or outcome probability. Those inputs must be supplied and validated separately.

Constructing the historical comparison#

Use 1d BUFF float history for each distinct input name and read the bucket containing that input's exact float. Sum the relevant close_ask values only on dates where every input has a quote.

Resolve output names from the schema, query their bid OHLC for the same UTC dates, and calculate probability-weighted value only when the complete outcome probability has prices. Preserve any incomplete day as a gap instead of carrying a prior ask or bid forward.

Applicable endpoints#

Endpoint Returns Plans
GET /v1/schema Item metadata, collections, rarity, wears, and float bounds All plans
POST /v1/market/buff/history Float-bucket ask, average-ask, and bid OHLC since May 19, 2026 Scale, Enterprise
POST /v1/prices/history Marketplace quote OHLC since December 24, 2025; CSFloat bids since July 18, 2026 Scale, Enterprise

Backtest boundaries#

  • A BUFF bucket ask is the lowest listing in that range. It does not prove that the full input quantity was available at that price.
  • close_ask and an output close_bid can have different close_time values inside the same daily bucket. Small apparent edges can be sampling-time differences.
  • Bid fields are quotes, not completed sales. Fees, trade restrictions, and fill depth remain outside these endpoints.
  • BUFF float-range history begins May 19, 2026. Earlier dates cannot be reconstructed from the exterior-wide archive.

For current rather than historical inputs, see the float-aware trade-up calculator data map.