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

# IMATRADES

The **IMATRADES** table is the base in the IMA Cube star schema. Each row in this table represents a fact in the IMA Cube.

The **IMATRADES** table contains vector fields. In databases that do not natively support vectors, the vector fields are stored as separate columns.

## IMATRADES Table Fields

<Tabs>
  <Tab title="Non-Native Vector Support">
    | Column Name  | Type   | Not Null | Cube Field                                      | Description                                                                                                                                                                                                                                                                                                                                                                                  |
    | ------------ | ------ | -------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | DATA\_SET    | STRING | Y        | [Data Set](../cube/data-sets)                   | The data set to which the entry belongs. The following different values are possible:“Full Set Current”: data for the last 12 months, “Reduced Set Stressed”: data with the reduced set of risk factors for the 12-month stress period, “Reduced Set Current”: data with the reduced set of risk factors for the last 12 months For non-modellable risk-factors, this value should be blank. |
    | TRADE\_KEY   | STRING | Y        | This field is for internal usage only           | The field contains the `tradeID` for full data or `Book#LegalEntity` for summary data                                                                                                                                                                                                                                                                                                        |
    | TRADE\_ID    | STRING | Y        | [TradeId](../cube/trades)                       | The trade Id.                                                                                                                                                                                                                                                                                                                                                                                |
    | RISK\_FACTOR | STRING | Y        | [RiskFactor](../cube/risk-factors)              | The risk-factor.<br /><br />**Note:** This is required for non-modellable risk-factors, and optional for modellable risk-factors.                                                                                                                                                                                                                                                            |
    | RISK\_CLASS  | STRING | Y        | [RiskClass](../cube/risk-classes)               | The risk class, which will be one of the following:GIRR, CSR, Equity, Commodity, FX, allin                                                                                                                                                                                                                                                                                                   |
    | PL\_LH       | STRING | Y        | [Liquidity Horizon](../cube/liquidity-horizons) | The Liquidity Horizon in days: 10, 20, 40, 60 or 120 <br /><br /> **Note:** For non-modellable risk-factors, this value should be blank (though it may be set to 10 without causing any problems).<br /><br /> The list must contain all the referring horizons, for instance for a horizon of 40 you must specify "40;20;10".                                                               |
    | CCY          | STRING | Y        | [Currency](../cube/currencies)                  | The currency of the PnL vector entries.                                                                                                                                                                                                                                                                                                                                                      |
    | BASE\_PV     | DOUBLE | Y        | This field is a measure                         | The base PV.                                                                                                                                                                                                                                                                                                                                                                                 |
    | AS\_OF\_DATE | DATE   | Y        | [AsOfDate](../cube/date)                        | Timestamp (at close of business) for the data.                                                                                                                                                                                                                                                                                                                                               |
  </Tab>

  <Tab title="Native Vector Support">
    | Columns      |
    | ------------ |
    | DATA\_SET    |
    | TRADE\_KEY   |
    | RISK\_FACTOR |
    | RISK\_CLASS  |
    | PL\_LH       |
    | AS\_OF\_DATE |
  </Tab>
</Tabs>

## IMATRADES\_VECTOR Table Fields

<Tabs>
  <Tab title="Non-Native Vector Support">
    | Column Name   | Type   | Not Null |
    | ------------- | ------ | -------- |
    | VECTOR\_INDEX | INT    | Y        |
    | DATA\_SET     | STRING | Y        |
    | TRADE\_KEY    | STRING | Y        |
    | TRADE\_ID     | STRING | Y        |
    | RISK\_FACTOR  | STRING | Y        |
    | RISK\_CLASS   | STRING | Y        |
    | PL\_LH        | STRING | Y        |
    | CCY           | STRING | Y        |
    | BASE\_PV      | DOUBLE | Y        |
    | PV            | DOUBLE | Y        |
    | AS\_OF\_DATE  | DATE   | Y        |
  </Tab>

  <Tab title="Native Vector Support">
    No vector table is required when the database natively supports aggregation on vector types.
  </Tab>
</Tabs>

## IMATRADES\_VECTOR Unique Key

<Tabs>
  <Tab title="Non-Native Vector Support">
    | Columns       |
    | ------------- |
    | VECTOR\_INDEX |
    | DATA\_SET     |
    | TRADE\_KEY    |
    | RISK\_FACTOR  |
    | RISK\_CLASS   |
    | PL\_LH        |
    | AS\_OF\_DATE  |
  </Tab>

  <Tab title="Native Vector Support">
    No vector table is required when the database natively supports aggregation on vector types.
  </Tab>
</Tabs>

## Outgoing Joins

<Tabs>
  <Tab title="Non-Native Vector Support">
    | Target Table                          | Source Columns                                                                             | Target Columns                                  |
    | ------------------------------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------- |
    | [IMATRADES\_VECTOR](./imatrades)      | DATA\_SET<br />TRADE\_KEY<br />RISK\_FACTOR<br />RISK\_CLASS<br />PL\_LH<br />AS\_OF\_DATE | AS\_OF\_DATE<br />BOOK                          |
    | [IMARISK\_FACTORS](./imarisk_factors) | RISK\_FACTOR<br />RISK\_CLASS<br />AS\_OF\_DATE                                            | RISK\_FACTOR<br />RISK\_CLASS<br />AS\_OF\_DATE |
    | [TRADE\_MAPPING](./trade_mapping)     | TRADE\_KEY<br />AS\_OF\_DATE                                                               | TRADE\_KEY<br />AS\_OF\_DATE                    |
  </Tab>
</Tabs>
