Overview
Termo is B3’s forward market: a trade agreed today for settlement a fixed number of days out. It rides the same COTAHIST tape asquotes under tpmerc = 030, and it is a small segment — on the order of a hundred prints per session, against tens of thousands of options.
Everything is unadjusted; every row carries adjusted: false.
POST /rpc/termo_history
One code’s daily prints over a window.
Parameters, response columns and types are generated from the SQL catalog and render
under Endpoints → Derivatives in the sidebar. This page carries what a schema cannot.
p_from and p_to are both inclusive.
Field notes
Only the columns that need explaining:
Source-field provenance for the price columns, since the names differ from B3’s:
spec ← especi, bid ← oferta_compra, ask ← oferta_venda, trades ← negocios,
quantity ← quantidade, quotation_factor ← fator_cotacao. Every COTAHIST field is
defined on the COTAHIST dictionary.
Rows are ordered by trade_date, then term_days shortest-first — sorted by length and then
as text, so 30 precedes 60 precedes 120 without a numeric cast that could fail on
malformed source data.
Example
Termo in panel
panel accepts termo codnegs for close and volume, as id_type
termo / asset_class derivative. But a panel row is one value per (id, date, metric),
and termo’s real grain has term_days in it — so when several terms print in one session the
panel keeps the shortest term and drops the rest, rather than averaging them into a
number nobody quoted. That is a deliberate narrowing, and it is why the full grain lives
here: for anything term-aware, use termo_history, not panel.
close_return is not offered for termo (or for options) — it accepts ticker ids only.
Prices are raw
No split, dividend, or corporate-action adjustment anywhere in this warehouse;adjusted is
a constant false. If you need returns, difference close yourself, and be aware that a
corporate action in the window will show up as a large move that is not a return.
Empty and error behavior
- Unknown code →
200 []. Never a fabricated price. - Known code, no prints in the window → also
200 []. Termo is thin; a code can go days without a print, and a quiet window is indistinguishable from a wrong code. Checkcoverage’sderivativesrow for what the warehouse actually holds. - A malformed date returns
400.