Source map
Find each responsibility in the checkout and distinguish architectural sources.
Protocol paths are relative to grapl-io/grapl. The documentation lives separately in grapl-io/docs.
| Path | Responsibility |
|---|---|
Cargo.toml | The single package grapl-amm, with optional integration/test features |
programs/grapl-amm/src/math/ | Integer arithmetic, tick prices, ranges, swap steps, fees |
programs/grapl-amm/HOOK_FRAMEWORK.md | Shared rich-context and state-permission contract |
programs/grapl-amm/src/hooks/abi/ | Typed callback/reply ABI, context and bounded account declarations |
programs/grapl-amm/src/hooks/ | Core callback construction and dispatch |
programs/grapl-amm/src/instructions/ | Pool, positions, trading, and fee operations |
programs/grapl-amm/src/state/ | Pool, curve state, positions, and paginated tick storage |
programs/grapl-amm/src/settlement/ | Validated token accounts and token movement |
examples/hooks/shared/ | Pure dynamic-fee, trading-window, and Merkle allowlist policies |
examples/hooks/dynamic-fee/ | Independently deployable dynamic-fee demonstration |
examples/hooks/decaying-fee/ | Optional 99%-to-floor linear launch-fee schedule |
examples/hooks/timelock/ | Independently deployable trading-window demonstration |
examples/hooks/allowlist/ | Independently deployable allowlist demonstration |
examples/hooks/lifecycle/ | Ten-phase callback and rejection example |
examples/hooks/rewards/ | Optional composed RewardCredits rule and runtime |
integrations/metis/ | Optional integration under feature metis |
integrations/analytics/ | Host-only valuation, observed fee APR, and projected APY under feature analytics |
examples/client-inputs/src/ | TypeScript client utilities |
tests/math/, tests/invariants/ | Math and independent numerical verification |
tests/metis/, tests/svm/ | Quote contracts and isolated runtime fixtures |
tests/analytics/ | Synthetic fee-performance calculation fixtures |
Makefile | Setup, checks, SBF builds, and local runtime |
Anchor.toml | Anchor local program configuration |
Use the matching exported types and IDL when constructing accounts or decoding state.
Expanded market operations
| Source | Responsibility |
|---|---|
programs/grapl-amm/src/instructions/tokens/ | Independent classic SPL token factory |
programs/grapl-amm/src/instructions/curve/ | Inventory-backed curve initialization, swaps, graduation, and remainders |
programs/grapl-amm/src/instructions/zaps/ | Atomic swap and position composition |
programs/grapl-amm/src/instructions/trading/exact_out.rs | Exact net-output entrypoint |
programs/grapl-amm/src/math/curve.rs | Pure virtual-reserve equations |
Documentation pages are in content/docs/ at the root of the documentation repository.