For the complete documentation index, see llms.txt. This page is also available as Markdown.

Python SDK

The MegaTAO Python SDK provides a REST-based info client for reading market and account data, and an on-chain write client for executing trades directly from Python.

Installation

pip install megatao-sdk

For on-chain write operations (deposit, open/close positions, orders):

pip install "megatao-sdk[chain]"

Quick start

from megatao_sdk import MegaTAO

with MegaTAO() as client:
    markets = client.info.markets()
    for m in markets:
        print(f"{m.symbol}: {m.price}")

Info client

client.info exposes all REST API endpoints. No private key required.

Markets

Account

Platform

Async

Every method has an async equivalent via AsyncMegaTAO:


Chain client

client.chain enables on-chain writes. Requires pip install "megatao-sdk[chain]" and a funded wallet with an RPC URL.

TAO = 10**18 — all amounts are in wei (18 decimals).

All methods accept wait_for_receipt=True to block until the transaction is mined and return a full TxReceipt.

Collateral

Positions

Orders


Error handling

Last updated