Skip to main content

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

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.0a2.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.0a2-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: okx_perp_reliable-0.1.0a2.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.0a2.tar.gz
Algorithm Hash digest
SHA256 ba09042855738dd9f755bd41abbada29b88558cd2cff801aeb19c0c3776e84e0
MD5 87c0781e5356bb7cdfb7157d72474bf9
BLAKE2b-256 c153ae0f2b5cdc6f4833e5ea12cedfde28393baa19b329ee1d42abc694e957b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for okx_perp_reliable-0.1.0a2.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.0a2-py3-none-any.whl.

File metadata

File hashes

Hashes for okx_perp_reliable-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 789efb67592b38c77a3e5914655df7e8c7b78bb06eb24db0317f0484731d6171
MD5 9910c297c957dfc661594be4e3dede2e
BLAKE2b-256 a29fa787bf0a7b070d5338d6803191ec4262dcbc37788f5f8bf34fb00dccc3e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for okx_perp_reliable-0.1.0a2-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