Skip to content

observability: show the liquidity inventory as per-chain Grafana tables [RAI-3098] - #1690

Open
JuaniRios wants to merge 1 commit into
rai-2998-board-headerfrom
rai-2998-board-inventory
Open

JuaniRios wants to merge 1 commit into
rai-2998-board-headerfrom
rai-2998-board-inventory

Conversation

@JuaniRios

@JuaniRios JuaniRios commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Part of RAI-3098.

The Dashboard tab's inventory becomes three Grafana tables: USD · Alpaca, USD · Onchain with a row per chain, and Equities with a column per chain. Item 6a of the RAI-2998 stack, part 4 of 6. Ported from #1654.

Live effect: the inventory on the Dashboard tab · Risk: low (read-only queries, a revert undoes it) · Ships: on merge, through the observability workflow

Why

Production hedges on Base and Robinhood, and the old tables show one chain. The tables also get column filters.

Decisions

  • Per-chain rows and columns read the bot-only series (liq_usdc_chain_*, liq_usdc_corridor_*, liq_equity_chain_available). On Source = exporter those are absent, and each falls back to the unlabelled Base series, as feat: SPA layout as Grafana tables on the liquidity board #1654 designed. The fallback is per source, not per row: while the bot publishes per-chain series, a chain without a labelled value shows none. gen-t0-liquidity.py
  • The Δ columns are gone, so the board no longer reads liq_equity_ratio_deviation or liq_usdc_ratio_deviation. That is why compare.py drops them (RAI-3034). I checked: no board query names them now.
  • Total, Total USD, Ratio, and the USD total stay primary chain plus Alpaca plus in flight. Wrapped shares on different chains are worth different underlyings, so they are not added. The table descriptions say so.
  • The Equities Ratio is green or red only where it matches the bot's band verdict. That needs the bot source, a symbol rebalanced on Base, a total above 0, the default Base target, a Base vault the bot read, and no other chain vault that holds the symbol. Every other ratio is grey with no verdict. That includes every symbol on the exporter source (the default until Stage 4), cause it cannot see the other chains. gen-t0-liquidity.py
  • A disabled flag dot is red, as in the SPA.
  • Trades and Rebalances only move to the 13/11 layout here. observability: open a detail dialog from each liquidity trade and rebalance row [RAI-3099] #1691 changes them.

Risks

  • A symbol with its own target_share is still judged against the default target when no other chain vault holds it. Only DNUT overrides it today. DNUT is multi-chain, so it is grey while another chain vault holds DNUT, but it gets a wrong verdict if those vaults are empty.

Proof

  • gen-t0-liquidity.py --check passes. The panel heights are feat: SPA layout as Grafana tables on the liquidity board #1654's, checked on its preview board for windows of 18 to 45 rows.
  • A generator self-check, run in CI through --check, pins which colour each bar cell draws. gen-t0-liquidity.py
  • Review traced every or fallback on both sources. Each side goes through max by (venue) or max by (symbol, col), so no duplicate rows.
  • Not verified: the per-chain rows with real bot data. Needs the bot release on staging.

Merge conditions

Same as the stack below. The board deploys on merge to master through the observability workflow, not with a bot release. That is safe before the bot releases: Source defaults to exporter, so the published board reads the same series as today. The Equities Ratio bars show grey on that source.

@linear-code

linear-code Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

RAI-2998

RAI-3062

RAI-3098

JuaniRios commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label add-to-gt-merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@JuaniRios

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: 1434d276-8ff5-4e9d-abb9-843872f825fe

📥 Commits

Reviewing files that changed from the base of the PR and between 843a766 and 4a90bfb.


📒 Files selected for processing (3)
  • observability/README.md
  • observability/dashboards/liquidity/t0-liquidity.json
  • observability/gen-t0-liquidity.py

Included review availability: This review used your included allowance. 5 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour.



Walkthrough

The Dashboard tab replaces its former inventory views with Alpaca USD, on-chain USD by chain, and equities tables. The generator adds table rendering, percentage-bar, and status-flag helpers. The main dashboard updates its inventory queries, field formatting, and layout. The README documents chain-labelled metric availability and panel-height guidance. The Logs, Orders, Performance, and PnL tab dashboards receive sequential panel ID changes.

Priority: ⬇️ Low

Merge Risk: 🟡 Moderate · up to 4a90b

Equities Total USD can misstate holdings when a symbol has broker shares and its wrapper ratio differs from one. Correct the valuation before merging unless that discrepancy is explicitly accepted.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 64.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 1 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: showing the liquidity inventory as per-chain Grafana tables.
Description check Passed The description directly explains the dashboard table changes, query behavior, risks, validation, and deployment conditions.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

Full details: Docstring Coverage

Explanation

Docstring coverage is 64.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 1 files. (2 skipped: 2 unsupported.)



  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR


  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@JuaniRios
JuaniRios marked this pull request as ready for review October 8, 2026 23:56
@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Comments resolved and changes approved.

@JuaniRios
JuaniRios force-pushed the rai-2998-board-header branch from 34aa195 to 81cb2d2 Compare October 10, 2026 01:15
@JuaniRios
JuaniRios force-pushed the rai-2998-board-inventory branch 2 times, most recently from 372a865 to f8aa8c6 Compare October 10, 2026 01:58
@JuaniRios
JuaniRios force-pushed the rai-2998-board-header branch 2 times, most recently from 7829221 to e053b94 Compare October 10, 2026 02:39
@JuaniRios
JuaniRios force-pushed the rai-2998-board-inventory branch 2 times, most recently from 4d0d5f8 to de89581 Compare October 10, 2026 03:14
@JuaniRios
JuaniRios force-pushed the rai-2998-board-header branch from e053b94 to 23f1f68 Compare October 10, 2026 03:14
@JuaniRios
JuaniRios force-pushed the rai-2998-board-header branch from 23f1f68 to 8a30d42 Compare October 10, 2026 04:11
@JuaniRios
JuaniRios force-pushed the rai-2998-board-inventory branch from de89581 to 150fc94 Compare October 10, 2026 04:12
This was referenced Oct 10, 2026

This branch has not been deployed

No deployments
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.

1 participant