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

## Bitcoin NFT Trades

The Bitcoin NFT landscape comprises multiple marketplaces. The table below shows the Bitcoin NFT marketplaces indexed by Allium.

<table><thead><tr><th width="221">Marketplace</th></tr></thead><tbody><tr><td>ordwallet</td></tr><tr><td>ordswap</td></tr><tr><td>openordex</td></tr><tr><td>magiceden</td></tr><tr><td>gamma</td></tr><tr><td>unisat</td></tr><tr><td>okx</td></tr></tbody></table>

### Sample Query

Get the market overview of Bitcoin NFTs, in 10 lines of SQL.

```sql theme={null}
SELECT 
    date(block_timestamp) as date, 
    marketplace,
    count(*) as "Count",
    count(distinct collection_name) as "Collections",
    count(distinct buyer_address) as "Buyers",
    sum(usd_price) as "USD Volume"
FROM bitcoin.nfts.trades 
group by 1,2
order by 1 desc
```

<Frame>
  <img src="https://mintcdn.com/allium-e770e2b7/rnUMHb7oivWXnpD5/images/image-bitcoin-nfts-trades.png?fit=max&auto=format&n=rnUMHb7oivWXnpD5&q=85&s=b93c5430fde4326d992a44415a98cb17" width="1530" height="836" data-path="images/image-bitcoin-nfts-trades.png" />
</Frame>

