Skip to main content

Kucoin Futures Library

Installation

pip install kucoin-futures-lib

Class Structure

classDiagram

namespace kucoin_futures_lib {
    class KucoinFutures["KucoinFutures"]
    class KucoinFuturesMarket["KucoinFuturesMarket"]
    class KucoinFuturesTrade["KucoinFuturesTrade"]
    class KucoinFuturesUser["KucoinFuturesUser"]
    class KucoinFuturesWebsocket["KucoinFuturesWebsocket"]
    class KucoinFuturesHelper["KucoinFuturesHelper"]
    class EntryRangeHandler["handlers.EntryRangeHandler"]
    class OcoHandler["handlers.OcoHandler"]
}
namespace kucoin_futures {
    class Market["client.Market"]
    class Trade["client.Trade"]
    class User["client.User"]
    class WsToken["client.WsToken"]
    class KucoinFuturesWsClient["ws_client.KucoinFuturesWsClient"]
}
KucoinFutures o-- KucoinFuturesMarket
KucoinFutures o-- KucoinFuturesTrade
KucoinFutures o-- KucoinFuturesUser
KucoinFutures o-- KucoinFuturesWebsocket
KucoinFuturesMarket o-- Market
KucoinFuturesTrade o-- Trade
KucoinFuturesUser o-- User
KucoinFuturesWebsocket o-- WsToken
KucoinFuturesWebsocket o-- KucoinFuturesWsClient
KucoinFuturesWebsocket o-- EntryRangeHandler
KucoinFuturesWebsocket o-- OcoHandler

Usage Examples

from kucoin_futures_lib import initialize_kucoinf
from kucoin_futures_lib.utils import retriable

retriable = retriable(retries=3, exceptions=(Exception,), backoff_base=2.0, initial_backoff=0.1)

kucoinf = initialize_kucoinf(
    api_key='your-api-key',
    api_secret='your-api-secret',
    api_passphrase='your-api-passphrase',
    retriable=retriable,  # Optional retriable method to retry methods in the library
)

balance = kucoinf.user.get_balance(currency='USDT')
print(f"Account balance: {balance}")


current_price  = kucoinf.market.get_current_price(instrument='XBTUSDTM')
print(f"Current price: {current_price}")

# Create a market order with limit take profit, market stop loss and enable Oco
order_id = kucoinf.create_order(
    instrument="XBTUSDTM",
    side="buy",
    size=3,
    take_profit=75000,
    stop_loss=60000,
    leverage=10,
    enable_oco=True,
)
print(f"Order ID: {order_id}")

Metadata

Release files for kucoin-futures-lib 0.13.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kucoin-futures-lib 0.13.0
File Size Uploaded Provenance
kucoin_futures_lib-0.13.0.tar.gz 16.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for kucoin-futures-lib 0.13.0
File Interpreter ABI Platform
kucoin_futures_lib-0.13.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.6 kB

Release files / kucoin_futures_lib-0.13.0.tar.gz

Download URL kucoin_futures_lib-0.13.0.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cc60b4366be2fc8cdce6c34d4581ba1ee23d113b584efb6ad6a4dbf359601a78
BLAKE2b-256 checksum
How to use checksums
c6f911354ae87582a2c4ff3237fb1dd4590baf054aeba32934a42de996c1aece
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.9.19 Linux/6.5.0-1018-azure

Release files / kucoin_futures_lib-0.13.0-py3-none-any.whl

Download URL kucoin_futures_lib-0.13.0-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2774fb7977b1b4b9ce9a7f9e315147ca5c158ddb3d6e56a221be02910e40e3f8
BLAKE2b-256 checksum
How to use checksums
bce74fa629ae55a4d1f27673626ef31271d56ad81774e2a5d151deb90dadcbc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.9.19 Linux/6.5.0-1018-azure

Security for kucoin-futures-lib 0.13.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page