# NFTSale

The SALE module defines several key data structures to manage NFT sales, liquidity pools, and related information:

**1. `NFTSale<phantom CURRENCY>`:**

* Represents an NFT sale, holding details such as the price per NFT, creator address, collection ID, sale status, and the NFTs themselves (stored as dynamic fields).
* The `CURRENCY` phantom type parameter allows for specifying the currency used in the sale.

**2. `NFTPool<phantom CURRENCY>`:**

* Represents a liquidity pool for trading NFTs within a specific collection.
* Stores an order book (`OrderBook`) containing buy (bid) and sell (ask) orders.
* The `CURRENCY` phantom type parameter defines the currency used for trading.

**3. `OrderBook`:**

* Contains two vectors: `asks` and `bids`, each storing `NFTOrderEntry` structs.

**4. `NFTOrderEntry`:**

* Represents an individual order in the order book, containing details like price, owner, quantity, and filled quantity.

**5. `PoolRegistry`:**

* A global registry that keeps track of all created `NFTPool` objects.
* Stores a table mapping collection IDs to vectors of registered currency types.

**6. `NFTListing<phantom CURRENCY>`:**

* Represents an NFT listed for sale within an `NFTSale`.
* Stores the NFT itself, the sale ID, and the price.

**7. `NFTFieldKey<phantom CURRENCY>`:**

* Used as a key for storing NFTs as dynamic fields within `NFTSale` and `NFTPool` objects.

These data structures work together to provide a robust and efficient system for managing NFT sales and liquidity pools. The use of phantom types ensures type safety and allows for specifying different currencies for sales and trades.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.artinals.com/artinals-protocol/sale-module/data-structures/nftsale.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
