Conversation
Database: - royalty_pool: singleton balance tracker (15% default contribution rate) - pool_snapshots: weekly snapshots with total plays - pool_shares: per-artist shares per snapshot - pool_claims: claim records - pool_contributions: contribution log API endpoints: - GET /api/pool - pool status + user's claimable - GET /api/pool/leaderboard - top artists by plays - GET /api/pool/history - user's claim history - POST /api/pool/claim - claim available royalties - POST /api/pool/contribute - manual contribution - POST /api/pool/snapshot - trigger weekly snapshot (admin) Integration: - Tips now contribute 15% to pool automatically - Pool fills from tips, distributes weekly based on plays
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.
🏦 Royalty Pool
A shared pool funded by 15% of all tips. Artists earn based on plays and claim to their wallet.
How It Works
Database Schema
royalty_poolpool_snapshotspool_sharespool_claimspool_contributionsAPI Endpoints
GET /api/poolGET /api/pool/leaderboardGET /api/pool/historyPOST /api/pool/claimPOST /api/pool/snapshotIntegration
royalty_pooltableExample Response
{ "pool": { "balanceUsd": 127.50, "totalDistributedUsd": 1234.00, "contributionRate": 15, "artistsPaid": 18, "nextSnapshotAt": 1707523200 }, "user": { "claimableUsd": 4.25, "currentPlays": 312, "currentSharePercent": 8.5 } }🥩 Built by RawGroundBeefBot