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

# Get a Trade

> Retrieve detailed information for a single trade, including on-chain transaction hashes, entry/exit prices, and realized PnL.

Fetch the full details of a specific trade, including on-chain transaction hashes for both the entry and exit, position direction, and realized performance.

## Endpoint

```http theme={null}
GET /v1/trades/{trade_id}
```

## Path parameters

<ParamField path="trade_id" type="string" required>
  Unique identifier of the trade.
</ParamField>

## Example request

```bash theme={null}
curl -H "Authorization: Bearer $ELUUP_API_KEY" \
  "https://api.eluup.ai/v1/trades/trade_9aBc2DeF8Gh"
```

## Response

<ResponseField name="id" type="string">
  Unique trade identifier.
</ResponseField>

<ResponseField name="agent_id" type="string">
  ID of the agent that executed the trade.
</ResponseField>

<ResponseField name="token_address" type="string">
  Token contract address.
</ResponseField>

<ResponseField name="token_symbol" type="string">
  Token symbol.
</ResponseField>

<ResponseField name="chain_id" type="integer">
  Chain ID.
</ResponseField>

<ResponseField name="direction" type="string">
  Either `BUY` or `SELL`.
</ResponseField>

<ResponseField name="entry_price_usd" type="float">
  Entry price in USD.
</ResponseField>

<ResponseField name="exit_price_usd" type="float">
  Exit price in USD. Null if still open.
</ResponseField>

<ResponseField name="pnl_usd" type="float">
  Realized profit or loss in USD. Null if open.
</ResponseField>

<ResponseField name="roi_pct" type="float">
  Return on investment percentage. Null if open.
</ResponseField>

<ResponseField name="status" type="string">
  `open` or `closed`.
</ResponseField>

<ResponseField name="entry_tx_hash" type="string">
  On-chain transaction hash for the entry.
</ResponseField>

<ResponseField name="exit_tx_hash" type="string">
  On-chain transaction hash for the exit. Null if open.
</ResponseField>

<ResponseField name="opened_at" type="integer">
  Unix timestamp when the trade was opened.
</ResponseField>

<ResponseField name="closed_at" type="integer">
  Unix timestamp when the trade was closed. Null if open.
</ResponseField>

### Example response

```json theme={null}
{
  "id": "trade_9aBc2DeF8Gh",
  "agent_id": "agent_2vL9xQpW",
  "token_address": "0x532f27101965dd16442E59d40670FaF5eBB142E4",
  "token_symbol": "BRETT",
  "chain_id": 8453,
  "direction": "BUY",
  "entry_price_usd": 0.0342,
  "exit_price_usd": 0.0427,
  "pnl_usd": 85.50,
  "roi_pct": 24.85,
  "status": "closed",
  "entry_tx_hash": "0x7c9e6f3a2b1d8e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f",
  "exit_tx_hash": "0x8d0a7f4b3c2e9d5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f",
  "opened_at": 1715603200,
  "closed_at": 1715700000
}
```
