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

# Trades

Stellar NFT trades, covering both Classic NFTs (traded on the SDEX orderbook via `manage_sell_offer` / `manage_buy_offer`) and Soroban NFTs (traded through smart-contract atomic swaps). Hydrated with NFT metadata (name, image URL parsed from the issuer's `stellar.toml`) and USD pricing using the Stellar hourly prices model.

## Coverage

| Token Standard | Protocol           | Detection                                                                                     |
| -------------- | ------------------ | --------------------------------------------------------------------------------------------- |
| classic        | stellar\_orderbook | NFT-classified assets traded on the SDEX (Litemint, locked-issuer NFTs, supply ≤ 10M stroops) |
| soroban        | soroban            | Contracts emitting `token_transfers` rows with `token_id IS NOT NULL` (SEP-50)                |

<Note>
  Classic NFT trades also appear in `stellar.dex.trades`. `stellar.nfts.trades` is the NFT-classified subset. `marketplace` is currently populated for known Classic marketplaces (e.g. `litemint`) and is null for Soroban trades until specific contracts are added.
</Note>

### Table Columns

Unique Key: `unique_id`

| Column Name         | Description                                                                                                                                                                                                         |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| marketplace         | NFT marketplace attributed via the asset's TOML / issuer mapping (e.g. `litemint`). Null when the asset isn't attributable to a known marketplace, including all Soroban trades until specific contracts are added. |
| protocol            | Trading-venue protocol. `stellar_orderbook` for SDEX (Classic); `soroban` for Soroban atomic-swap trades.                                                                                                           |
| token\_standard     | `classic` for Classic Stellar NFTs; `soroban` for Soroban-contract NFTs.                                                                                                                                            |
| contract\_id        | Soroban contract address (C-prefixed StrKey). Null for Classic NFTs.                                                                                                                                                |
| order\_match\_type  | `BUY` or `SELL` from the perspective of the recorded effect (Classic) or `BUY` (Soroban atomic swap).                                                                                                               |
| trade\_type         | `SINGLE_TRADE` (bundle support deferred to Phase 2).                                                                                                                                                                |
| buyer\_address      | Stellar G-address of the NFT recipient.                                                                                                                                                                             |
| seller\_address     | Stellar G-address of the NFT sender.                                                                                                                                                                                |
| asset\_id           | Canonical asset identifier. For Classic NFTs, `<asset_code>:<asset_issuer>`. For Soroban NFTs, the `contract_id`.                                                                                                   |
| asset\_code         | Asset code (Classic) or null (pure Soroban NFTs).                                                                                                                                                                   |
| asset\_issuer       | Issuer G-address (Classic) or null (pure Soroban NFTs).                                                                                                                                                             |
| token\_id           | Soroban NFT `token_id` within the contract. Null for Classic NFTs.                                                                                                                                                  |
| token\_name         | NFT name parsed from the issuer's `stellar.toml` (Classic) or contract metadata (Soroban). Best-effort.                                                                                                             |
| image\_url          | NFT image URL parsed from the issuer's `stellar.toml`. Best-effort.                                                                                                                                                 |
| item\_quantity      | Quantity of the NFT moved, in raw stroops. For 1-stroop-supply NFTs, `item_quantity = '1'` means the whole NFT. For older 1-whole-unit NFTs, `item_quantity = '10000000'` means the whole NFT.                      |
| currency\_asset\_id | Counter-asset identifier. `XLM` for native, `<code>:<issuer>` for Classic, `contract_id` for Soroban tokens.                                                                                                        |
| currency\_code      | Counter-asset code.                                                                                                                                                                                                 |
| currency\_decimals  | Counter-asset decimal precision used to normalize `raw_price`.                                                                                                                                                      |
| raw\_price          | Counter-asset amount paid for the NFT, in raw units (stroops for Classic / native, contract-defined for Soroban).                                                                                                   |
| price               | Counter-asset amount normalized to human units.                                                                                                                                                                     |
| usd\_price          | USD value of the trade based on the hourly counter-asset price. Null if it exceeds the upper sanity limit.                                                                                                          |
| extra\_fields       | Variant JSON with protocol-specific debug fields (offer\_id, sold/bought asset breakdown, Soroban event indices).                                                                                                   |
| ledger\_sequence    | Stellar ledger sequence number.                                                                                                                                                                                     |
| ledger\_close\_time | Timestamp at which the ledger containing the trade closed.                                                                                                                                                          |
| ledger\_hash        | Hash of the ledger.                                                                                                                                                                                                 |
| transaction\_hash   | 64-character hex Stellar transaction hash.                                                                                                                                                                          |
| transaction\_index  | Index of the transaction within the ledger.                                                                                                                                                                         |
| transaction\_result | Stellar transaction result code.                                                                                                                                                                                    |
| operation\_id       | Stellar TOID (Total Order ID) of the operation.                                                                                                                                                                     |
| effect\_index       | Index of the effect (Classic) or `token_transfer` event (Soroban) within the transaction.                                                                                                                           |
| unique\_id          | Unique identifier for the trade row.                                                                                                                                                                                |
| \_created\_at       | Row creation timestamp.                                                                                                                                                                                             |
| \_updated\_at       | Row last-update timestamp.                                                                                                                                                                                          |
