Connecting to THORChain

This guide helps developers connect to THORChain’s network for querying data, building wallets, dashboards, or debugging network issues. THORChain provides four primary data sources:

  • Midgard: Consumer data for swaps, pools, and volume, ideal for dashboards.
  • THORNode: Raw blockchain data for THORChain-specific queries, used by wallets and explorers.
  • Cosmos RPC: Generic Cosmos SDK data, such as balances and transactions.
  • Tendermint RPC: Consensus and node status data for monitoring.

Info

The below endpoints are run by specific organisations for public use. There is a cost to running these services. If you want to run your own full node, please see https://docs.thorchain.org/thornodes/overview.

Quick Reference

SourcePurposeMainnet URLsStagenet URLs
MidgardSwap, pool, volume, and user data- midgard.thorswap.net
- midgard.ninerealms.com
- midgard.thorchain.liquify.com
- stagenet-midgard.ninerealms.com
THORNodeTHORChain-specific blockchain data- thornode.thorswap.net
- thornode.ninerealms.com
- thornode.thorchain.liquify.com
- Pre-hard-fork (blocks ≤4786559): thornode-v0.ninerealms.com
- stagenet-thornode.ninerealms.com
Cosmos RPCCosmos SDK data (e.g., balances)- Example: thornode.ninerealms.com- Not publicly available; run a node
Tendermint RPCConsensus and node status data- rpc.ninerealms.com
- rpc.thorchain.liquify.com
- rpc.thorswap.net
- Pre-hard-fork (blocks ≤4786559): rpc-v0.ninerealms.com
- stagenet-rpc.ninerealms.com

Usage Guidelines

  • Rate Limits: Public endpoints may enforce limits (e.g., 100 requests/minute for Midgard). Check provider docs or contact operators (e.g., THORSwap, Nine Realms).
  • Run Your Own Node: For production apps, run a THORNode to avoid rate limits and ensure uptime. See THORNode Setup Guide.
  • Hard-Fork Note: Mainnet hard-fork at block 4786560 requires post-hard-fork endpoints for newer data; use pre-hard-fork endpoints for historical queries (blocks ≤4786559).
  • Error Handling: Handle HTTP 429 (rate limit) or 503 (node overload) with exponential backoff for retries.

Midgard

Midgard provides time-series data for swaps, pools, volume, and liquidity providers, ideal for dashboards and analytics. It proxies THORNode queries to reduce network load and runs on every node.

THORNode

THORNode provides raw blockchain data (e.g., balances, transactions) specific to THORChain’s state machine, critical for wallets and block explorers. Avoid excessive queries to public nodes to prevent overloading.

Cosmos RPC

Cosmos RPC provides generic Cosmos SDK data (e.g., account balances, transactions). Common endpoints include /cosmos/bank/v1beta1/balances and /cosmos/base/tendermint/v1beta1/blocks. Not all endpoints are enabled.

Cosmos Documentation

Cosmos Endpoints

Use THORNode URLs with /cosmos/... paths.

Tendermint RPC

Tendermint (CometBFT) RPC provides consensus and node status data (e.g., block height, validator status), useful for monitoring and debugging.

Tendermint Documentation

Ports

  • MAINNET Port: 27147
  • STAGENET Port: 26657

Tendermint RPC Endpoints

P2P

P2P is the peer-to-peer network layer for node communication, useful for debugging connectivity issues between THORChain nodes.

  • MAINNET Port: 27146
  • STAGENET Port: 26656

P2P Guide

Example: Check Peer Connections

curl -X GET "https://rpc.ninerealms.com/net_info" -H "accept: application/json"