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

# Tables

> Complete field-level reference for every common database table, including fields, types, keys, and descriptions for trades, counterparties, books, and instruments.

This page provides the complete field-level reference for all common database tables. The common layer defines tables for trades, counterparties, books, instruments, FX rates, and supporting structures. Solutions extend these tables with their own domain-specific fields.

For an overview of how tables relate to each other, see [Database model](/solutions/enterprise-risk-suite/1.0/common/developer-guide/database/database-model.md).

## TradeAttributes

Stores descriptive attributes for each trade. Solutions join their facts table to `TradeAttributes` on `AsOfDate` and `TradeId`.

| Field | Type | Key | Description |
| - | - | - | - |
| `AsOfDate` | `LocalDate` | Yes | Business date of the record |
| `TradeId` | `String` | Yes | Unique trade identifier |
| `Trader` | `String` | No | Name of the trader responsible for the trade |
| `Sales` | `String` | No | Name of the sales person associated with the trade |
| `TradeDate` | `LocalDate` | No | Date the trade was booked |
| `TradeMaturityDate` | `LocalDate` | No | Maturity date of the trade |
| `CounterpartyId` | `String` | No | Foreign key to `CounterpartyAttributes` |
| `OrganizationUnitId` | `String` | No | Foreign key to `OrganizationAttributes` |
| `BookId` | `String` | No | Foreign key to `BookAttributes` |

## CounterpartyAttributes

Stores counterparty classification data. This table is optional. Whether it is included and whether it can be toggled depends on the solution.

| Field | Type | Key | Description |
| - | - | - | - |
| `AsOfDate` | `LocalDate` | Yes | Business date of the record |
| `CounterpartyId` | `String` | Yes | Unique counterparty identifier |
| `CounterpartyParentId` | `String` | No | Identifier of the parent counterparty |
| `CounterpartyName` | `String` | No | Full counterparty name |
| `Rating` | `String` | No | Credit rating (e.g. AAA, A, B) |
| `Sector` | `String` | No | Industry sector |
| `CountryOfAddress` | `String` | No | Country of registered address |
| `CountryOfRisk` | `String` | No | Country of primary risk exposure |

## OrganizationAttributes

Stores organizational hierarchy entries. This table is optional. Whether it is included and whether it can be toggled depends on the solution.

| Field | Type | Key | Description |
| - | - | - | - |
| `AsOfDate` | `LocalDate` | Yes | Business date of the record |
| `OrganizationUnitId` | `String` | Yes | Unique organizational unit identifier |
| `OrganizationParentUnitId` | `String` | No | Identifier of the parent organizational unit |

## BookAttributes

Stores book hierarchy entries. This table is optional. Whether it is included and whether it can be toggled depends on the solution.

| Field | Type | Key | Description |
| - | - | - | - |
| `AsOfDate` | `LocalDate` | Yes | Business date of the record |
| `BookId` | `String` | Yes | Unique book identifier |
| `BookParentId` | `String` | No | Identifier of the parent book |

## BookStructure

Supports the Books dimension hierarchy. Stores the resolved path from root to each leaf in the hierarchy.

| Field | Type | Key | Description |
| - | - | - | - |
| `AsOfDate` | `LocalDate` | Yes | Business date of the record |
| `StructureLeafId` | `String` | Yes | Identifier of the leaf node in the hierarchy |
| `Level 1` | `String` | No | Name of the node at level 1 |
| `Level 2` | `String` | No | Name of the node at level 2 |
| `Level N` | `String` | No | Name of the node at level N (depth is configurable) |

## CounterpartyStructure

Supports the Counterparties dimension hierarchy. Stores the resolved path from root to each leaf.

| Field | Type | Key | Description |
| - | - | - | - |
| `AsOfDate` | `LocalDate` | Yes | Business date of the record |
| `StructureLeafId` | `String` | Yes | Identifier of the leaf node in the hierarchy |
| `Level 1` | `String` | No | Name of the node at level 1 |
| `Level 2` | `String` | No | Name of the node at level 2 |
| `Level N` | `String` | No | Name of the node at level N (depth is configurable) |

