-
Notifications
You must be signed in to change notification settings - Fork 25
sql mod #106
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: testnet
Are you sure you want to change the base?
sql mod #106
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,8 +1,14 @@ | ||||
| -- Boundless On-chain: Unique builder and organizer wallets | ||||
| -- Panel type: counter (two rows: builders, organizers) | ||||
| -- | ||||
| -- Decoding: event name is topics_decoded '$[0].symbol'; addresses are read | ||||
| -- from the data_decoded '$.map' as '$.address'. See 10_event_created_decode_test.sql. | ||||
| -- Builders participate through one of three on-chain footprints: | ||||
| -- applied (Bounty — gated apply) | ||||
| -- submitted (Hackathon — open submission, no prior apply) | ||||
| -- winner_paid / milestone_claimed (received a payout on any pillar) | ||||
| -- Counting only 'applied' would miss every hackathon entrant, since that | ||||
| -- pillar's participants submit without applying. | ||||
| -- Decoding: event name is snake_case; addresses read as '$.address'. | ||||
| -- See 10_event_created_decode_test.sql. | ||||
|
|
||||
| WITH ev AS ( | ||||
| SELECT | ||||
|
|
@@ -17,18 +23,18 @@ WITH ev AS ( | |||
| WHERE contract_id = '{{CONTRACT_ADDRESS}}' | ||||
| AND closed_at_date >= DATE '{{START_DATE}}' | ||||
| AND JSON_EXTRACT_SCALAR(topics_decoded, '$[0].symbol') | ||||
| IN ('Applied', 'WinnerPaid', 'MilestoneClaimed', 'EventCreated') | ||||
| IN ('applied', 'submitted', 'winner_paid', 'milestone_claimed', 'event_created') | ||||
| ) | ||||
| -- Builders: applied to or received a payout from any event | ||||
| -- Builders: applied to, submitted to, or received a payout from any event | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Remove the redundant builders banner. It restates the following Proposed fix--- Builders: applied to, submitted to, or received a payout from any event
SELECTAs per coding guidelines, “Comment sparingly” and “Do not narrate code behavior.” 📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Coding guidelines |
||||
| SELECT | ||||
| 'builders' AS role, | ||||
| COUNT(DISTINCT addr) AS unique_wallets | ||||
| FROM ( | ||||
| SELECT JSON_EXTRACT_SCALAR(f['applicant'], '$.address') AS addr | ||||
| FROM ev WHERE ev_name = 'Applied' | ||||
| FROM ev WHERE ev_name IN ('applied', 'submitted') | ||||
| UNION | ||||
| SELECT JSON_EXTRACT_SCALAR(f['recipient'], '$.address') | ||||
| FROM ev WHERE ev_name IN ('WinnerPaid', 'MilestoneClaimed') | ||||
| FROM ev WHERE ev_name IN ('winner_paid', 'milestone_claimed') | ||||
| ) t | ||||
|
|
||||
| UNION ALL | ||||
|
|
@@ -38,4 +44,4 @@ SELECT | |||
| 'organizers' AS role, | ||||
| COUNT(DISTINCT JSON_EXTRACT_SCALAR(f['owner'], '$.address')) AS unique_wallets | ||||
| FROM ev | ||||
| WHERE ev_name = 'EventCreated' | ||||
| WHERE ev_name = 'event_created' | ||||
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.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Describe this as snake_case conversion, not lowercasing.
Lowercasing
EventCreatedyieldseventcreated; the underscore requires snake_case conversion.docs/dune-queries/01_tvl_current.sql#L6-L7: replace “lowercases the struct name” with “converts the struct name to snake_case.”docs/dune-queries/10_event_created_decode_test.sql#L6-L8: make the same wording correction.📍 Affects 2 files
docs/dune-queries/01_tvl_current.sql#L6-L7(this comment)docs/dune-queries/10_event_created_decode_test.sql#L6-L8🤖 Prompt for AI Agents