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

> [tab] Non-Native Vector Support
>
> | Column Name | Type | Not Null | Cube Field | Description |
> | - | - | - | - | - |
> | DATA\_SET | STRING | Y | [Data Set](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/risk.md#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](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/booking.md#trades) | The trade Id. |
> | RISK\_FACTOR | STRING | Y | [RiskFactor](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/risk.md#risk-factors) | The risk-factor. **Note:** This is required for non-modellable risk-factors, and optional for modellable risk-factors. |
> | RISK\_CLASS | STRING | Y | [RiskClass](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/risk.md#risk-classes) | The risk class, which will be one of the following:GIRR, CSR, Equity, Commodity, FX, allin |
> | PL\_LH | STRING | Y | [Liquidity Horizon](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/risk.md#liquidity-horizons) | The Liquidity Horizon in days: 10, 20, 40, 60 or 120   **Note:** For non-modellable risk-factors, this value should be blank (though it may be set to 10 without causing any problems).  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](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/risk.md#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](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/dates.md#date) | Timestamp (at close of business) for the data. |

> [tab] Native Vector Support
>
> | Column Name | Type | Not Null | Cube Field | Description |
> | - | - | - | - | - |
> | DATA\_SET | STRING | Y | [Data Set](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/risk.md#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](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/booking.md#trades) | The trade Id. |
> | RISK\_FACTOR | STRING | Y | [RiskFactor](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/risk.md#risk-factors) | The risk-factor. **Note:** This is required for non-modellable risk-factors, and optional for modellable risk-factors. |
> | RISK\_CLASS | STRING | Y | [RiskClass](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/risk.md#risk-classes) | The risk class, which will be one of the following:GIRR, CSR, Equity, Commodity, FX, allin |
> | PL\_LH | STRING | Y | [Liquidity Horizon](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/risk.md#liquidity-horizons) | The Liquidity Horizon in days: 10, 20, 40, 60 or 120   **Note:** For non-modellable risk-factors, this value should be blank (though it may be set to 10 without causing any problems).  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](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/risk.md#currencies) | The currency of the PnL vector entries. |
> | BASE\_PV | DOUBLE | Y | This field is a measure | The base PV. |
> | PV | ARRAY(DOUBLE) | Y | This field is a measure | The PV vector calibrated for 12 months' worth of data. The entries in this vector represent the PV for each scenario. The values are separated by a semi-colon. This vector may optionally represent the P\&L vector by setting the base PV to zero. |
> | AS\_OF\_DATE | DATE | Y | [AsOfDate](https://docs.activeviam.com/solutions/frtb/6.0/cube/dimensions/dates.md#date) | Timestamp (at close of business) for the data. |

## IMATRADES\_VECTOR Table Fields

> [tab] 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] Native Vector Support
>
> No vector table is required when the database natively supports aggregation on vector types.

## IMATRADES\_VECTOR Unique Key

> [tab] Non-Native Vector Support
>
> | Columns |
> | - |
> | VECTOR\_INDEX |
> | DATA\_SET |
> | TRADE\_KEY |
> | RISK\_FACTOR |
> | RISK\_CLASS |
> | PL\_LH |
> | AS\_OF\_DATE |

> [tab] Native Vector Support
>
> No vector table is required when the database natively supports aggregation on vector types.

## Outgoing Joins

> [tab] Non-Native Vector Support
>
> | Target Table | Source Columns | Target Columns |
> | - | - | - |
> | [IMATRADES\_VECTOR](https://docs.activeviam.com/solutions/frtb/6.0/database/imatrades.md#imatrades_vector-table-fields) | DATA\_SET TRADE\_KEY RISK\_FACTOR RISK\_CLASS PL\_LH AS\_OF\_DATE | DATA\_SET TRADE\_KEY RISK\_FACTOR RISK\_CLASS PL\_LH AS\_OF\_DATE |
> | [IMARISK\_FACTORS](https://docs.activeviam.com/solutions/frtb/6.0/database/imarisk_factors.md) | RISK\_FACTOR RISK\_CLASS AS\_OF\_DATE | RISK\_FACTOR RISK\_CLASS AS\_OF\_DATE |
> | [TRADE\_MAPPING](https://docs.activeviam.com/solutions/frtb/6.0/database/trade_mapping.md) | TRADE\_KEY AS\_OF\_DATE | TRADE\_KEY AS\_OF\_DATE |

> [tab] Native Vector Support
>
> | Target Table | Source Columns | Target Columns |
> | - | - | - |
> | [IMARISK\_FACTORS](https://docs.activeviam.com/solutions/frtb/6.0/database/imarisk_factors.md) | RISK\_FACTOR RISK\_CLASS AS\_OF\_DATE | RISK\_FACTOR RISK\_CLASS AS\_OF\_DATE |
> | [TRADE\_MAPPING](https://docs.activeviam.com/solutions/frtb/6.0/database/trade_mapping.md) | TRADE\_KEY AS\_OF\_DATE | TRADE\_KEY AS\_OF\_DATE |
