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

# TradeMapping

The **TradeMapping** store maps trades to books and legal entities by **TradeKey** and **AsOfDate**.

It is referenced from the base tables in all the trade-level cubes.

<Note>
  This mapping is only used for the trade-level cubes.
  In the IMA, there are some summary cubes that do not include a trade-level and, for these, each fact is at the book and legal entity level.
</Note>

| Store Field | Key | CanBeNull | Type                   | Cube Field                                  | Description                                                                                                                                      |
| ----------- | --- | --------- | ---------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| TradeKey    | Y   |           | String                 | [Trades](../../cube/trades)                 | (e.g. “IR\_IRSWAP\_LIBOR3M”, “EQ\_12345677”, etc.) – if coming from multiple systems may need to prepend source system to the id for uniqueness. |
| Book        |     |           | String                 | [Books](../../cube/books)                   | The book to map the trade to (must match the node in the Book Hierarchy).                                                                        |
| LegalEntity |     |           | String                 | [Legal Entities](../../cube/legal-entities) | Legal Entity to map the trade to (must match the node in the Legal Entity Hierarchy).                                                            |
| TradeDate   |     |           | LOCALDATE\[yyyy-mm-dd] | [TradeDates](../../cube/tradedates)         | The date on which the trade took place                                                                                                           |
| AsOfDate    | Y   |           | LOCALDATE\[yyyy-mm-dd] |                                             | Timestamp (at close of business) for the data.                                                                                                   |
| Inclusion   |     |           | String                 | [Inclusion](../../cube/inclusion)           | Indicates if the trade should be included (“Y”) or not by default in the calculations.                                                           |

References:

* [BookDescription](./bookdescription) by **Book** and **AsOfDate**
* [BookHierarchy](./bookhierarchy) by **Book** and **AsOfDate**
* [LegalEntityHierarchy](./legalentityhierarchy) by **LegalEntity** and **AsOfDate**
* [LegalEntityAttributes](./legal-entity-attributes) by **LegalEntity** and **AsOfDate**
* [Categories](./categories) by **Book** and **AsOfDate**
