Skip to main content

SORY

A smart order router for crypto, in a Python package.

One order book across every venue you trade, then execute against the best all-in price — fees included. One config to get a consolidated book, one call to route an order.

pip install sory

The whole integration

import asyncio
from decimal import Decimal

from sory import SoryClient

config = {
    "licence_key": "...",
    "symbol": "BTC/USDT",
    "exchanges": ["binance", "okx", "bybit"],
    "fees_bps": "fees.toml",
    "fee_offset": {"binance": "taker", "okx": "taker", "bybit": "taker"},
}


async def main() -> None:
    async with SoryClient(config) as sory:
        # A consolidated, fee-adjusted book across all three venues.
        book = sory.book()
        print(book.best_bid.price, book.best_ask.price, book.best_ask.venue)

        # One call. SORY splits it across venues on best all-in price.
        order = await sory.place(side="buy", qty=Decimal("2"), order_type="market")
        print(order.filled, order.achieved_price, order.plan.allocations)


asyncio.run(main())

That is the integration. No adapters to write, no per-venue special cases, no WebSocket plumbing.

What it does

Two things, well:

Market data — one consolidated order book across any number of venues, with your fees applied where you ask, venue health tracked, VWAP depth and the trade tape on request.

Execution — a market order split across venues on best all-in price, or a limit order resting on the venue you name, with a full account of what filled where and why.

It is deliberately not an OEMS. No balances, no positions, no PnL, no trade database. SORY plugs into whatever already owns those — which is why it takes about ten minutes to drop into an existing system.

What people use it for

Best execution Sweep the consolidated book instead of guessing which venue is cheapest.
Arbitrage and basis One book, every venue, fee-adjusted — the spread you see is the spread you get.
Hedging Fill on one venue, hedge across the others in a single call.
Market making Quote passively, hedge the fill, keep the rebate with post_only.
Unwinds and liquidations Size against real aggregate depth, and see the remainder you could not fill.
Execution algos TWAP, VWAP, POV — build the schedule, let SORY handle each slice.
Research and monitoring Consolidated depth and the trade tape, as a normal Python stream.

Why fee-aware routing matters

Routing on quoted prices is routing on the wrong number:

venue A:  ask 100.00, your taker fee 20 bps  ->  all-in 100.200
venue B:  ask 100.05, your taker fee  1 bp   ->  all-in 100.060   <- actually cheaper

Venue A looks better and costs more. SORY compares all-in prices everywhere, using your own fee tier from a config file — never a venue's published rate, which is usually the entry-level tier and not what you pay.

What you get

Consolidated book Any number of venues merged into one, fee-adjusted, best price first.
Venue health Online / Stale / Offline. A silent feed is treated as a fault, not a quiet market — and never routed to.
Fee-inclusive routing Splits on best all-in price, and reports every venue it considered, excluded, and why.
One config One symbol per client. Two symbols is two clients, one line each.
Full reconciliation requested == filled + unfilled, always, with a reason. Remainders are never silently dropped.
VWAP depth The price to fill 1, 5, 10 units — and the limit price needed to achieve it.
Unified liquidity Pool BTC/USD, BTC/USDC and BTC/USDT into one book.
Trade tape Every venue, streamed in parallel with the book.
Decimal throughout No float rounding anywhere near a price, size or fee.
Dry run Routes, validates and builds every venue order, then stops before sending.

Venues

Around 100 spot and perpetual venues are supported, including Binance, OKX, Bybit, Coinbase, Kraken, Bitget, KuCoin, Gate, HTX, Crypto.com, Bullish, MEXC, Bitstamp, Bitfinex, Hyperliquid, Deribit and BitMEX.

Venue ids and symbols follow a single convention across all of them — BTC/USDT for spot, BTC/USDT:USDT for a perp — so adding a venue is one string. Omit exchanges entirely and SORY uses every venue that lists the symbol.

Try it

playground.sory.pro — build a config and run it against live order books, in your browser.

Documentation

introduction · configuration · market data · routing · execution · fees · venues · licensing

Licence

SORY is commercial software, unlocked with a licence key — see licensing. The source is MIT; see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sory-5.0.0.tar.gz (85.9 kB view details)

Uploaded Source

Built Distribution

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

sory-5.0.0-py3-none-any.whl (69.4 kB view details)

Uploaded Python 3

File details

Details for the file sory-5.0.0.tar.gz.

File metadata

  • Download URL: sory-5.0.0.tar.gz
  • Upload date:
  • Size: 85.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for sory-5.0.0.tar.gz
Algorithm Hash digest
SHA256 532fe482785b86fb78c48c76366cfd1e5c9cc6d61678f5e1c0a5abb9f90a91aa
MD5 c3b8b902c8b30dd70526c0999ca9dc46
BLAKE2b-256 6e8de78ad9c66607b39dc9722ee80cdac087f9e620d4329514358a50cd0e1baf

See more details on using hashes here.

File details

Details for the file sory-5.0.0-py3-none-any.whl.

File metadata

  • Download URL: sory-5.0.0-py3-none-any.whl
  • Upload date:
  • Size: 69.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for sory-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 026ad519f7920c4fd7c6d085ba0818965107de206e89c3b135110f912d8f4ba7
MD5 382e73511a8afc19ba630383e0d526d9
BLAKE2b-256 81e4d9e1b52e4c4f7a0f78f74e19c01a2b39d1f1134d28fcccbe2ae36cbf7aad

See more details on using hashes here.

Release history Release notifications | RSS feed

5.3.3

2 files

5.3.2

2 files

5.3.1

2 files

5.3.0

2 files

5.2.1

2 files

5.2.0

2 files

5.1.2

2 files

5.1.1

2 files

5.0.3

2 files

5.0.2

2 files

5.0.1

2 files

This release

5.0.0 This release

2 files

4.0.0

2 files

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