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.4.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.4.0
File Size Uploaded Provenance Actions
tribulnation_extended-0.4.0.tar.gz 24.9 kB With provenance Details for tribulnation_extended-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 55.9 kB

Release files / tribulnation_extended-0.4.0.tar.gz

Download URL tribulnation_extended-0.4.0.tar.gz
Size 24.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a89075f2e0633387042197787379ff9d54c973e843d159c2ac249c228395a37c
BLAKE2b-256 checksum
How to use checksums
522a194e495991d8708fe3a9281fdfe27144936e05ddffaf58f850c612caf052
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 18, 2026.

Transparency log

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

Download URL tribulnation_extended-0.4.0-py3-none-any.whl
Size 31.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e692151f0d716c70e7dc2a1c70ca470e3bb78ef7f44f48c90270585d1230b76
BLAKE2b-256 checksum
How to use checksums
34a084d95bf1e64e9849f30530d12e0ddc3b8f1534c06320630bc582e5b500f2
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 18, 2026.

Transparency log

Security for tribulnation-extended 0.4.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.4.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 18, 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