THORChain Data: Index Cross-Chain Swaps, Outbounds, and Pools
Index THORChain swaps, streaming swaps, outbounds, refunds, liquidity, and pool balance changes, delivered to your own database. Real-time and complete historical data, no THORNode to run.
THORChain is a decentralized cross-chain liquidity protocol that lets users add liquidity or swap native assets across chains, without pegging or wrapping them. A network of nodes observes transactions arriving at THORChain's vaults on each supported chain, agrees on the user's intent, which is usually expressed as a memo in the inbound transaction, and then executes the swap and sends the output asset on the destination chain. It brands itself as a DEX for swapping Bitcoin, Ethereum, and other native assets.
THORChain itself is a Cosmos SDK chain running on CometBFT, so its record of all that cross-chain activity is a stream of ABCI events. Swaps, streaming swaps, outbounds, refunds, liquidity adds, and pool balance changes are emitted at the block level, while observation and price-feed messages arrive as transactions. Indexing Co ingests THORChain blocks with their transaction results and events and delivers the rows you shape to your PostgreSQL, warehouse, or webhook. See how the project frames it at thorchain.org.
Why THORChain data is hard
What Indexing Co delivers for THORChain
Stand up and maintain the THORChain indexing stack yourself.
- Run a THORNode, or rent CometBFT RPC, or depend on a hosted API.
- Fetch block and block_results for every height.
- Parse swap, outbound, refund, and pool events from finalize_block_events.
- Build backfill, upgrade handling, and real-time delivery from scratch.
THORChain blocks, tx results, and events, shaped by you, delivered to your store.
- Swap, streaming swap, outbound, refund, and liquidity events.
- Pool balance changes and network events from every block.
- Lands in your PostgreSQL, BigQuery, warehouse, or webhook.
- Real-time delivery plus complete backfilled history. No node to run.
What you can index
| THORChain event type | What it carries |
|---|---|
swap |
Pool, inbound tx ID, chain, from, to, coin, memo, emitted asset, slip, liquidity fee in RUNE |
streaming_swap |
Tx ID, interval, quantity, count, deposit, in, out, failed swaps |
outbound, refund |
Inbound tx ID, destination chain, addresses, coin, memo, refund reason |
add_liquidity, pool_balance_change, pol_reserve_deploy |
Pool, RUNE and asset amounts, provider addresses and units |
trade_account_deposit, trade_account_withdraw |
Asset, amount, RUNE and asset addresses |
rewards, gas, rev_share, mint_burn, burn |
Bond and fund rewards, per-asset gas amounts, THORName revenue share payouts, supply changes |
oracle_price, message (tx level) |
Price feed symbols and prices, message action such as MsgDeposit |
A transform, not a subgraph
You write the transform in JavaScript, not AssemblyScript, and change it without re-indexing from block zero. Indexing Co runs your function over each block server-side: read the block-level events you care about and return rows for your destination.
// Indexing Co transform: THORChain swaps and outbounds from block-level events
function transform(block) {
const results = [];
const height = Number(block.height);
const time = block.block?.header?.time;
for (const event of block.finalize_block_events || []) {
if (event.type !== 'swap' && event.type !== 'outbound') continue;
const attrs = {};
for (const a of event.attributes || []) attrs[a.key] = a.value;
results.push({
chain: block._network,
block: height,
block_time: time,
event_type: event.type,
in_tx_id: attrs.in_tx_id || attrs.id,
source_chain: attrs.chain,
from_address: attrs.from,
to_address: attrs.to,
coin: attrs.coin,
pool: attrs.pool || null,
emit_asset: attrs.emit_asset || null,
liquidity_fee_in_rune: attrs.liquidity_fee_in_rune || null,
memo: attrs.memo,
});
}
return results;
}
THORChain with Indexing Co
You want full control of THORChain infrastructure and have the team to operate a THORNode, parse block-level swap and pool events, and build backfill and delivery in-house.
You want THORChain swaps, outbounds, refunds, liquidity, and pool changes delivered to your own database, shaped by your transform, with real-time plus complete history and no node to run.
Related Reading
- DeFi Data Infrastructure
- Wallet Tracking Data Infrastructure
- Cosmos Hub Data
- Indexing Co vs Building Your Own
FAQ
Do I need to run a THORNode?
No. Indexing Co sources THORChain blocks and transaction results for you, including history, so you do not operate a node or depend on a third-party endpoint.
Where are swaps in a THORChain block?
In finalize_block_events. Each swap event carries the pool, inbound tx ID, source chain, from and to addresses, coin, memo, emitted asset, and liquidity fee. The transform above reads them directly.
Can I follow a swap across chains?
On the THORChain side, yes. The swap and outbound events share the inbound tx ID and carry the source chain and addresses, so you can join inbound, swap, and outbound rows. Confirming the transactions on the external chains themselves is a separate pipeline on those networks.
Does Indexing Co parse memos and asset strings?
The pipeline delivers memos and coin strings exactly as THORChain emits them. Splitting a memo into action, target asset, and destination, or a coin string into amount and CHAIN.ASSET, is a few lines in your transform.
Where does the THORChain data go?
Into your own destination: PostgreSQL, BigQuery, a warehouse, or a webhook. You define the output schema and own the storage.
Get Started
Index THORChain in minutes. Set up your first swaps or liquidity pipeline without running a node.