> ## 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

The DEX trades table contains successful swaps made on decentralized exchanges (DEX), consolidated into a single table.

## Active Marketplaces

Currently, two major marketplaces are active:

* **Tradeport**
* **Bluemove**

Both support buy and bid flows, but their event formats are non-standardized and vary even within the same platform.

### Buy Events

These represent finalized NFT purchases.

| Marketplace | Protocol  | Event Source                                            |
| ----------- | --------- | ------------------------------------------------------- |
| Tradeport   | Tradeport | Custom buy events                                       |
| Bluemove    | Bluemove  | Custom buy events                                       |
| -           | Orderbyte | Protocol-level buy events (WIP marketplace attribution) |

> 💡 Events are explicitly named as buy, so detection is straightforward. Attribution to marketplaces via Orderbyte remains a work in progress.

### Bid Events

These are **settled bids**, i.e. when a bid was accepted.

| Marketplace | Protocol  | Event Types           |
| ----------- | --------- | --------------------- |
| Tradeport   | Tradeport | 8+ unique event types |
| -           | Orderbyte | 1 known bid event     |

## Aggregator Trades (WIP)

Sui has no native aggregator standard. Current state:

* **Tradeport acts as an aggregator**, routing trades through other marketplaces like Bluemove.
  * The **Bluemove trade event is still emitted**, despite aggregation.
  * Aggregator trades are **not explicitly marked** in logs.
* Attribution requires:
  * Combining **balance changes**
  * Tracing **commission recipients** in the transaction block digest
  * Possibly recognizing aggregator contracts via known patterns

> ⚠️ Work in progress — Allium attribution heuristics are under development.

### Table Columns

`_str` columns are numeric fields cast `varchar` to retain precision when summing.

Unique Key: `unique_id`

| Column Name                          | Description                                                                                                         |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
| marketplace                          | Marketplace where this trade occurred. e.g. tradeport                                                               |
| protocol                             | Protocol that was used for this trade e.g. orderbyte                                                                |
| package\_id                          | Package ID of the protocol that was used for this trade.                                                            |
| event\_type                          | Event type of the protocol that was used for this trade.                                                            |
| order\_match\_type                   | Type of sales. Registered as 'BUY' for direct purchase and 'ACCEPT\_BID' for bids accepeted.                        |
| trade\_type                          | Type of trade. SINGLE\_TRADE for single token sale or BUNDLE\_TRADE when more than 1 token is sold in a transaction |
| buyer\_address                       | Address of the buyer.                                                                                               |
| seller\_address                      | Address of the seller.                                                                                              |
| nft\_id                              | object\_id of the NFT.                                                                                              |
| nft\_name                            | Name of the NFT collection.                                                                                         |
| collection\_id                       | ID of the NFT collection.                                                                                           |
| nft\_extra\_fields                   | Extra fields of the NFT.                                                                                            |
| coin\_type                           | Type of the currency used in the trade.                                                                             |
| raw\_price                           | The price of the NFT in the currency used to purchase (not divided by the number of decimals).                      |
| price                                | 'raw\_price' divided by the number of decimals of the currency                                                      |
| usd\_price                           | The USD price of the NFTs in this trade.                                                                            |
| extra\_fields                        | Extra fields of the trade.                                                                                          |
| transaction\_block\_digest           | The block digest of the transaction that contains the trade.                                                        |
| checkpoint\_timestamp                | The timestamp of the checkpoint that contains the trade.                                                            |
| checkpoint\_sequence                 | The sequence of the checkpoint that contains the trade.                                                             |
| checkpoint\_digest                   | The digest of the checkpoint that contains the trade.                                                               |
| unique\_id                           | Unique ID of each trade.                                                                                            |
| \_created\_at                        | The timestamp of the creation of the trade.                                                                         |
| \_updated\_at                        | The timestamp of the last update of the trade.                                                                      |
| \_helper\_nft\_tokens\_\_updated\_at | The timestamp of the last update of the NFT metadata.                                                               |
| \_changed\_since\_full\_refresh      | Whether the trade has changed since the last full refresh.                                                          |
