Skip to main content

PyBinbot

Utility functions for the binbot project. Most of the code here is not runnable, there's no server or individual scripts, you simply move code to here when it's used in both binbot and binquant.

pybinbot is the public API module for the distribution.

This module re-exports the internal shared and models packages and the most commonly used helpers and enums so consumers can simply::

    from pybinbot import round_numbers, ExchangeId

Python 3.15 or newer is required. Pandas and NumPy use matching version pins in pybinbot, binbot, and binquant. Import these libraries directly:

import numpy as np
import pandas as pd

Installation

uv sync --extra dev

--extra dev also installs development tools like ruff and mypy

Futures order triggers

KucoinFutures.place_futures_order() defaults every conditional order to KuCoin's last traded price (stopPriceType=TP) when stop_price_type is omitted or None. This applies to both buy and sell orders, stop-market and stop-limit orders, and opening and reducing orders. Explicit mark/index trigger types remain supported. Orders without stop do not send a trigger-price type. Trigger levels, limit prices, quantities, leverage, and fill handling are unchanged.

Last price can fluctuate more than mark price, but selecting it does not guarantee the highest selling price or lowest buying price; fills depend on the order book.

KucoinFutures.get_ticker_price(symbol) returns the last traded contract price from the futures ticker. The spot client exposes the same method for spot prices; KucoinFutures.get_mark_price(symbol) remains available for mark prices.

Stored CVD data

BinbotApi exposes the recorded KuCoin futures CVD endpoints:

symbol_cvd = await api.get_cvd_symbol("RUMUSDTM", limit=15)
market_cvd = await api.get_cvd_aggregate(limit=15)

CvdSymbolResponse, CvdAggregateResponse and CvdPoint are public exports. Symbol observations are one-minute buckets; aggregate observations are 15-minute buckets. Both are oldest first and retain the current/partial, coverage, gap, universe or contract multiplier change, reset, and checkpoint freshness fields. Missing values remain None, and empty collections remain empty. Timestamp fields require time zones and numeric observations must be finite. The endpoint responses are bare snapshots rather than StandardResponse envelopes. Request and validation errors propagate to the caller; a failed request never becomes a zero-valued reading.

Publish a new PyPI release before consuming these methods in binquant or binbot, then upgrade each consumer's minimum dependency and lockfile to that release.

Telegram delivery

Import TelegramDelivery from pybinbot.shared.telegram_delivery. Initialization loads the application's .env and reads TELEGRAM_BOT_KEY and TELEGRAM_USER_ID, without overriding existing environment variables. Credentials may also be passed explicitly.

Use send_once(message) for a synchronous attempt with a short timeout and no retry or cooldown. Use await send(message) for asynchronous delivery with rate-limit retries and optional spacing configured at initialization. Both use HTML formatting and disable link previews. Delivery does not persist messages. The Telegram library is installed as a dependency of pybinbot.

Publishing

  1. Save your changes and do the usual Git flow (add, commit, don't push the changes yet).
  2. Bump the version, choose one of these:
make bump-patch

or

make bump-minor

or

make bump-major
  1. Git tag the version for Github. This will read the bump version. There's a convenience command:
make tag
  1. git commit --amend. This is to put these new changes in the previous commit so we don't dup uncessary commits. Then git push

For further commands take a look at the Makefile such as testing make test

Metadata

Release files for pybinbot 2.1.4

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

Source distribution (sdist)

Source distribution for pybinbot 2.1.4
File Size Uploaded Provenance Actions
pybinbot-2.1.4.tar.gz 100.4 kB With provenance Details for pybinbot-2.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pybinbot 2.1.4
File Interpreter ABI Platform Actions
pybinbot-2.1.4-py3-none-any.whl Python 3 none any Details for pybinbot-2.1.4-py3-none-any.whl

Total release size: 185.8 kB

Release files / pybinbot-2.1.4.tar.gz

Download URL pybinbot-2.1.4.tar.gz
Size 100.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c79ada6d491dc2f7b1be8e29e81dd1d186cada0e2ecc70162f5a354e4db10786
BLAKE2b-256 checksum
How to use checksums
de435a6b2f99d3e6d3afb57f9b03c453163c84a3a4aad56e74e1ec7395733fd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / pybinbot-2.1.4-py3-none-any.whl

Download URL pybinbot-2.1.4-py3-none-any.whl
Size 85.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ea035649c884e6cb8c487640adc2975217d6ee09f8541a09ee8844079670f35
BLAKE2b-256 checksum
How to use checksums
1e248cff8aa99b3e23e5c454e26ab48e6d972afcd05c997fb2cb863888ffa988
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for pybinbot 2.1.4

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pybinbot-2.1.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

2.1.4 This release

2 release files Full provenance

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