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

# Soroban Core Metrics

> Reference documentation for the Soroban Core Metrics table in Hubble's Gold data dictionary.

## Table Metadata

| Property | Configuration |
| - | - |
| Natural Key(s) | transaction\_hash, metric\_key |
| Partition Field(s) | closed\_at (DAY partition) |
| Clustered Field(s) | contract\_id |
| Documentation | [dbt docs](http://www.stellar-dbt-docs.com/#!/model/model.stellar_dbt_public.soroban_core_metrics) |

Denormalized Soroban host-emitted `core_metrics` diagnostic events extracted from `history_contract_events` and joined to the root contract from each transaction's `invoke_host_function` operation. One row per `(transaction_hash, metric_key)`.

The Soroban host emits 19 `core_metrics` events at the end of every transaction summarizing the resources consumed by the invocation: CPU instructions, memory bytes, ledger entries read/written, event emission, invocation time, and per-category read/write/key/code byte counters. These events live inside JSON columns (`topics_decoded`, `data_decoded`) on `history_contract_events`, which makes them expensive to query at scale — this mart exposes them as pre-extracted INT64 columns instead.

Includes both successful and failed Soroban transactions, since the host emits `core_metrics` regardless of outcome and fees are charged on failed invocations. Backfilled from 2024-02-20 (Soroban launch).

## Column Details

| Name | Description | Data Type | Domain Values | Required? | Notes |
| - | - | - | - | - | - |
| closed\_at | Timestamp in UTC when the ledger that included this transaction was closed by the Stellar network. | TIMESTAMP | | Yes | Partition Field. |
| ledger\_sequence | Sequence number of the ledger that included this transaction. | INTEGER | | Yes | Allows ledger-grain analysis, e.g. aggregating `metric_value` per ledger to compute per-ledger resource utilization against the protocol's ledger-level limits. |
| transaction\_hash | Hex hash of the Soroban transaction that produced this metric. | STRING | | Yes | Combined with `metric_key`, forms the table's unique grain (one row per metric per transaction). |
| contract\_id | The Soroban smart contract address (strkey `C...`) invoked at the root of this transaction's `invoke_host_function` operation. | STRING | | No | Cluster Field. Reflects the contract the user's wallet directly called — *not* contracts called internally via cross-contract invocation. Null when the transaction has no `invoke_host_function` op with a populated root contract, i.e. `invoke_host_function` with sub-type `upload_wasm`, or transactions whose only Soroban ops are `extend_footprint_ttl` / `restore_footprint`. These rows are retained so per-metric `COUNT(*)` and `SUM(metric_value)` totals match the raw `history_contract_events` source row-for-row. |
| metric\_key | Symbol from `topics_decoded[1].symbol` on the host-emitted `core_metrics` diagnostic event. | STRING | <ul><li>cpu\_insn - CPU instructions consumed</li><li>mem\_byte - Memory bytes allocated during invocation</li><li>invoke\_time\_nsecs - Invocation time in nanoseconds</li><li>read\_entry / write\_entry - Count of ledger entries read or written</li><li>ledger\_read\_byte / ledger\_write\_byte - Total bytes read/written to ledger</li><li>read\_data\_byte / write\_data\_byte - Bytes read/written specifically to `ContractData` entries</li><li>read\_code\_byte / write\_code\_byte - Bytes read/written to `ContractCode` entries</li><li>read\_key\_byte / write\_key\_byte - Bytes read/written for ledger entry keys</li><li>max\_rw\_data\_byte / max\_rw\_code\_byte / max\_rw\_key\_byte - Resource limit caps per byte counter at execution</li><li>emit\_event - Count of contract-emitted events</li><li>emit\_event\_byte - Total bytes of contract-emitted events</li><li>max\_emit\_event\_byte - Resource limit cap for event byte size</li></ul> | Yes | One of 19 values the Soroban host emits per transaction. |
| metric\_value | The u64 value of the corresponding `metric_key`, extracted from `data_decoded.u64` and cast to INT64. | INTEGER | | Yes | Always non-null and non-negative. Semantic interpretation depends on `metric_key`: a count for entry/event metrics, a byte total for byte metrics, a nanosecond duration for `invoke_time_nsecs`, or the protocol-level resource limit for `max_*` metrics. |
| airflow\_start\_ts | Timestamp when the Airflow DAG run started. | STRING | | No | Used for pipeline metadata and debugging. |
