> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobula.io/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Get a Token Trade by Transaction Hash Across Ethereum, Solana, BNB, Base & More

> Use the Token Trade by Transaction endpoint to retrieve a specific trade using a transaction hash on supported blockchains.

The [**Token Trade by Transaction**](https://docs.mobula.io/rest-api-reference/endpoint/token-trade) endpoint lets you retrieve a specific trade using a transaction hash.

This is helpful when you already have a tx hash and want the trade details without knowing the pool or token address, across chains like [Solana](https://docs.mobula.io/blockchains/solana), [Ethereum](https://docs.mobula.io/blockchains/ethereum), [BNB Chain](https://docs.mobula.io/blockchains/bsc), [Base](https://docs.mobula.io/blockchains/base), and more.

The endpoint returns the first trade found in that transaction.

***

<div style={{ position: 'relative', paddingBottom: '56.25%', height: 0, overflow: 'hidden' }}>
  <iframe src="https://www.youtube.com/embed/PCIRC_-6rH0" title="YouTube video player" style={{ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', border: 0 }} allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowFullScreen />
</div>

***

## What this endpoint does

With this API, you can:

* Retrieve a single trade by transaction hash on a specific blockchain
* Return detailed swap information like amounts, USD value, execution prices, and fees
* Include market context such as `marketAddress` and `marketAddresses` for multi-hop swaps
* Include `swapRecipient` when available, which helps with accurate attribution in Account Abstraction flows
* If a transaction contains multiple swaps, only the most recent one is returned

***

## What you’ll need

* Basic knowledge of REST APIs
* A transaction hash
* A Mobula API key

Note: All Mobula endpoints require an API key.\
Get a free API key: [Here](https://admin.mobula.io/)

Optional:

* DexScreener (to find transactions to test)

***

## When to use Token Trade by Transaction

Use this endpoint when you want to:

* Fetch the exact details of a trade when you only have a transaction hash
* Monitor or audit specific trades after detecting an on-chain transaction
* Show trade details when a user clicks a transaction inside a wallet activity view
* Retrieve execution prices and fee breakdown for one specific swap
* Handle Account Abstraction flows using `swapRecipient` when `transactionSenderAddress` is not the actual user

If you want the full normalized activity feed for a wallet, use: [**Wallet Activity**](https://docs.mobula.io/rest-api-reference/endpoint/wallet-activity)

If you want all swaps/trades for a wallet over time, use: [**Wallet Trades**](https://docs.mobula.io/rest-api-reference/endpoint/wallet-trades-v2)

If you want pool-level context (price, liquidity, volume) for the market a trade happened on, use: [**Market Details**](https://docs.mobula.io/rest-api-reference/endpoint/market-details)

***

## Walkthrough to Get Token Trade by Transaction

### 1. Prepare your query

The Token Trade by Transaction endpoint requires two parameters:

| Parameter         | Description                                                          |
| ----------------- | -------------------------------------------------------------------- |
| `blockchain`      | Blockchain identifier (example: `base`, `ethereum`, `bsc`, `solana`) |
| `transactionHash` | Transaction hash of the trade                                        |

Tip: Make sure you select the correct chain, such as [Base](https://docs.mobula.io/blockchains/base) or [Ethereum](https://docs.mobula.io/blockchains/ethereum).

### 2. Find a transaction hash to test with DexScreener

To get a real transaction hash:

* Open DexScreener
* Pick a token
* Open its pair page
* Click **Trades** (or Recent Trades)
* Click a trade entry to open the explorer
* Copy the transaction hash

This hash is used as the `transactionHash` parameter.

### 3. Fill the API form

Enter the blockchain and paste the transaction hash into `transactionHash`, then click **Send**.

***

## Reviewing the response

The response contains a single trade object, including:

* `id`: Unique swap identifier
* `operation`: Swap operation type like `regular`, `deposit`, or `withdrawal`
* `type`: Trade type like `buy`, `sell`, `deposit`, or `withdrawal`
* `baseTokenAmount` / `quoteTokenAmount`: Token amounts traded in formatted units
* `baseTokenAmountUSD` / `quoteTokenAmountUSD`: USD value for each side of the trade
* `date`: Trade timestamp in milliseconds
* `transactionHash`: The transaction hash you queried
* `marketAddress`: Main pool or market address where the trade occurred
* `marketAddresses`: All market addresses involved for multi-hop swaps
* `swapSenderAddress`: Address that executed the swap
* `transactionSenderAddress`: Transaction originator address
* `swapRecipient`: Wallet that receives the output tokens, useful for accurate attribution in AA flows
* `baseTokenPriceUSD` / `quoteTokenPriceUSD`: Execution prices in USD at the time of the trade
* `labels`: Wallet labels when available
* `walletMetadata`: Enriched wallet metadata when available
* `platform`: Trading platform or aggregator object when available
* `totalFeesUSD`: Total fees paid in USD
* `gasFeesUSD` / `platformFeesUSD` / `mevFeesUSD`: Fee breakdown fields

***

## Try It Live with Mobula Token Trade by Transaction Demo (UI)

You can also test this endpoint using our demo UI:

[Demo UI Homepage](https://mobula-demo-endpoint-production.up.railway.app/)

[Token Trade by Transaction Demo UI](https://mobula-demo-endpoint-production.up.railway.app/token-trade-detail)

[Docs](https://docs.mobula.io/rest-api-reference/endpoint/token-trade)

***

## Summary

The [**Token Trade by Transaction**](https://docs.mobula.io/rest-api-reference/endpoint/token-trade) endpoint helps you:

* Retrieve a specific trade by blockchain and transaction hash
* Get full swap context including amounts, USD values, execution prices, and fees
* Use `swapRecipient` when available for accurate user attribution in Account Abstraction flows
* Visualize the trade details instantly in the demo UI

***

## Try Mobula for Free

Try our free API today and start building in minutes.\
Get your free API key: [Here](https://admin.mobula.io/)
