> ## 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. For these, each fact is at the book and legal entity level.

| Store Field | Key | CanBeNull | Type | Cube Field | Description |
| - | - | - | - | - | - |
| TradeKey | Y | | String | [Trades](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/booking.md#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](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/booking.md#books) | The book to map the trade to (must match the node in the Book Hierarchy). |
| LegalEntity | | | String | [Legal Entities](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/organization.md#legal-entities) | Legal Entity to map the trade to (must match the node in the Legal Entity Hierarchy). |
| TradeDate | | | LOCALDATE\[yyyy-mm-dd] | [TradeDates](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/dates.md#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](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/booking.md#inclusion) | Indicates if the trade should be included (“Y”) or not by default in the calculations. |

References:

* [BookDescription](https://docs.activeviam.com/solutions/frtb/6.0/datastore/global/bookdescription.md) by **Book** and **AsOfDate**
* [BookHierarchy](https://docs.activeviam.com/solutions/frtb/6.0/datastore/global/bookhierarchy.md) by **Book** and **AsOfDate**
* [LegalEntityHierarchy](https://docs.activeviam.com/solutions/frtb/6.0/datastore/global/legalentityhierarchy.md) by **LegalEntity** and **AsOfDate**
* [LegalEntityAttributes](https://docs.activeviam.com/solutions/frtb/6.0/datastore/global/legal-entity-attributes.md) by **LegalEntity** and **AsOfDate**
* [Categories](https://docs.activeviam.com/solutions/frtb/6.0/datastore/global/categories.md) by **Book** and **AsOfDate**
