Tribulnation SDK implementation for KuCoin.
Spot and linear perpetual Market data and trading on Classic accounts and Unified Trading Accounts (UTA), read-only Classic spot-side reporting, wallet network methods and simple Earn listings. Perpetual trading is verified live on a Unified Trading Account.
from tribulnation.sdk import ReportSDK, accounts
reports = ReportSDK({'kucoin': accounts.Kucoin()})
async with reports.venue('kucoin') as report:
async for record in report.history():
print(record)
- History discovers spot markets automatically; no holdings-based filter or caller market list is required. Per-symbol sweeps can require many requests. Omitted bounds select seven days of spot fills and 30 days for deposits/withdrawals; explicit bounds are preserved and rows are filtered locally.
- History is best-effort. Retention, delisted symbols, dedicated margin activity, Earn accruals and other unsupported ledgers leave gaps for file ingestion.
- Snapshots include Classic main/trade balances and paginated Earn holdings. Futures and legacy margin/isolated compartments are explicitly excluded, not reported as zero exposure. Neither history nor snapshots call futures endpoints. No Futures permission or scope configuration is needed. Rejected supported reads fail rather than claiming zero balances. Other user subaccounts remain unsupported. The underlying Typed futures APIs are unchanged.
Wallet.new(public=True)lists enabled chains with nativechainIdidentifiers. Withdrawal fees are the published minimum, not a quote for a specific transfer.- Earn lists five simple savings/staking families. Structured dual investments are excluded because their contingent principal conversion is not a plain APR product.
Public Market data
from datetime import datetime, timedelta, timezone
from tribulnation.kucoin import KucoinMarket
async with KucoinMarket.new(public=True) as venue:
spot = await venue.exchange('spot')
print(await spot.tickers(['BTC-USDT']))
market = await venue.perp_market('perp:XBTUSDTM')
end = datetime.now(timezone.utc)
candles = await market.candles('1h', end - timedelta(days=3), end)
print(await market.next_funding())
- Discovery, native tickers, public rules, depth, trade candles and perpetual funding use public APIs. No account credentials or Futures permission are needed.
- Exchange IDs are
spotandperp; full SDK IDs includekucoin:spot:BTC-USDTandkucoin:perp:XBTUSDTM. Native symbols are not renamed. - Perpetual support covers open linear contracts. Inverse and dated contracts are excluded. Quantities use base units, converted from contract lots where necessary.
- REST depth accepts 1–100 levels (default 20); streams accept 1–5 (default 5). Streams share an upstream and honor SDK queue/overflow settings.
- Candles support
1m,5m,15m,1h,4h,1d, require aware[start, end)bounds, and page by time at 1,500 spot/200 futures rows. Gaps remain gaps; historical availability differs by product and interval and does not guarantee an archive. - Funding history uses inclusive bounds; an omitted start walks earliest available
settlements. Perpetual statistics expose index, mark and base-unit open interest;
use
next_funding()for the current cycle's rate, next settlement and interval. rules().feesis unknown;fees()reads the account's rates.
Trading (unreleased)
from decimal import Decimal
from tribulnation.sdk import MarketSDK, accounts
# Reads KUCOIN_API_KEY, KUCOIN_API_SECRET and KUCOIN_API_PASSPHRASE.
sdk = MarketSDK({'kucoin': accounts.Kucoin()})
market = await sdk.perp_market('kucoin:perp:XBTUSDTM')
print(await market.fees()) # maker rebates are negative rates
order = await market.place_order(
{'type': 'POST_ONLY', 'qty': Decimal('0.001'), 'price': Decimal('60000')}
)
await market.cancel_order(order.id)
- Spot (HF orders, the
tradeaccount) and linear perpetuals (one-way, cross margin). Quantities are base units; futures orders must be whole contracts. LIMITis GTC,POST_ONLYsetspostOnly,MARKETis an IOC limit at the price.- Orders are checked against the rules before sending (
ValueError), refusals raiseOrderRejected, missing ordersOrderNotFound. - Unified Trading Accounts:
accounts.Kucoin(mode='unified'), or leavemodeunset to detect it. Every account read, order and fill then uses the UTA API and private WebSocket; perpetuals margin from the one unified pool (collateral_id<account>:perp, USDC included). Verified live on a mainnet UTA on 2026-11-28: account reads on both lines, and perpetual post-only place, query, cancel and a minimum-size fill. - See the KuCoin Market page for
collateral, leverage, fees, streams and history, and
scripts/live_trading.pyfor the live check (not run in CI).
See the qualification handoff for observed limits, Catalogue follow-up and release/version requirements.
Metadata
Release files for tribulnation-kucoin 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tribulnation_kucoin-0.9.0.tar.gz | 38.3 kB | With provenance | Details for tribulnation_kucoin-0.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tribulnation_kucoin-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for tribulnation_kucoin-0.9.0-py3-none-any.whl |
Total release size: 87.2 kB
Release files / tribulnation_kucoin-0.9.0.tar.gz
| Download URL | tribulnation_kucoin-0.9.0.tar.gz |
|---|---|
| Size | 38.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9bd530c43a36837582189e5b211d3a6835de3c75a842788f0350b36da6131d1e
|
|
BLAKE2b-256 checksum How to use checksums |
80862251407d0ac8392abb3f1ed7dabe2ea63b32242912724e87946e08f52f78
|
| 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 28, 2026.
Transparency logRelease files / tribulnation_kucoin-0.9.0-py3-none-any.whl
| Download URL | tribulnation_kucoin-0.9.0-py3-none-any.whl |
|---|---|
| Size | 49.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b44ac72057cd5d71760e349b405965460a7d6f867f8b51237088c264e922d88
|
|
BLAKE2b-256 checksum How to use checksums |
58d4fb2543cd4f907355fb20d23705f0675620b6017eae1c6df6da0cac888efd
|
| 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 28, 2026.
Transparency logSecurity for tribulnation-kucoin 0.9.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.
Attestation for tribulnation_kucoin-0.9.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 28, 2026.
Transparency logA 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.