Skip to main content
GET
/
2
/
token
/
trade
Get a single trade by transaction hash
curl --request GET \
  --url https://demo-api.mobula.io/api/2/token/trade
{
  "data": {
    "id": "<string>",
    "operation": "<string>",
    "type": "<string>",
    "baseTokenAmount": 123,
    "baseTokenAmountRaw": "<string>",
    "baseTokenAmountUSD": 123,
    "quoteTokenAmount": 123,
    "quoteTokenAmountRaw": "<string>",
    "quoteTokenAmountUSD": 123,
    "date": 123,
    "swapSenderAddress": "<string>",
    "transactionSenderAddress": "<string>",
    "blockchain": "<string>",
    "transactionHash": "<string>",
    "marketAddress": "<string>",
    "baseTokenPriceUSD": 123,
    "quoteTokenPriceUSD": 123,
    "labels": []
  }
}

Query Details

This endpoint retrieves a single trade by its transaction hash on a specific blockchain.
ParameterRequiredDescription
blockchainYesBlockchain identifier (e.g., “base”, “ethereum”, “bsc”)
transactionHashYesTransaction hash of the trade

Response Overview

The response contains a single trade object with the following fields:
  • id: Unique swap identifier
  • operation: Swap operation type (regular, deposit, withdrawal)
  • type: Trade type (buy, sell, deposit, or withdrawal)
  • baseTokenAmount: Amount of base token traded (formatted)
  • baseTokenAmountRaw: Amount of base token traded in smallest units
  • baseTokenAmountUSD: USD value of base token traded
  • quoteTokenAmount: Amount of quote token traded (formatted)
  • quoteTokenAmountRaw: Amount of quote token traded in smallest units
  • quoteTokenAmountUSD: USD value of quote token traded
  • date: Trade timestamp in milliseconds
  • swapSenderAddress: Address that executed the swap
  • transactionSenderAddress: Transaction originator address
  • blockchain: Blockchain name
  • transactionHash: Transaction hash
  • marketAddress: Pool/market address where trade occurred
  • baseTokenPriceUSD: Base token price in USD at execution
  • quoteTokenPriceUSD: Quote token price in USD at execution
  • labels: Array of wallet labels (e.g., smart-money, pro-trader)
This endpoint is useful when you have a transaction hash and want to retrieve the trade details without knowing the pool or token address.
If the transaction contains multiple swaps, only the most recent one will be returned. The transaction must exist in the indexed blockchain data.

Usage Examples

Query a trade by transaction hash (GET):
curl -X GET "https://api.mobula.io/api/2/token/trade?blockchain=base&transactionHash=0x123abc456def789..."
Query a trade by transaction hash (POST):
curl -X POST "https://api.mobula.io/api/2/token/trade" \
  -H "Content-Type: application/json" \
  -d '{
    "blockchain": "base",
    "transactionHash": "0x123abc456def789..."
  }'
Query on Ethereum:
curl -X GET "https://api.mobula.io/api/2/token/trade?blockchain=ethereum&transactionHash=0xabc123..."

Sample Response

{
  "data": {
    "id": "987654321",
    "operation": "regular",
    "type": "buy",
    "baseTokenAmount": 250.75,
    "baseTokenAmountRaw": "250750000000000000000",
    "baseTokenAmountUSD": 3000.9,
    "quoteTokenAmount": 3000.9,
    "quoteTokenAmountRaw": "3000900000",
    "quoteTokenAmountUSD": 3000.9,
    "date": 1699545600000,
    "swapSenderAddress": "0xabc123def456...",
    "transactionSenderAddress": "0xdef456abc789...",
    "blockchain": "Base",
    "transactionHash": "0x123abc456def789...",
    "marketAddress": "0x4200000000000000000000000000000000000006",
    "baseTokenPriceUSD": 11.96,
    "quoteTokenPriceUSD": 1.0,
    "labels": ["smart-money", "pro-trader"]
  }
}

Error Responses

404 - Trade not found:
{
  "statusCode": 404,
  "message": "Trade not found"
}
404 - Pool not found:
{
  "statusCode": 404,
  "message": "Pool not found"
}
400 - Missing parameters:
{
  "statusCode": 400,
  "message": "Blockchain is required"
}

Use Cases

  • Transaction monitoring: Track specific trades after detecting a transaction on-chain
  • Trading analysis: Analyze individual trades with full context
  • User history: Show trade details when a user clicks on a transaction in their wallet
  • Price discovery: Get the exact execution price for a specific trade
  • Compliance: Retrieve detailed trade information for auditing purposes

Query Parameters

blockchain
string
required

Blockchain name or chain ID

transactionHash
string
required

Transaction hash

Response

200 - application/json

Token trade response

data
object
required