Reliable asyncio SDK for OKX USDT-margined perpetual swap REST order placement.
Project description
okx-perp-reliable
Reliable asyncio SDK for OKX USDT-margined perpetual swap REST order placement.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba09042855738dd9f755bd41abbada29b88558cd2cff801aeb19c0c3776e84e0
|
|
| MD5 |
87c0781e5356bb7cdfb7157d72474bf9
|
|
| BLAKE2b-256 |
c153ae0f2b5cdc6f4833e5ea12cedfde28393baa19b329ee1d42abc694e957b7
|
Provenance
The following attestation bundles were made for okx_perp_reliable-0.1.0a2.tar.gz:
Publisher:
publish.yml on alanships/alan-quant-lab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
okx_perp_reliable-0.1.0a2.tar.gz -
Subject digest:
ba09042855738dd9f755bd41abbada29b88558cd2cff801aeb19c0c3776e84e0 - Sigstore transparency entry: 1476393558
- Sigstore integration time:
-
Permalink:
alanships/alan-quant-lab@3807408e370ee66b320e3864c1d58fa6121ffba3 -
Branch / Tag:
refs/tags/v0.1.0a2 - Owner: https://github.com/alanships
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3807408e370ee66b320e3864c1d58fa6121ffba3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file okx_perp_reliable-0.1.0a2-py3-none-any.whl.
File metadata
- Download URL: okx_perp_reliable-0.1.0a2-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
789efb67592b38c77a3e5914655df7e8c7b78bb06eb24db0317f0484731d6171
|
|
| MD5 |
9910c297c957dfc661594be4e3dede2e
|
|
| BLAKE2b-256 |
a29fa787bf0a7b070d5338d6803191ec4262dcbc37788f5f8bf34fb00dccc3e3
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
okx_perp_reliable-0.1.0a2-py3-none-any.whl -
Subject digest:
789efb67592b38c77a3e5914655df7e8c7b78bb06eb24db0317f0484731d6171 - Sigstore transparency entry: 1476393738
- Sigstore integration time:
-
Permalink:
alanships/alan-quant-lab@3807408e370ee66b320e3864c1d58fa6121ffba3 -
Branch / Tag:
refs/tags/v0.1.0a2 - Owner: https://github.com/alanships
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3807408e370ee66b320e3864c1d58fa6121ffba3 -
Trigger Event:
push
-
Statement type: