Documentation
¶
Overview ¶
Package okx connects an OKX account through the v5 REST API with a read-only key. OKX is treated as one account: funding, trading and Simple Earn balances are summed, and moves between them are not activities.
History comes from the account ledgers ("bills"), which list every balance change, rather than from order fills, because they reach furthest back:
- funding account: GET /api/v5/asset/bills-history, since 2021-02-01;
- trading account: GET /api/v5/account/bills-archive (last 3 months), plus the quarterly archive files since 2021 (POST then GET /api/v5/account/bills-history-archive; a requested file is ready about 2 hours later, so older quarters arrive on a later run);
- deposits and withdrawals: /api/v5/asset/deposit-history and withdrawal-history (they carry the chain, tx hash and withdrawal fee);
- Simple Earn interest: /api/v5/finance/savings/lending-history (last month only: older interest stays visible as a reconciliation gap).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.