Python SDK — tria-trade

A Python port of @tria-sdk/api-trading that mirrors the TypeScript surface 1:1 — same client config, same method names, same normalized shapes, same TRIA_TRADE_* environment contract.

What to expect

The Python client takes the same configuration shape and reads the same environment variables, so an SDK environment minted from Settings → API Keys (see Credentials) works unchanged:

from tria_trade import TriaClient

client = TriaClient(
    network="mainnet",
    hl={
        "agent_private_key": os.environ["TRIA_TRADE_HL_AGENT_KEY"],
        "account_address": os.environ["TRIA_TRADE_HL_ACCOUNT_ADDRESS"],
    },
)

await client.place_order(
    venue="hl",
    market="BTC",
    side="buy",
    size="0.0003",
    price="50000",
    tif="gtc",
    client_order_id="0x...",
)

Method names follow Python conventions (place_order, cancel_order, …) but map directly onto the TypeScript surface. Errors raise a TriaError with the same code taxonomy.

In the meantime

Was this page helpful?