ACCUM creator fees: Bankr readings, claim evidence and reconciliation - #92
Merged
Merged
Conversation
A fee source (migration 025) ties a token's creator fees to one of the operator's wallets, with the pool, fee contract and fee asset Bankr reported when it was added. - Bankr's public data (no key) is read hourly and kept as "reported by Bankr", including failed reads, so Luca can say when it last heard from Bankr and why the latest read failed. If Bankr ever reports a different pool, fee contract, fee token or wallet, the readings stop until an admin checks it. - Each BNKR transfer into the fee wallet is checked against its receipt before it is labeled. It becomes revenue tied to the source only when it comes from the fee contract, or the fee contract recorded this pool, and nothing ties it to another pool. When the fee contract is involved but the evidence is not enough it stays unknown. Anything else is labeled as usual. Until its receipt is read, the transfer waits unlabeled; the model never labels it. - Two tokens named ACCUM pay the same wallet through the same fee contract: with several sources, only a transaction naming exactly one of their pools counts. - Status: reported claimable/claimed, the change in claimable between readings (not called "earned"), verified on-chain claims from exact integer amounts, and whether Bankr's claimed figure matches the chain (a mismatch is shown, not hidden). - node dist/scripts/fee-source.js add|status for the admin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KqcPsn2HCGWiE2FTmHKYEQ
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
6 tasks
This branch was successfully deployed
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.
What changed
ACCUM PR 2 of 3: fee accounting. The Telegram answers and the on-demand machine report come in PR 3.
fee_sources: token, pool id, fee contract, fee asset and wallet, scoped to one user.fee_source_readings: what Bankr reported, hourly, including failed reads.fee_claim_checks: the receipt evidence for each BNKR transfer into the fee wallet.classifications.fee_source_idsrc/fees/bankr.ts):src/fees/sources.ts): the worker reads Bankr hourly.src/fees/claims.ts): each cycle, before classification, every BNKR transfer into the fee wallet is checked against its receipt.revenuetied to the source. The transfer came from the fee contract, or the fee contract logged this pool in the same transaction, and nothing ties it to another pool.unknown. The fee contract is involved, but the evidence doesn't tie the transfer to this pool alone.feeSourceStatus):node dist/scripts/fee-source.js add 0xWallet 0xToken | status, for the admin on the server.Not in this PR:
Why
This is the approved ACCUM experiment: Luca accounts for the $ACCUM → Bankr creator fees (BNKR) → Luca wallet loop. It follows the three approved refinements:
How it was verified
npm run lintandnpm run typecheckpassLUCA_INTEGRATION=1 npx vitest runpasses: 55 files, 527 teststests/fees/bankr.test.ts:tests/fees/claims.test.tscovers every verdict:tests/integration/fee-sources.test.ts:addstored pool 0xf50f…ea37eb, fee contract 0x9982…fdbb, BNKR;statusshowed claimable 2,742,866.01 BNKR, 0 claimed and a match.Checklist
user_id.Deploy:
cd /opt/luca && git pull && npm ci && bun run buildluca-api luca-worker luca-telegram.node dist/scripts/fee-source.js add 0xb54081ff3f6a90a5a1057d8a5537f7f14e376fdb 0x70aEb20cD233e044bB7676C34105712132F49Ba3🤖 Generated with Claude Code
https://claude.ai/code/session_01KqcPsn2HCGWiE2FTmHKYEQ
Generated by Claude Code