Skip to main content

this is for at trade strategy module

Project description

st-sdk

提供给Strategy Module使用的python sdk。

设计架构

  1. utils:是最底层的一些封装,对于http,websocket做一些集成性的封装,包括intercept之类的拦截器实现。
  2. api: 基于封装的request代码,对接oms,dms对应的接口和websocket封装
  3. model:设计strategy module,order manager,position manager等对策略曝光的最上层模块
  4. config:一些常用的配置项
  5. common:主要存放constant和error等常量
  6. test:python测试文件目录

开发配置

st-sdk使用poetry作为核心的包管理工具,工具地址:https://python-poetry.org/。直接抛弃了pip的方式开发,把包版本控制&发版都简单收敛到一个工具和命令行中。

开发流程

  • 执行test demo,我们通过下面的命令行,可以执行test的python代码,其他的和python代码使用没有任何区别
poetry run python stsdk/test/st_demo_1.py

设计细节

cache设计

每一个key会对应一个map,map中的cache是用户订阅参数产生的topic,然后创建出来的自定义数据。

举个例子:

  1. BBO MAP数据:是一个以bbo_cache作为key的map。

当我们订阅一个topic: BBO.EXCHANGE_BINANCE.ETH-USDT.SECURITY_TYPE_PERP.CONTRACT_TYPE_LINEAR.USDT.UNSPECIFIED的数据,那么这个时候这个topic就是新的map的一个key,这个里面会存放最近10条数据(默认配置10条数据)

指令设计

  • 仅支持placeOrder和cancelOrder两个指令

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

stsdk-0.3.3.tar.gz (42.1 kB view details)

Uploaded Source

Built Distribution

stsdk-0.3.3-py3-none-any.whl (68.5 kB view details)

Uploaded Python 3

File details

Details for the file stsdk-0.3.3.tar.gz.

File metadata

  • Download URL: stsdk-0.3.3.tar.gz
  • Upload date:
  • Size: 42.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1014-aws

File hashes

Hashes for stsdk-0.3.3.tar.gz
Algorithm Hash digest
SHA256 e770948de993dd705fffaf90d3ecfc39795076d92043cbf016e502050036cd7b
MD5 9d6533ef36d1c7ed9f21a09c4a4bb09b
BLAKE2b-256 3a5b0d7885191cb475b9f617bf3010d1c5cd0e77327eb9eae3c07d2986168391

See more details on using hashes here.

File details

Details for the file stsdk-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: stsdk-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 68.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1014-aws

File hashes

Hashes for stsdk-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 54c661ddb8afd1b696f0b806e40546e5d041d852f4b731005075f06c4e1fd726
MD5 c35c091cf63f24797e962048a5b71d56
BLAKE2b-256 969cf504846e7381e6860b364e855534ed8928c440bf91f4b96fc78a00a5aa97

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page