docs: add event schema and Dune analytics guide#80
Draft
ryzen-xp wants to merge 1 commit into
Draft
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the event-emission documentation and Dune analytics guide called for in
the on-chain analytics task. No contract code is changed — this is docs-only.
What's in this PR
docs/dune-analytics.md(new, 560 lines)Complete reference for anyone building analytics on the Boundless contract:
(
stellar.history_contract_events,stellar.contract_data, etc.), columnlayout, ScVal auto-decoding rules.
with topic name, per-field ScVal type, and analytics notes:
EventCreated,EventCancelled,FundsAdded,ContributorRefunded,OwnerResidualRefundedApplied,ApplicationWithdrawn,Submitted,SubmissionWithdrawnWinnersSelected,WinnerPaid,MilestoneClaimedAdminUpdated,PendingAdminSet,FeeAccountUpdated,FeeBpsUpdated,ProfileContractUpdated,TokenRegistered,TokenDeregistered,Paused,UnpausedPendingUpgradeProposed,PendingUpgradeCancelled,UpgradeApplied,Upgraded(legacy alias),Migratedsemantics, Crowdfunding vs other pillars distinction.
.sqlfiles).Boundless On-chain Dune dashboard.
docs/dune-queries/(new, 10.sqlfiles)Each file is a standalone, paste-ready Dune query. All use
{{CONTRACT_ADDRESS}}as a Dune parameter so the same queries work on testnet and mainnet.
01_tvl_current.sql02_tvl_over_time.sql03_bounties_funded.sql04_total_payouts.sql05_unique_participants.sql06_event_outcomes.sql07_avg_size_and_ttp.sql08_payout_by_token.sql09_crowdfunding_contributions.sql10_event_created_decode_test.sqlAnalytics correctness notes
Every analytics-relevant event carries decodable
id/amount/asset/addressfields:idonEventCreated;event_idon all subsequent eventstotal_budget(create),amount(FundsAdded, WinnerPaid, MilestoneClaimed, refunds)tokenonEventCreated; join viaevent_idfor payout eventsowner,contributor,recipient,applicanton relevant eventsAll
amountfields in events are net-of-fee — the protocol fee is deductedbefore
remaining_escrowis credited. No fee adjustment is needed in SQL if therate changes.
Crowdfunding vs other pillars:
EventCreated.total_budgetis a funding goalfor Crowdfunding (escrow starts at 0). The TVL queries exclude it from creation
inflows and rely solely on
FundsAddedfor crowdfunding inflows.Stale field removed from docs
The
Appliedevent documentation previously listed acredit_cost: U32fieldcarried over from the pre-1.1.0 schema. Credits moved off-chain in the 1.1.0
upgrade; the field was dropped from the
Appliedstruct. This PR fixes the docto match the live contract:
Appliedcarries only{ event_id, applicant }.Acceptance criteria status
decodable (
id,amount,asset,address,topic)10_event_created_decode_test.sqldecodesEventCreatedfiltered to thecontract address and returns
id,pillar,owner,token,total_budget,titleto paste; dashboard URL will be added to
dune-analytics.mdonce published)