Developer documentation
These pages describe the Solana Sickle program for the developers who maintain it. Read them in order to learn the code base, then use the audit notes at the end of each layer page to plan the simplification and audit-preparation work.
How to read this
- Start with the dependency graph. It shows the six layers and how they depend on each other.
- Read the layer pages in order. Each page follows the same template and ends with a "Simplification and audit notes" section.
- Use the instruction pages as a reference while you read the handlers.
Every page follows the style guide. Write new pages the same way.
Layer pages
| # | Page | Covers |
|---|---|---|
| 1 | Entry points | lib.rs, the allocator, constants, feature flags, the full instruction table |
| 2 | Instruction handlers | The file-per-instruction layer, account struct conventions, dispatch styles |
| 3 | Shared runners | venue/ traits and runners that Orca and Raydium share |
| 4 | Venue adapters | venue/adapters/ trait implementations for the Orca and Raydium account structs |
| 5 | Venue bindings | Hand-written CPI builders and parsers for Orca, Raydium, Meteora, and Jupiter |
| 6 | Events and errors | Every event, every error, and who emits or returns them |
| 7 | State and settings | Every program account, its seeds and size, authorization methods, position settings |
| 8 | Keeper authorization | The two-transaction authorization flow, byte layouts, the finalizer proof |
| 9 | Fees | Fee actions, rounding, the charge helpers, fee-class selection |
| 10 | Off-chain | The TypeScript builder, the keeper, the management UI, and the test suites |
Audit notes
Simplification and audit notes: summary groups the 104 open notes from the layer pages into eight themes and lists the behaviors that need a decision before the refactor starts. Refer to a note by its visible stable ID, not by its ordered-list position.
Convention: cite the symbol, not the line measures
what a path:line convention costs a refactor and names the symbol instead.
Adopted on 2026-09-09; the rule itself is in STYLE.md section 6a.
Proposal: generate the public-item tables from source
sizes deriving the inventory tables from the compiler, keeping only the
Meaning column by hand. Not yet adopted, and it states what would falsify it.
Instruction pages
One page per instruction under instructions/. The first is orca_open_position. The rest follow the same template.
Status
| Date | Change |
|---|---|
| 2026-09-08 | Style guide, dependency graph, layer pages, first instruction page |
| 2026-09-09 | Layer 05 pass: 21 notes resolved, 4 added, page and summary updated |
| 2026-09-10 | Theme 7 pass: 4 items decided, 2 closed, 2 notes resolved |
| 2026-09-10 | Settings write/use parity: 3 notes resolved, no layout change |
| 2026-09-10 | Devnet program id declared in source; keys sync dropped |
| 2026-09-10 | Theme 7: third-party upgrade authority measured and recorded |
| 2026-09-16 | Aggregate on-chain review and Surfpool endpoint differential |
| 2026-09-16 | Ten authority handlers gain direct Anchor entrypoint unit coverage |
| 2026-09-16 | ATA provisioning and sweep custody constraints gain entrypoint tests |
| 2026-09-17 | Existing global-keeper updates gain direct entrypoint coverage |
| 2026-09-17 | Both intent-expiry families gain pure boundary and event tests |
| 2026-09-17 | Both intent-cancellation families gain entrypoint constraint tests |
| 2026-09-17 | Two state-close handlers gain entrypoint constraint tests |
| 2026-09-17 | Handler coverage is reclassified by behavior, not test-file location |
| 2026-09-17 | Raydium collect, harvest, and compound share five account composites |
| 2026-09-17 | Orca collect, harvest, and compound share five account composites |
| 2026-09-17 | Meteora drain handlers share fee and ledger stages |
| 2026-09-17 | Keeper drain ledger credit and rebalance settings stages are shared |
| 2026-09-17 | Decrease and close fee policies become compile-time invariants |
| 2026-09-17 | Owner rebalance derives settings presence from the account itself |
| 2026-09-17 | Both DLMM keeper marker slots gain isolated compile-fail proofs |