Skip to main content

Reliable asyncio SDK for OKX USDT-margined perpetual swap REST order placement.

Reason this release was yanked:

Superseded by 0.1.0a2 after repository history cleanup.

Project description

okx-perp-reliable

CI PyPI Python License

Reliable asyncio SDK for OKX USDT-margined perpetual swap REST order placement.

Status Beta

Why This Exists

place_order() can become ambiguous when OKX accepts an order but the client times out before receiving the response. This SDK uses idempotent clOrdId values and bounded query-by-clOrdId reconciliation so callers receive one of three explicit outcomes: CONFIRMED, FAILED, or UNKNOWN. See docs/why.md for the full rationale.

Install

pip install okx-perp-reliable

Minimal Example

from decimal import Decimal
from okx_perp_reliable import OrderSide, OrderType, ReliablePerpClient
async def main() -> None:
    client = ReliablePerpClient(api_key="...", api_secret="...", passphrase="...", demo=True)
    result = await client.place_order(inst_id="BTC-USDT-SWAP", side=OrderSide.BUY, order_type=OrderType.MARKET, size=Decimal("0.01"), pos_side="long")

Mock Infrastructure

The deterministic in-process OKX mock used by integration tests is documented in tests/mock/README.md. It is test infrastructure, not part of the published SDK package.

License And Author

MIT License. Maintained by Alan.

中文说明见 README.zh-CN.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

okx_perp_reliable-0.1.0a1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

okx_perp_reliable-0.1.0a1-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file okx_perp_reliable-0.1.0a1.tar.gz.

File metadata

  • Download URL: okx_perp_reliable-0.1.0a1.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for okx_perp_reliable-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 7a9ed0d0a5c3d8e634968821e664ef60bca06bc7d2dba94af1cfc45ebd896997
MD5 7ade56638f27ea4420335502067ccf53
BLAKE2b-256 1457f746e427536321de198aa01ac28d7bbd37770669084605bbb82f9a1ad4ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for okx_perp_reliable-0.1.0a1.tar.gz:

Publisher: publish.yml on alanships/alan-quant-lab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file okx_perp_reliable-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for okx_perp_reliable-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 2fa1c27984fc6db378394cce886a7e18d24e10d5a1d3c504bf710e1ec7f99639
MD5 60e9f8128760b587163890f9a08b0f40
BLAKE2b-256 f2c406b3c8f9c1de38c57aec934c4897ebaa7efa59ec025acee07f1424c9797c

See more details on using hashes here.

Provenance

The following attestation bundles were made for okx_perp_reliable-0.1.0a1-py3-none-any.whl:

Publisher: publish.yml on alanships/alan-quant-lab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page