Skip to main content

Independent community Sinopac (Taiwan markets) adapter for NautilusTrader

Project description

sinopac-nt-community

Disclaimer: This is an independent community project. It is not affiliated with, endorsed by, or supported by Nautech Systems Pty Ltd or the official NautilusTrader project.

An independent community adapter integrating SinoPac Securities (Taiwan markets — TWSE / TPEX / TAIFEX, via the Shioaji SDK) with NautilusTrader. It provides a live data client, a live execution client, and an instrument provider, backed by a Rust-native HTTP/WebSocket core compiled as a Python extension.

  • Pinned to: nautilus_trader==1.228.0 (PyPI) / nautilus-* 0.58.0 (crates.io)
  • Companion gateway: shioaji-server (a separate process the adapter connects to)
  • License: LGPL-3.0-or-later

Requirements

  • Python 3.12–3.14
  • Rust 1.96.0 (to build the extension; see rust-toolchain.toml)
  • uv and maturin
  • A running shioaji-server gateway for live data/execution

Installation

No wheel is published yet — build from source:

git clone https://github.com/Martingale42/sinopac-nt-community
cd sinopac-nt-community

uv venv --python 3.12
uv pip install nautilus_trader==1.228.0 maturin
uv run maturin develop            # editable install of the sinopac_nt extension
# or build a distributable wheel:
uv run maturin build --release    # -> target/wheels/

Usage

Register the factories on a TradingNode and point the configs at your shioaji-server gateway:

from nautilus_trader.live.node import TradingNode
from nautilus_trader.live.config import TradingNodeConfig

from sinopac_nt import (
    SINOPAC,
    SinopacDataClientConfig,
    SinopacExecClientConfig,
    SinopacLiveDataClientFactory,
    SinopacLiveExecClientFactory,
)

config = TradingNodeConfig(
    trader_id="TESTER-001",
    data_clients={SINOPAC: SinopacDataClientConfig(...)},
    exec_clients={SINOPAC: SinopacExecClientConfig(...)},
)

node = TradingNode(config=config)
node.add_data_client_factory(SINOPAC, SinopacLiveDataClientFactory)
node.add_exec_client_factory(SINOPAC, SinopacLiveExecClientFactory)
node.build()
node.run()

Runnable end-to-end testers are in examples/ (sinopac_data_tester.py, sinopac_exec_tester.py).

Taiwan order semantics

Taiwan-venue order parameters with no native Nautilus equivalent (margin/short, intraday odd lot, futures open-close type, range-market MKP, TIF coercion, limit-up/down) are carried on order.tags via SinopacOrderTags. See the sinopac_nt package docstring and docs/sinopac.md for the full capability matrix.

Development

uv run maturin develop
uv run pytest python/tests -q     # Python integration tests
cargo test                        # Rust unit + integration tests

Maintainer

Maintained by @Martingale42. Please open an issue on this repository for bugs, questions, or contributions.

License

LGPL-3.0-or-later. This project links against and re-homes code from NautilusTrader (also LGPL-3.0-or-later); upstream copyright notices are retained in the source headers.

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

sinopac_nt_community-0.1.1.tar.gz (129.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

sinopac_nt_community-0.1.1-cp314-cp314-win_amd64.whl (8.6 MB view details)

Uploaded CPython 3.14Windows x86-64

sinopac_nt_community-0.1.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

sinopac_nt_community-0.1.1-cp314-cp314-macosx_11_0_arm64.whl (9.3 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

sinopac_nt_community-0.1.1-cp313-cp313-win_amd64.whl (8.6 MB view details)

Uploaded CPython 3.13Windows x86-64

sinopac_nt_community-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

sinopac_nt_community-0.1.1-cp313-cp313-macosx_11_0_arm64.whl (9.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

sinopac_nt_community-0.1.1-cp312-cp312-win_amd64.whl (8.6 MB view details)

Uploaded CPython 3.12Windows x86-64

sinopac_nt_community-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

sinopac_nt_community-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (9.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file sinopac_nt_community-0.1.1.tar.gz.

File metadata

  • Download URL: sinopac_nt_community-0.1.1.tar.gz
  • Upload date:
  • Size: 129.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for sinopac_nt_community-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5a143c9de0ab028842fb1675bfeab7eed6e49e3c664f9f36acb120903fbac30a
MD5 3488ddc3cdd74896d3f7713b36c28065
BLAKE2b-256 990566d3c2d7b43688af1dea0d6e2ded27c67aa9bbb452e71b0176484a0c5839

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.1.tar.gz:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.1-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 bf11b877607afe7e2aa82ed13806141964aafc7f7db066ce5dfd062ab79db12b
MD5 553d62d86ba30cf20832e4161dadbd5a
BLAKE2b-256 0e17a758e7437963c781d26508adb6784b56f6bd568d637794af988af632e312

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.1-cp314-cp314-win_amd64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cbf5123204d4bbd5182a49d9b0b96fabcac79a73c2254fd29c7e89e88df30390
MD5 367523bedea6564ecaba322af2111217
BLAKE2b-256 0e0d0e163a0270b324abe7e29fda560e1e05d7d81008c1e450f5773cf70e6cba

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 264d5db9ccc87ea9cd84f1dd35dc81dc5a641f29e9e9d45fb0261e76ca2da8bb
MD5 5da7bf25ed0a4b60655d9655b5f4db50
BLAKE2b-256 59b18a4addf547f84f48532bb80ce80560a9da0ef39382e86407aa42336e9fbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.1-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a57adc6f96db17c680e1c0647f918338b269ba9838f85144575f37df756c49b4
MD5 9dafe2ccee74348593091afa3b8e221d
BLAKE2b-256 63092bb4eae0cf349af038007acad863e05a33698f27fe9fdfa4671e33eb0bf0

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.1-cp313-cp313-win_amd64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 de5aec636b12c1f287a3b254d8d5636eed5464f1e459c70fcb25155be21fd857
MD5 4c0730bbf11d7ae5da1611e2e1e1e30f
BLAKE2b-256 7c44d979ff5a9dcdd7b096623fd086c0fbcb8a165b28df8171bd1d2a2a371f8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 02d079882a70854721f6168ee12f074dd9ae4a3f4daa8a2cd00e91704019250b
MD5 1bc2718450f35db1c778283438909409
BLAKE2b-256 40f2a00818fa49685ee41c62151313e6d0a5c46427fbc339bbb64bc2176f8600

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.1-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5b5ec37960ec58467a2e8359182ef42edc741414c4e24c03fd21cbc26c9c3cb5
MD5 1448d67bb0150dd29f299437a34c9e85
BLAKE2b-256 a5588562eed015c2a707c795c566623f8f478d6a7323ee7cac0d59fc941a9b0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.1-cp312-cp312-win_amd64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bbb12536f0df0e6e237c5e32f5456fae9429e573898919bcc7bf9c430c166d72
MD5 50978e76cdc0d7c647d518bfe442b171
BLAKE2b-256 b422e6de4f21f1e1f447dc32ca32655d7581534f406f5b4c5471213e7e4bbf6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sinopac_nt_community-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sinopac_nt_community-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b58e90d70b8b02cdc0df189bd586a665c8cdc81ad0346ab2ecc76bfcbfb990a3
MD5 61991c934ce41dd06fe01f0843e62253
BLAKE2b-256 90d7b323af2f95aad235ac1e1ce37797aa1bb09a2a378dd5cf67a4763ac9fad0

See more details on using hashes here.

Provenance

The following attestation bundles were made for sinopac_nt_community-0.1.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on Martingale42/sinopac-nt-community

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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