Skip to content

docs: add Phoenix collateral deposits and withdrawals - #255

Merged
buddies2705 merged 1 commit into
mainfrom
docs/phoenix-collateral
Aug 27, 2026
Merged

docs: add Phoenix collateral deposits and withdrawals#255
buddies2705 merged 1 commit into
mainfrom
docs/phoenix-collateral

Conversation

@buddies2705

Copy link
Copy Markdown
Contributor

Solana.PerpetualCollateralMovements is newly deployed — it was not in the schema when I introspected the Solana cubes earlier today. CollateralMovement.Type is Deposit or Withdraw, denominated in PhUsd, so this is the money-in / money-out view of Phoenix that nothing in the panel covered.

Added as both a query and a stream, under Perpetuals / Phoenix.

What changed from the query as supplied

The original returned 892 rows, unbounded and in no defined order. The saved version:

  • limit: {count: 25} with orderBy: {descending: Block_Time} — newest first, bounded
  • adds Block.Time and Transaction.Signature, so a reader can see when each movement happened and follow it on chain
  • keeps Trader, Signer, Amount, Currency, Fee, Type unchanged

The comment header shows how to filter one side (Type: {is: "Withdraw"}) or follow one account, and notes the obvious uses: net-flow dashboards, whale withdrawal alerts, and reconciling a trader's realised PnL against what they actually took off the venue.

Verification

Both were executed before saving and re-executed from the stored text afterwards — 25 rows for the query, and the subscription delivers on connect.

Values confirmed against live data rather than assumed: over a 400-row sample, Type is Deposit (267) and Withdraw (133), currency PhUsd throughout.

A bug this caught

The injection helper placed authored entries into whichever tab it was pointed at. Pointing it at a file containing both a query and a subscription put each of them in the wrong tab as well as the right one — the audit failed with the subscription sitting in the Queries tab, where it has no HTTP verdict.

The helper now matches entry kind to tab. Worth having: it means a mixed authored file can no longer land a stream in the query list.

State

734 query entries across 32 groups, 413 stream entries across 17.

All eleven gates pass, 0 non-ASCII comments across 1,142 queries, widest comment line 78 characters, production build clean.

🤖 Generated with Claude Code

Solana.PerpetualCollateralMovements is newly deployed -- it was not in the
schema when I introspected the Solana cubes earlier today. CollateralMovement
.Type is Deposit or Withdraw, denominated in PhUsd, so this is the money-in and
money-out view of Phoenix that nothing in the panel covered.

Adds it as a query and as a stream, both under Perpetuals / Phoenix.

The query as originally written returned 892 unbounded rows in no defined
order. The saved version takes 25 newest-first and carries Block.Time and the
transaction signature, so a reader can see when each movement happened and
follow it on chain. Trader, Signer, Amount, Currency and Fee are unchanged.

Both were executed before saving and re-executed from the stored text
afterwards: 25 rows for the query, and the subscription delivers on connect.

Also fixes the injection helper. It placed authored entries into whichever tab
it was pointed at, so pointing it at a file containing both a query and a
subscription put each of them in the wrong tab as well as the right one. It now
matches the entry kind to the tab, which is what caught this before it shipped.

734 query entries across 32 groups, 413 stream entries across 17.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@buddies2705
buddies2705 merged commit e0bc609 into main Aug 27, 2026
1 check passed
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