Skip to content

Adversary: every role holder is also a user - #193

Merged
mikemaccana merged 2 commits into
mainfrom
claude/adversary-role-holders
Sep 30, 2026
Merged

mikemaccana merged 2 commits into
mainfrom
claude/adversary-role-holders

Conversation

@mikemaccana

@mikemaccana mikemaccana commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

A new section in The Adversary, before What You Learnt. An operator, manager or admin can also call every public handler, from a wallet the program has no way to link to them. So for each role, the section asks what its handlers can change, and what that change is worth to someone who also trades, deposits or bets in the same program.

This PR was stacked on #190. It now targets main, and main has been merged in.

Examples, each naming the test that checks the defense:

  • The perpetual futures operator. She could have changed the funding rate while holding a position on the side that receives funding. The rate is now fixed at creation and capped (test_operator_on_the_lighter_side_earns_only_the_fixed_rate), from quicknode/solana-program-examples#172.
  • The managed fund's manager.
    • Assets only from Victor's list, and feeds only from Victor's entries (test_add_asset_rejects_unapproved).
    • Swaps only through the router fixed at creation, with minimums from the oracle.
    • A capped fee, fixed at creation (test_initialize_rejects_excessive_fee).
  • A role that reports a result, like the betting market's admin, points to Offchain Truth.

The chapter summary gains a matching bullet.

npm run lint, node scripts/check-figure-geometry.mjs and npm run build-pdf all pass. Every test named exists on the companion repo's main.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn

A new section before What You Learnt: an operator, manager or admin can also
call every public handler, from a wallet the program cannot link to them, so
each role's power has to be weighed against what it is worth to someone who
also trades. It uses the perps funding rate
(test_operator_on_the_lighter_side_earns_only_the_fixed_rate) and the managed
fund's limits on its manager (test_add_asset_rejects_unapproved,
test_initialize_rejects_excessive_fee) as examples, and points to Offchain Truth
for a role that reports a result. The summary gains a matching bullet.

Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
@mikemaccana
mikemaccana changed the base branch from claude/plain-wording-sweep to main September 30, 2026 23:16
@mikemaccana
mikemaccana merged commit 4da6823 into main Sep 30, 2026
1 check passed
@mikemaccana
mikemaccana deleted the claude/adversary-role-holders branch October 13, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant