Skip to content

Add soroban_daily_metrics rollup schema - #55

Merged
christabel888 merged 1 commit into
Stellar-Insightss:mainfrom
ndii-dev:issue-46-soroban-metrics-schema
Aug 28, 2026
Merged

Add soroban_daily_metrics rollup schema#55
christabel888 merged 1 commit into
Stellar-Insightss:mainfrom
ndii-dev:issue-46-soroban-metrics-schema

Conversation

@ndii-dev

Copy link
Copy Markdown

Closes #46

Adds migrations/032_create_soroban_metrics_timeseries.sql, a daily rollup
table (soroban_daily_metrics) keyed by (date, contract_id) with call
count, active-contract count, and total gas/resource cost, derived from the
raw contract_events table (migration 022) rather than duplicating it.

A network-wide row per day (contract_id = '__all__') carries the overall
active-contract count so #21's endpoint doesn't need a separate query shape
from #22's per-contract time series. total_gas_stroops is nullable since
contract_events doesn't yet carry a cost column (that's #23's job) --
historical rows will legitimately have no cost to roll up until that lands.

Daily rollup table backing the Soroban Dashboard endpoints (Stellar-Insightss#21-Stellar-Insightss#24):
call count, active contract count, and gas usage, derived from the raw
contract_events table rather than duplicating it.
@christabel888
christabel888 merged commit e338d25 into Stellar-Insightss:main Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Design and migrate time-series schema for soroban contract metrics

3 participants