# Trade Ledger (TradeLedger)

The `TradeLedger` struct represents a **marketplace registry** for a specific NFT collection and trading currency.

#### **Structure Definition:**

```
public struct TradeLedger has key {
    id: UID,
    collection_id: ID,
    collection_creator: address,  // Store collection creator
    collection_name: String,      // Store collection name
    collection_description: String, // Store description
    collection_uri: Url,          // Store metadata URI
    collection_logo_uri: Url,     // Store logo URI
    current_supply: u64,          // Track collection supply
    max_supply: u64,              // Track collection max supply
    is_mutable: bool,             // Track if collection is mutable
    has_deny_list_authority: bool, // Track deny list authority
    deny_list_size: u64,          // Track deny list size
    currency_type: TypeName,
    offers: Table<ID, TradeOffer>,
    user_offers: Table<address, vector<ID>>,
    price_index: Table<u64, vector<ID>>, 
    sorted_prices: vector<u64>,
    total_active_offers: u64,
    buy_offers: Table<ID, BuyOffer>,
    user_buy_offers: Table<address, vector<ID>>,
    buy_price_index: Table<u64, vector<ID>>, 
    sorted_buy_prices: vector<u64>,
    total_active_buy_offers: u64,
    timestamp: u64
    }
```

#### **Purpose**

* Maintains **trade offers and buy offers** for a specific NFT collection.
* Tracks **active prices** to support efficient price discovery.
* Links **users to their offers**, enabling faster retrieval of 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/market-module/data-structures/trade-ledger-tradeledger.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.