## OrganizationStructure

Supports the Organization dimension hierarchy. Stores the resolved path from root to each leaf.

| Field | Type | Key | Description |
| - | - | - | - |
| `AsOfDate` | `LocalDate` | Yes | Business date of the record |
| `StructureLeafId` | `String` | Yes | Identifier of the leaf node in the hierarchy |
| `Level 1` | `String` | No | Name of the node at level 1 |
| `Level 2` | `String` | No | Name of the node at level 2 |
| `Level N` | `String` | No | Name of the node at level N (depth is configurable) |

## InstrumentAttributes

Stores instrument reference data including standard identifiers and option-specific fields.

| Field | Type | Key | Description |
| - | - | - | - |
| `AsOfDate` | `LocalDate` | Yes | Business date of the record |
| `InstrumentId` | `String` | Yes | Unique instrument identifier |
| `InstrumentType` | `String` | No | Type of instrument; nullable |
| `Underlying` | `String` | No | Underlying asset identifier |
| `InstrumentNameLong` | `String` | No | Full instrument name |
| `InstrumentNameShort` | `String` | No | Short instrument name |
| `AssetClass` | `String` | No | Asset class |
| `InstrumentSector` | `String` | No | Instrument sector |
| `ISIN` | `String` | No | ISIN code |
| `CUSIP` | `String` | No | CUSIP code |
| `RIC` | `String` | No | Reuters Instrument Code |
| `BloombergCode` | `String` | No | Bloomberg identifier |
| `SEDOL` | `String` | No | SEDOL code |
| `ExchangeCode` | `String` | No | Exchange code |
| `Ticker` | `String` | No | Ticker symbol |
| `IssuerCountry` | `String` | No | Country of the issuer |
| `Strike` | `double` | No | Option strike price; nullable |
| `CallPut` | `String` | No | Option type (call or put); nullable |
| `Expiry` | `LocalDate` | No | Option expiry date; nullable |
| `OptionStyle` | `String` | No | Option exercise style (e.g. European, American); nullable |
| `InstrumentMaturityDate` | `LocalDate` | No | Maturity date of the instrument; nullable |

## Bucketing

Defines bucketing configurations that map instrument tenors to target tenors with an associated factor. Used in sensitivity bucketing workflows.

| Field | Type | Key | Description |
| - | - | - | - |
| `AsOfDate` | `LocalDate` | Yes | Business date of the record |
| `Underlying` | `String` | Yes | Underlying asset identifier |
| `BucketingMatrix` | `String` | Yes | Name of the bucketing matrix |
| `Tenor` | `String` | Yes | Source tenor to be mapped |
| `TargetTenor` | `String` | Yes | Target tenor after bucketing |
| `Factor` | `double` | No | Weighting factor applied during bucketing (default: 1.0) |

## VectorExpansion

Provides row-level support for expanding P\&L vectors into individual scenario rows. Contains one row per scenario index. This table has no key fields.

| Field | Type | Key | Description |
| - | - | - | - |
| `Index` | `int` | No | Zero-based scenario index used to cross-join with P\&L vector data |

## FxRateMarketData

Stores FX rate quotes used for currency conversion at query time. This table is provided by the market-data library, not by the common library itself.

| Field | Type | Key | Description |
| - | - | - | - |
| `AsOfDate` | `LocalDate` | Yes | Business date of the rate |
| `MarketDataSet` | `String` | Yes | Market data set identifier (e.g. "Official EOD") |
| `BaseCcy` | `String` | Yes | Base currency code (e.g. USD) |
| `CounterCcy` | `String` | Yes | Counter currency code (e.g. EUR) |
| `Quote` | `double` | No | FX rate: units of CounterCcy per unit of BaseCcy |

`FxRateMarketData` is not directly joined to other tables. Solutions read it by key at query time for currency conversion.

## Related pages

* [Database model](/solutions/enterprise-risk-suite/1.0/common/developer-guide/database/database-model.md)
* [Input file formats](/solutions/enterprise-risk-suite/1.0/common/reference/input-file-formats.md)
