Skip to main content

Extended SDK

Perpetual Market and Report support for Extended, built on typed-extended. Install with pip install tribulnation-extended.

from tribulnation.extended import ExtendedMarket

async with ExtendedMarket.new(public=True) as venue:
  perp = await venue.perp_exchange('perp')
  market = await perp.market('BTC-USD')
  book = await market.depth(levels=5)

An account is one sub-account of a wallet. Its API key reads it and cancels its orders; placing orders also needs the sub-account's Stark private key and vault:

venue = ExtendedMarket.new(api_key='…', stark_private_key='0x…', vault=12345)

With no arguments, the client reads EXTENDED_API_KEY, EXTENDED_STARK_PRIVATE_KEY, EXTENDED_STARK_PUBLIC_KEY and EXTENDED_VAULT (EXTENDED_TESTNET_* with network='testnet'). A wallet's other sub-accounts each need their own API key.

  1. One exchange, perp. Market ids are the venue's market names (BTC-USD), the same on both networks; the collateral, fee and funding asset is USD.
  2. Public data: discovery, tickers, rules, depth, a shared book stream, candles in the six SDK intervals, index, perp_stats, next funding and hourly funding-rate history. RFQ markets' books are their quotes, from the RFQ quotes stream.
  3. Account and trading: fees, order queries, open orders, trade history and the fills stream, positions, collateral, leverage, available notional, MARKET, LIMIT (or immediate-or-cancel with settings={'extended': {'time_in_force': 'IOC'}}) and POST_ONLY orders (RFQ markets through the RFQ endpoint), and every cancellation method. Order ids are Extended's numeric order ids; client_order_id is the order's externalId.
  4. Acceptance is asynchronous: an order the matching engine refuses after acceptance shows as REJECTED in query_order; OrderRejected is raised for refusals the venue answers with an error code.
  5. funding_payments raises NotImplementedError until the sign of the venue's payment amount is observed.

Report snapshots and streams the history of the API key's sub-account; a read-only key is enough:

from tribulnation.extended import Report

async with Report.new('…') as report:
  record = await report.snapshot()

History yields asset operations (transfers between sub-accounts, deposits, withdrawals, testnet claims), fills and closed positions with their realized PnL. It raises NotImplementedError for a window holding a funding or borrow-interest payment.

See Extended Market for account configuration through MarketSDK and venue-specific semantics.

Metadata

Release files for tribulnation-extended 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tribulnation-extended 0.3.0
File Size Uploaded Provenance Actions
tribulnation_extended-0.3.0.tar.gz 23.6 kB With provenance Details for tribulnation_extended-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tribulnation-extended 0.3.0
File Interpreter ABI Platform Actions
tribulnation_extended-0.3.0-py3-none-any.whl Python 3 none any Details for tribulnation_extended-0.3.0-py3-none-any.whl

Total release size: 53.2 kB

Release files / tribulnation_extended-0.3.0.tar.gz

Download URL tribulnation_extended-0.3.0.tar.gz
Size 23.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1f177173abbdf7012add33b98876e384b63935d0197f2db31c9305432d546dc6
BLAKE2b-256 checksum
How to use checksums
7358ac228ff19234f87551cd744f7f5b711af169f685a7ccf936c3e6af495c62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / tribulnation_extended-0.3.0-py3-none-any.whl

Download URL tribulnation_extended-0.3.0-py3-none-any.whl
Size 29.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
596699dc2f73efc692f79535bee2addfeaff25ceca155651715abfa634d9f1b8
BLAKE2b-256 checksum
How to use checksums
3dfb832222bed03feda69a11545c5a1debd9e1acf35f8dd4cb7d188c39454ba9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for tribulnation-extended 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tribulnation_extended-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page