Bitget Market
Spot and USDT-, USDC- and coin-margined perpetuals, read-only.
tribulnation-bitget, venue namebitget.
See the generic market interface for the shared method surface. This page covers only what is Bitget-specific.
Account
accounts.Bitget takes an access_key, secret_key and passphrase. uta says whether
the account is a Unified Trading Account (True), a Classic account (False), or should
be auto-detected on the first account-scoped call (None, the default). validate
toggles pydantic validation of API responses. The built-in bitget account is
accounts.Bitget(public=True): every public method works on it, implemented account-scoped methods raise AuthError.
USDC futures expose public data only; their account methods raise
NotImplementedError, including when credentials are configured.
Exchanges & ID conventions
exchange_id |
Type | What it is |
|---|---|---|
spot |
spot | Every spot pair. |
usdt |
perp | USDT-margined perpetuals (USDT-FUTURES). |
usdc |
perp | USDC-margined perpetuals (USDC-FUTURES). |
Classic coin-classic futures retired on September 17, 2026 at 07:00 UTC.
The exchange is absent from discovery and explicit requests raise NotImplementedError.
Historical IDs such as bitget:coin-classic:BTCUSD remain delisted Catalogue records;
they are never mapped to UTA IDs. See the Bitget retirement announcement.
UTA coin (BTCUSD_CM, etc.) is not supported or listed in discovery. Requesting
it raises NotImplementedError: native USD-sized quantities do not fit the current
SDK base-unit rules. See issue #32.
Catalogue entries remain active; this is an SDK capability deferral.
Market IDs are Bitget's Classic API symbols: BTCUSDT on spot and usdt,
BTCPERP on usdc.
Full SDK IDs include bitget:usdt:BTCUSDT and bitget:usdc:BTCPERP; a configured
account key can replace bitget.
The former USDT exchange ID perp is replaced by usdt, without an alias.
Exchange.markets() returns the symbols of the public catalogue: every spot pair, and
every perpetual of the product line (delivery contracts, which pay no funding, are
dropped).
Venue-specific semantics
- Public data is mode-independent.
markets,depth,depth_stream,tickers,rules,perp_stats,index,next_fundingandfunding_ratesread the venue's public endpoints, so they answer the same on a Classic account, a UTA account and the built-in public one. Account-scoped reads onspotandusdtdispatch on the account's mode;usdcaccount reads are not implemented. - Trading is not implemented.
place_order,cancel_order,cancel_ordersandcancel_open_ordersraiseNotImplementedError: Bitget is not a venue we trade on. rulescome from the public symbol and contract catalogues, cached after the first call. Bitget publishes decimal-place counts rather than tick sizes, sotick_sizeandstep_sizeare derived from them (priceEndStep * 10 ** -pricePlaceon perps). The fee rates are the venue's default tier, not the account's; nonzerofeeRateUpRatioleaves public contract fees unknown until its composition is verified. Active futures products use the quote coin asfee_asset. Futuresmin_valueis reported only forusdt: Bitget'sminTradeUSDTcannot be reported as USDC without conversion, so it isNoneforusdc.depthonspottakes anylevels(150 a side by default); on futures the venue serves a fixed depth of 1, 5, 15, 50 or 100 levels, so a request is served by the next size up and trimmed.depth_streamfolds thebookschannel (a full snapshot, then deltas) into whole books;levelstrims each delivered book.candlesserves everyCandleInterval(CANDLE_INTERVALSis the full set) on all three exchanges, with required timezone-awarestartandendbounds. Opening timestamps are filtered to[start, end); responses retain their native order with no ordering guarantee across windows. Each futures product reads the futures history endpoint in windows of 198 opens (leaving two slots under the 200-row cap for boundary handling), back to the contract's listing.spotreads the recent endpoint in windows of 999 opens, which only keeps about two months of hourly candles (less at finer intervals): the spot history endpoint has no paged walk in the typed client yet, so astartpast that horizon yields fewer candles than the window holds.perp_statsjoins the futures ticker listing (index, mark, current rate, open interest) with the funding-rate listing (next settlement time and interval) -- two calls for the whole universe. Funding intervals vary per contract (1, 4 or 8 hours).funding_rateswalks the venue's page-numbered history newest-first and stops once a page reaches back paststart; a call with nostartwalks the whole history.funding_paymentsis not supported on either mode: Bitget publishes no closed set of futures ledger types (businessType,futureTaxType,typeare all free text), so there is no documented settlement value to filter on.trades_historyis served in 90-day windows, the widest the venue accepts. Classic spot and UTA fills reach back roughly 90 days and the venue rejects a window older than that (43111/25200); Classic futures fills reach further back. UTA's fill history has no symbol filter, so it is narrowed client-side.trades_streamsubscribes to the privatefillchannel: per product line and symbol on Classic, one account-wide channel narrowed to the market on UTA.positiononspotis the base-coin balance (available, frozen and locked on Classic; the unified pool'sbalanceon UTA).perp_positionnets a hedge-mode account's long and short rows into one signed size.collateralon a spot market is the quote-coin balance (equity= total,free_collateral= available);available_notionalis that free part. The exchange-level pool (collateral('bitget:spot')) is the unified pool on UTA and unsupported on Classic, whose spot wallet has no pool-level figure.perp_collateralon UTA is the unified margin pool (accountEquity,effEquity,imr,mmr,leverage), withmargin_moderead from the account's per-symbol settings (crosswhen the symbol has none, and always for the exchange-level pool). On Classic it is unsupported: the futures wallet reports no initial or maintenance margin.available_notionalonusdtis the free margin times the contract's maximum leverage (availableof the futures wallet on Classic,effEquityon UTA).- Fees on trades are reported the SDK's way, positive when charged: Classic signs a fee charged negative and is flipped, UTA already agrees. A fill charged in several coins reports the first coin only.
query_orderis the base implementation: it scansopen_orders().
Example
from dotenv import load_dotenv
from tribulnation.sdk import MarketSDK, accounts
load_dotenv()
sdk = MarketSDK({'bg': accounts.Bitget()})
# public, works on the built-in `bitget` account too
book = await sdk.depth('bg:spot:BTCUSDT', levels=5)
tickers = await sdk.tickers('bg:spot')
stats = await sdk.perp_stats('bg:usdt', markets=['BTCUSDT', 'ETHUSDT'])
# account-scoped, dispatched on the account's Classic/UTA mode
position = await sdk.perp_position('bg:usdt:BTCUSDT')