Get and overview of [Bitcoin NFT](https://app.hex.tech/fc6e427a-6bfb-40e5-9cc1-1808967c3c12/app/fd5def55-063a-433f-83f6-26d01f9e15f2/latest?selectedStaticCellId=7403c8c9-4bd8-4221-b4fb-dc1809d09f96)volumes across key NFT marketplace.

### Table Columns

| Column Name                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Example                                                                                                                                                                                                                          |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| marketplace                  | The marketplace used to faciliate the trade                                                                                                                                                                                                                                                                                                                                                                                                                                            | ordswap                                                                                                                                                                                                                          |
| protocol                     | The protocol of the marketplace.                                                                                                                                                                                                                                                                                                                                                                                                                                                       | NULL                                                                                                                                                                                                                             |
| order\_match\_type           | Type of sales. Registered as BUY for direct purchase and ACCEPT\_BID for bids accepted.                                                                                                                                                                                                                                                                                                                                                                                                | BUY                                                                                                                                                                                                                              |
| trade\_type                  | Type of trade. SINGLE\_TRADE for single token sales or BUNDLE\_TRADE when more than 1 token is sold in a transaction.                                                                                                                                                                                                                                                                                                                                                                  | SINGLE\_TRADE                                                                                                                                                                                                                    |
| buyer\_address               | Pubkey of the buyer, defined as the party sending the funds                                                                                                                                                                                                                                                                                                                                                                                                                            | bc1pfsl6u50r05cpegy6aqf838w4nz2lyml9946ntfzjt8s0u4e05w5qju8tpa                                                                                                                                                                   |
| seller\_address              | Pubkey of the seller, defined as the party sending the NFT                                                                                                                                                                                                                                                                                                                                                                                                                             | bc1pcg5gvey9fth7danwy46em0fmynhl9mzqghdjld3c9l6fyadzkfqs2tf72q                                                                                                                                                                   |
| \_nft\_recipient             | Pubkey of the party receiving the NFT. May be different from `buyer_address`                                                                                                                                                                                                                                                                                                                                                                                                           | bc1pfsl6u50r05cpegy6aqf838w4nz2lyml9946ntfzjt8s0u4e05w5qju8tpa                                                                                                                                                                   |
| \_sales\_proceeds\_recipient | Pubkey of the party receiving the funds. May be different from `seller_address`                                                                                                                                                                                                                                                                                                                                                                                                        | bc1pcg5gvey9fth7danwy46em0fmynhl9mzqghdjld3c9l6fyadzkfqs2tf72q                                                                                                                                                                   |
| currency\_address            | Address of the currency.                                                                                                                                                                                                                                                                                                                                                                                                                                                               | NULL                                                                                                                                                                                                                             |
| currency\_symbol             | Symbol of the currency.                                                                                                                                                                                                                                                                                                                                                                                                                                                                | BTC                                                                                                                                                                                                                              |
| raw\_gas\_fee                | Gas fee of the trade in satoshis                                                                                                                                                                                                                                                                                                                                                                                                                                                       | 50088                                                                                                                                                                                                                            |
| gas\_fee                     | Gas fee of the trade normalized                                                                                                                                                                                                                                                                                                                                                                                                                                                        | 0.00050088                                                                                                                                                                                                                       |
| usd\_gas\_fee                | USD value of the gas fee                                                                                                                                                                                                                                                                                                                                                                                                                                                               | 13.471162591                                                                                                                                                                                                                     |
| raw\_sales\_proceeds         | Sales proceeds of the trade in satoshis                                                                                                                                                                                                                                                                                                                                                                                                                                                | 155670                                                                                                                                                                                                                           |
| sales\_proceeds              | Sales proceeds of the trade normalized                                                                                                                                                                                                                                                                                                                                                                                                                                                 | 0.0015567                                                                                                                                                                                                                        |
| usd\_sales\_proceeds         | USD value of the sales proceeds                                                                                                                                                                                                                                                                                                                                                                                                                                                        | 31.953976158                                                                                                                                                                                                                     |
| raw\_price                   | Price of the NFT in number of satoshis. (includes fees)                                                                                                                                                                                                                                                                                                                                                                                                                                | 100000                                                                                                                                                                                                                           |
| price                        | Price of the NFT normalized. (includes fees)                                                                                                                                                                                                                                                                                                                                                                                                                                           | 0.001                                                                                                                                                                                                                            |
| usd\_price                   | USD value of the trade. The USD value of the trade is calculated by multiplying the hourly exchange rate of the currency (e.g. BTC) with the price oracle data source from exchanges during the hour of the trade. (includes fees)                                                                                                                                                                                                                                                     | 22.21803                                                                                                                                                                                                                         |
| buyer\_fees                  | <p>Fees paid by the NFT buyer.</p><p>It might be "unimplemented" if we haven't parse the fees for that protocol yet. Otherwise, it will be a json with 9 columns.</p><p>"creator" fees are the ones paid to the nft creator (royalties); "platform" fees are paid to the marketplace; "total" fees are the sum of both fees</p><p>Use this syntax to access a specific fee:buyer\_fees\['usd\_total']::double. And don't worry about the unimplemented ones, they will become null</p> | `{ "creator": 0.625, "platform": null, "raw\_creator": "625000000000000000", "raw\_platform": null, "raw\_total": "625000000000000000", "total": 0.625, "usd\_creator": 0.40125, "usd\_platform": null, "usd\_total": 0.40125 }` |
| seller\_fees                 | Fees paid by the NFT seller. Similar in structure to `buyer_fees`                                                                                                                                                                                                                                                                                                                                                                                                                      | `{ "creator": 0.625, "platform": null, "raw\_creator": "625000000000000000", "raw\_platform": null, "raw\_total": "625000000000000000", "total": 0.625, "usd\_creator": 0.40125, "usd\_platform": null, "usd\_total": 0.40125 }` |
| agg\_fees                    | Sum of the fees paid by the NFT buyer and the seller. Similar in structure to `buyer_fees`                                                                                                                                                                                                                                                                                                                                                                                             | `{ "creator": 0.625, "platform": null, "raw\_creator": "625000000000000000", "raw\_platform": null, "raw\_total": "625000000000000000", "total": 0.625, "usd\_creator": 0.40125, "usd\_platform": null, "usd\_total": 0.40125 }` |
| raw\_fee                     | Fee of the trade in number of satoshis. (deprecated)                                                                                                                                                                                                                                                                                                                                                                                                                                   | 100000                                                                                                                                                                                                                           |
| fee                          | Fee of the trade normalized. (deprecated)                                                                                                                                                                                                                                                                                                                                                                                                                                              | 0.001                                                                                                                                                                                                                            |
| usd\_fee                     | USD value of the feeade. The USD value of the feede is calculated by multiplying the hourly exchange rate of the currency (e.g. BTC) with the price oracle data source from exchanges during the hour of the trade. (deprecated)                                                                                                                                                                                                                                                       | 22.21803                                                                                                                                                                                                                         |
| item\_quantity               | Number of NFTs traded within this utxo. As each row in the table is a transfer of 1 UTXO, in some cases, 2 inscriptions can be in 1 UTXO, resulting in a bundle trade.                                                                                                                                                                                                                                                                                                                 | 1                                                                                                                                                                                                                                |
| inscription\_id              | inscription id, composed of the genesis transaction hash with a i0 suffix to represent the first inscription in the tx                                                                                                                                                                                                                                                                                                                                                                 | 83f84267835b46aa44ab9f6e829c1363f2c5bc882d04242d20b832a034633779i0                                                                                                                                                               |
| inscription\_name            | The inscription name, if available.                                                                                                                                                                                                                                                                                                                                                                                                                                                    |                                                                                                                                                                                                                                  |
| inscription\_number          | The inscription number, sometimes known as index, if available                                                                                                                                                                                                                                                                                                                                                                                                                         | 1980222                                                                                                                                                                                                                          |
| collection\_name             | The collection name, if available.                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Bitcoin Punks                                                                                                                                                                                                                    |
| collection\_slug             | The collection slug, if available                                                                                                                                                                                                                                                                                                                                                                                                                                                      | bitcoin-punks                                                                                                                                                                                                                    |
| content\_type                | Content type of the inscription                                                                                                                                                                                                                                                                                                                                                                                                                                                        | text/plain                                                                                                                                                                                                                       |
| content\_tag                 | Content tag, which is a reclassification of the raw `content_type` field to make it easy to analyze.                                                                                                                                                                                                                                                                                                                                                                                   | <p>image<br />video<br />application<br />audio<br />text<br />model<br />others</p>                                                                                                                                             |
| content\_length              | Number of bytes of the inscription content                                                                                                                                                                                                                                                                                                                                                                                                                                             | 1204                                                                                                                                                                                                                             |
| content\_protocol            | <p>(For json inscriptions with a <code>p</code> key)<br />The protocol of the inscription, derived with <code>json\_content\['p']</code></p>                                                                                                                                                                                                                                                                                                                                           | brc-20                                                                                                                                                                                                                           |
| content\_parsed              | <p>(For textual inscriptions)<br />The parsed content of the inscription, could be a utf-8 string or a json object</p>                                                                                                                                                                                                                                                                                                                                                                 | <p><code>hello world</code> </p><p /><p><code>`{"p":"brc-20","op":"transfer","tick":"pepe","amt":"500"}`</code></p>                                                                                                              |
| is\_brc20                    | Derived with `content_protocol = 'brc-20'`. To be deprecated for `is_token` + `content_protocol`                                                                                                                                                                                                                                                                                                                                                                                       | true                                                                                                                                                                                                                             |
| is\_token                    | <p>Used to identify token-like standards.</p><p /><p>Derived with <code>content\_protocol = 'brc-20' or 'orc-20' or 'orc20'</code></p>                                                                                                                                                                                                                                                                                                                                                 | true                                                                                                                                                                                                                             |
| token\_tick                  | <p>The tick of the token-like inscription. <br /><br />Derived with <code>content\_parsed\['tick']</code></p>                                                                                                                                                                                                                                                                                                                                                                          | ordi                                                                                                                                                                                                                             |
| token\_amt                   | <p>The amout specified in the token-like inscription. <br /><br />Derived with <code>content\_parsed\['amt']</code></p>                                                                                                                                                                                                                                                                                                                                                                | 100                                                                                                                                                                                                                              |
| sats\_per\_token\_tick       | <p>Satoshis per token-like amount.<br /><br />Derived with <code>satoshi of the trade / token\_amt</code></p>                                                                                                                                                                                                                                                                                                                                                                          | 1000000                                                                                                                                                                                                                          |
| usd\_per\_token\_tick        | <p>USD per token-like amount.<br /><br />Derived with <code>USD of the trade / token\_amt</code></p>                                                                                                                                                                                                                                                                                                                                                                                   | 1.50                                                                                                                                                                                                                             |
| domain\_protocol             | Domain name protocol used to parse the content                                                                                                                                                                                                                                                                                                                                                                                                                                         | <p>sns<br />bitmap</p>                                                                                                                                                                                                           |
| domain\_name                 | the domain name (portion before the `.` )                                                                                                                                                                                                                                                                                                                                                                                                                                              | abc                                                                                                                                                                                                                              |
| domain\_namespace            | the domain namespace (portion after the `.` )                                                                                                                                                                                                                                                                                                                                                                                                                                          | sats                                                                                                                                                                                                                             |
| domain\_valid                | true/false - domains are invalid if they are not the first or are unstable inscriptions                                                                                                                                                                                                                                                                                                                                                                                                | true/false                                                                                                                                                                                                                       |
| domain\_meta                 | the metadata of the domain op, such as `about`, `rev`, `avatar` fields.                                                                                                                                                                                                                                                                                                                                                                                                                | `{"avatar":"cfab194b924f7785c6e453728e1c264b89b74843633278cda3ad3f57576c1e93i0","op":"reg"}`                                                                                                                                     |
| is\_domain                   | <p>true/false - whether the domain name/namespace fit the requirements of sns/bitmap protocols. </p><p><br />Malformed/illegal formats of inscriptions are removed here. There may be some edge cases because sns allows text inscriptions which have lots of noise.</p>                                                                                                                                                                                                               | true/false                                                                                                                                                                                                                       |
| genesis\_fee                 | Genesis fee of the inscription when it was inscribed                                                                                                                                                                                                                                                                                                                                                                                                                                   | 12313                                                                                                                                                                                                                            |
| satoshi\_timestamp           | The timestamp of the satoshi when it was mined.                                                                                                                                                                                                                                                                                                                                                                                                                                        | 2019-02-14 20:39:36                                                                                                                                                                                                              |
| transaction\_hash            | Transaction hash of the nft trade.                                                                                                                                                                                                                                                                                                                                                                                                                                                     | 47b1a461fc68ece7d0d933fc0fb77c5316867887d5bce266596d48d14f077130                                                                                                                                                                 |
| transaction\_index           | Index of the transaction within the block                                                                                                                                                                                                                                                                                                                                                                                                                                              | 281                                                                                                                                                                                                                              |
| block\_timestamp             | Timestamp of the block.                                                                                                                                                                                                                                                                                                                                                                                                                                                                | 2023-02-14 20:39:36                                                                                                                                                                                                              |
| block\_number                | Block number of the nft trade.                                                                                                                                                                                                                                                                                                                                                                                                                                                         | 776557                                                                                                                                                                                                                           |
| block\_hash                  | Block hash of the nft trade.                                                                                                                                                                                                                                                                                                                                                                                                                                                           | 000000000000000000039d091930c5b3cc660c4f246cfc66e49ebd677a4e7afd                                                                                                                                                                 |
| unique\_id                   | Unique id of the trade, composed from transaction\_hash.                                                                                                                                                                                                                                                                                                                                                                                                                               | txn-47b1a461fc68ece7d0d933fc0fb77c5316867887d5bce266596d48d14f077130                                                                                                                                                             |
