Sickle Sol

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

  1. Start with the dependency graph. It shows the six layers and how they depend on each other.
  2. Read the layer pages in order. Each page follows the same template and ends with a "Simplification and audit notes" section.
  3. 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

#PageCovers
1Entry pointslib.rs, the allocator, constants, feature flags, the full instruction table
2Instruction handlersThe file-per-instruction layer, account struct conventions, dispatch styles
3Shared runnersvenue/ traits and runners that Orca and Raydium share
4Venue adaptersvenue/adapters/ trait implementations for the Orca and Raydium account structs
5Venue bindingsHand-written CPI builders and parsers for Orca, Raydium, Meteora, and Jupiter
6Events and errorsEvery event, every error, and who emits or returns them
7State and settingsEvery program account, its seeds and size, authorization methods, position settings
8Keeper authorizationThe two-transaction authorization flow, byte layouts, the finalizer proof
9FeesFee actions, rounding, the charge helpers, fee-class selection
10Off-chainThe 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

DateChange
2026-09-08Style guide, dependency graph, layer pages, first instruction page
2026-09-09Layer 05 pass: 21 notes resolved, 4 added, page and summary updated
2026-09-10Theme 7 pass: 4 items decided, 2 closed, 2 notes resolved
2026-09-10Settings write/use parity: 3 notes resolved, no layout change
2026-09-10Devnet program id declared in source; keys sync dropped
2026-09-10Theme 7: third-party upgrade authority measured and recorded
2026-09-16Aggregate on-chain review and Surfpool endpoint differential
2026-09-16Ten authority handlers gain direct Anchor entrypoint unit coverage
2026-09-16ATA provisioning and sweep custody constraints gain entrypoint tests
2026-09-17Existing global-keeper updates gain direct entrypoint coverage
2026-09-17Both intent-expiry families gain pure boundary and event tests
2026-09-17Both intent-cancellation families gain entrypoint constraint tests
2026-09-17Two state-close handlers gain entrypoint constraint tests
2026-09-17Handler coverage is reclassified by behavior, not test-file location
2026-09-17Raydium collect, harvest, and compound share five account composites
2026-09-17Orca collect, harvest, and compound share five account composites
2026-09-17Meteora drain handlers share fee and ledger stages
2026-09-17Keeper drain ledger credit and rebalance settings stages are shared
2026-09-17Decrease and close fee policies become compile-time invariants
2026-09-17Owner rebalance derives settings presence from the account itself
2026-09-17Both DLMM keeper marker slots gain isolated compile-fail proofs

Source: docs/dev/README.md in vfat-io/sickle-programs, vendored here by its sync workflow. Edit the markdown there; this page is rebuilt from it on deploy.