-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: add toroperp broker deposits on Orderly Network (SEI) #9124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add spell to track deposit volume for toroperp broker on Orderly Network. Filters deposits by broker hash from the Orderly Vault contract on SEI chain. - toroperp_sei_deposits: incremental model filtering by broker hash - toroperp_deposits: cross-chain aggregation view 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
PR SummaryAdds SEI toroperp deposit model that decodes Orderly Vault deposits filtered by broker hash, plus a cross-chain aggregation view.
Written by Cursor Bugbot for commit a8ff39c. Configure here. |
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment @cursor review or bugbot run to trigger another review on this PR
| file_format = 'delta', | ||
| incremental_strategy = 'merge', | ||
| unique_key = ['block_date', 'tx_hash', 'evt_index'], | ||
| incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Incremental merge key may duplicate on reorgs
The incremental unique_key includes block_date alongside tx_hash/evt_index. If block_time (and therefore block_date) changes due to chain reorgs/backfills, the same log can be inserted again under a new key instead of being updated, creating duplicates.
| WHERE | ||
| -- Filter only deposit function calls (selector: 0x322dda6d) | ||
| varbinary_substring(d.tx_input_data, 1, 4) = 0x322dda6d | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Broker hash extraction assumes direct vault calls
broker_hash is extracted from top-level transactions.data and filtered by the deposit selector. If AccountDepositTo events are emitted via internal calls (e.g., a router/proxy transaction where t.data is not the vault deposit calldata), the model can silently drop valid toroperp deposits and undercount volume.
Summary
Files Added
toroperp_sei_deposits.sql- Incremental model filtering deposits by broker hashtoroperp_sei_schema.yml- Schema documentation and data teststoroperp_deposits.sql- Cross-chain aggregation viewtoroperp_schema.yml- Top-level schemaTechnical Details
0x816f722424B49Cf1275cc86DA9840Fbd5a6167e90x18749138d2f6349916b7fbdc3a498a292169a4e698b2f3d66c8bb3f4249098ceAccountDepositToevents and filters by broker hash from transaction input dataTest Plan
🤖 Generated with Claude Code