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

REST API

Base URL: https://api.megatao.com

The REST API is read-only and requires no authentication. All amounts are returned as strings in wei (18 decimals). Divide by 10^18 to get TAO-denominated values.

Interactive documentation is available at https://api.megatao.com/swagger.


Markets

GET /v1/info/markets

Returns all active markets.

Response

[
  {
    "market": "0x0000000000000000000000000000000000000040",
    "symbol": "CHUTES",
    "price": "87707801000000000",
    "fundingRate": "20",
    "longOpenInterest": "9003500000000000000",
    "shortOpenInterest": "911995857793391469",
    "maxLeverage": "500",
    "isActive": true
  }
]

GET /v1/info/markets/:address

Returns detailed info for a single market by contract address.

GET /v1/info/prices

Returns the latest oracle price for every market, keyed by market address.

GET /v1/info/candles

Returns OHLCV candle data.

Parameter
Type
Description

market

string

Market contract address

resolution

string

1m, 5m, 15m, 1h, 4h, 1d

from

integer

Start timestamp (Unix seconds, optional)

to

integer

End timestamp (Unix seconds, optional)

GET /v1/info/orderbook

Returns the order book for a market.

Parameter
Type
Description

market

string

Market contract address

levels

integer

Number of price levels each side (default: 10)

GET /v1/info/funding

Returns current funding rates for all markets.

Funding rates are in basis points per 8-hour interval. See Funding for the full rate mechanics.


Account

GET /v1/info/margin/:address

Returns margin balances for a trader address.

GET /v1/info/positions/:address

Returns open positions for a trader.

GET /v1/info/orders/:address

Returns open limit orders for a trader.

GET /v1/info/trades/:address

Returns trade history for a trader. Response is split into opens and closes:


Platform

GET /v1/info/vault

Returns the current vault state.

utilizationRate is in basis points (1512 = 15.12%).


Market addresses

Market
Address
Subnet

CHUTES

0x0000000000000000000000000000000000000040

SN64

LIUM

0x0000000000000000000000000000000000000033

SN51

RIDGES

0x000000000000000000000000000000000000003e

SN62

TARGON

0x0000000000000000000000000000000000000004

SN4

MTSOS

0x000000000000000000000000000000000000FFFE

Index

See Contract Specifications for the full list.

Last updated