Skip to content

add: Deepstate volume and trading fees adapters - #1

Open
0xHawreeth wants to merge 1 commit into
Deepstate-Protocol:masterfrom
0xHawreeth:master
Open

0xHawreeth wants to merge 1 commit into
Deepstate-Protocol:masterfrom
0xHawreeth:master

Conversation

@0xHawreeth

Copy link
Copy Markdown

Summary

Adds Deepstate V1 volume and trading fees adapters for Robinhood Chain.

Volume

  • Tracks matched volume from:
    • AskMatched
    • BidMatched
    • AsksMatched
    • BidsMatched
    • AskSubtreeMatched
    • BidSubtreeMatched
  • Uses raw settlement units directly.
  • Match-node quote reconstruction follows TickMath32 integer factor/shift arithmetic and DeepstateV1 rounding/correction semantics.
  • Subtree events use the exact emitted quoteAmount.
  • Historical books are discovered through BookInitialized events.

Fees

  • Tracks protocol execution fees transferred by DeepstateV1 to the configured fee recipient.
  • Covers USDG, NVDA and DEEP.
  • Excludes buyFees vault purchases.
  • Current on-chain fee configuration:
    • recipient: 0xbfb7b3Ff3D498a559b946B836d26F0E168f273D5
    • bps: 10 (0.1%)

Validation

Validated against live Robinhood Chain transactions and on-chain fee configuration.

Example matched fill:
0xc26a80dc3fdc6fc9ac7468f2f8adf4b8ee6d366bd1409275c9c50ddabc0c2b4

Gross NVDA output:
2.946942266691035 NVDA

Protocol fee:
0.002946942266691035 NVDA

Expected at 10 bps:
0.002946942266691035 NVDA

Contract observability note

The current DeepstateV1 deployment does not expose a dedicated protocol-fee event.

Protocol fees are therefore identified from ERC20 transfers emitted by DeepstateV1 to the configured fee recipient.

A dedicated event such as ProtocolFeePaid(token, recipient, amount) would make fee indexing more deterministic and auditable, especially for multi-token fees and routed fills.

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