# learn.sol > learn.sol is the onboarding and education layer for Solana: structured modules, coding challenges, and guided tools for builders learning the full stack. The public curriculum is readable without an account. Follow the Markdown links below for focused lessons and exercises. ## Curriculum - [Curriculum home](https://www.learnsol.site/learn): Browse the complete Learn Solana curriculum. - [Full curriculum](https://www.learnsol.site/llms-full.txt): Read all curriculum content as one Markdown document. - [Markdown lesson index](https://www.learnsol.site/learn.mdx): Access the curriculum's Markdown entry point. - [Anchor Core Concepts](https://www.learnsol.site/learn/anchor-programs/anchor-core-concepts.mdx): Learn the Anchor model clearly: instructions, accounts, signers, and constraints, and how those pieces control what your program is allowed to do. - [Anchor Development Ergonomics](https://www.learnsol.site/learn/anchor-programs/anchor-ergonomics.mdx): Learn how to keep Anchor programs readable and trustworthy with stronger constraints, clearer errors, thinner handlers, better events, and a more disciplined testing strategy. - [Anchor Local Setup](https://www.learnsol.site/learn/anchor-programs/anchor-local-setup.mdx): Install the current Anchor toolchain, create a workspace, and get to one clean local build-and-test loop before writing program logic. - [Anchor Program Anatomy](https://www.learnsol.site/learn/anchor-programs/anchor-program-anatomy.mdx): Understand what each file in an Anchor workspace does, how build artifacts are generated, and how a client call becomes an on-chain state change. - [Cross-Program Invocations](https://www.learnsol.site/learn/anchor-programs/cpi-cross-program.mdx): Learn how one Anchor program calls another program safely, how to build a CpiContext, and how PDA signer seeds change the authority model. - [DeFi Integration Capstone](https://www.learnsol.site/learn/anchor-programs/defi-integration-challenge.mdx): Build one optional Anchor capstone that routes token settlement through a program-controlled vault, enforces a clear authority model, and proves the full flow with failure-path tests. - [Escrow with a PDA Vault](https://www.learnsol.site/learn/anchor-programs/escrow-mechanism-project.mdx): Build one guided escrow project in Anchor using PDA state, a vault authority PDA, token CPI, and explicit state transitions that cannot be bypassed. - [First Anchor Program](https://www.learnsol.site/learn/anchor-programs/first-anchor-program.mdx): Build a small counter program in Anchor one step at a time, understand every account in the instruction context, and verify the behavior with tests. - [Anchor Programs](https://www.learnsol.site/learn/anchor-programs.mdx): Learn how to build Solana programs with Anchor, from your first workspace and account model to PDAs, token flows, CPI, and production-minded patterns. - [PDAs and Seed Derivation](https://www.learnsol.site/learn/anchor-programs/pda-seed-derivation.mdx): Learn how Anchor uses seeds and bumps to derive deterministic program-controlled addresses, and how to design PDA state safely. - [SPL Token Integration with Anchor](https://www.learnsol.site/learn/anchor-programs/spl-token-integration.mdx): Learn how Anchor works with token mints, token accounts, and token CPIs using the modern token_interface types for Token and Token-2022. - [Token Minting and Supply Control](https://www.learnsol.site/learn/anchor-programs/token-minting-project.mdx): Build one Anchor token project step by step using a PDA mint authority, a config account, and on-chain supply rules that the client cannot bypass. - [Collections and String Handling Practice](https://www.learnsol.site/learn/rust-foundations/collections-and-string-handling-practice.mdx): Practice vectors, hash maps, strings, and parsing by building one transaction log analyzer in Rust. - [Collections and String Handling in Rust](https://www.learnsol.site/learn/rust-foundations/collections-and-string-handling.mdx): Learn when to use vectors, hash maps, strings, and string slices so you can store, search, and transform data cleanly in Rust programs. - [Enums and Pattern Matching Practice](https://www.learnsol.site/learn/rust-foundations/enums-and-pattern-matching-practice.mdx): Practice enums and pattern matching through a small wallet manager exercise that models account state, transaction state, and fallible actions explicitly. - [Enums and Pattern Matching in Rust](https://www.learnsol.site/learn/rust-foundations/enums-and-pattern-matching.mdx): Learn how Rust enums model mutually exclusive states and how match, if let, Option, and Result help you handle those states explicitly. - [Rust for Solana](https://www.learnsol.site/learn/rust-foundations.mdx): Rust Foundations teaches the Rust fundamentals you need before Solana programs stop looking intimidating: ownership, structs, enums, collections, and guided practice. - [Ownership and Borrowing Practice](https://www.learnsol.site/learn/rust-foundations/ownership-and-borrowing-practice.mdx): Practice Rust ownership with three focused exercises that make you distinguish copying, moving, immutable borrowing, mutable borrowing, and when cloning is actually necessary. - [Understanding Rust Ownership and Borrowing](https://www.learnsol.site/learn/rust-foundations/ownership-and-borrowing.mdx): Learn the ownership rule that makes Rust feel different: one owner for a value, borrowing through references, and the compiler checks that prevent invalid memory access. - [Rust Setup and Core Syntax](https://www.learnsol.site/learn/rust-foundations/rust-setup-and-core-syntax.mdx): Install the Rust toolchain, create your first Cargo project, and learn the variables, functions, types, and control flow that later Solana lessons depend on. - [Rust Syntax Practice](https://www.learnsol.site/learn/rust-foundations/rust-syntax-practice.mdx): Practice core Rust syntax with three focused exercises that force you to use variables, functions, control flow, loops, and basic input handling without guessing. - [Struct and Method Practice](https://www.learnsol.site/learn/rust-foundations/structs-and-methods-practice.mdx): Practice Rust by designing small types, adding methods, and choosing the right receiver: `&self`, `&mut self`, or `self`. - [Structs and Methods in Rust](https://www.learnsol.site/learn/rust-foundations/structs-and-methods.mdx): Learn how Rust structs model related data and how methods attach behavior to that data, using small account-style examples that prepare you for Solana program code. - [Wallet Ledger Build](https://www.learnsol.site/learn/rust-foundations/wallet-ledger-build.mdx): Combine ownership, structs, methods, and basic CLI input in one guided wallet ledger build before moving deeper into the curriculum. - [Working with Solana Accounts and Lamports](https://www.learnsol.site/learn/solana-foundations/accounts-lamports-exercise.mdx): Create two wallets, fund one, transfer SOL between them, inspect the receiving account, and understand what lamports and rent actually mean. - [Devnet Investigation Challenge](https://www.learnsol.site/learn/solana-foundations/basic-exploration-challenge.mdx): Use your Solana foundations toolkit to inspect real accounts, send a real transfer on devnet, and write down what changed before and after the transaction. - [Solana Development Environment Setup](https://www.learnsol.site/learn/solana-foundations/devnet-setup.mdx): Set up the Solana CLI the right way, create a wallet, switch to devnet, fund it, and verify your machine is ready for the rest of the course. - [Solana Fundamentals](https://www.learnsol.site/learn/solana-foundations.mdx): Solana Foundations teaches the core mental model for Solana: wallets, accounts, transactions, network architecture, and your first modern client toolkit with @solana/kit. - [Build a Solana Devnet Toolkit with Kit](https://www.learnsol.site/learn/solana-foundations/program-interaction-project.mdx): Build a small TypeScript CLI with @solana/kit to read balances, inspect accounts, and send SOL on devnet using the modern Solana client stack. - [How Solana Stays Fast](https://www.learnsol.site/learn/solana-foundations/solana-architecture.mdx): Understand how Solana orders, executes, and propagates transactions through validators, leaders, Proof of History, Sealevel, Gulf Stream, and Turbine. - [Understanding Solana Transactions](https://www.learnsol.site/learn/solana-foundations/transaction-anatomy.mdx): Use one simple SOL transfer to understand what a Solana transaction contains, why signers and recent blockhashes matter, and how a transaction moves through the network. - [Anchor Client Patterns with Kit](https://www.learnsol.site/learn/solana-kit-clients/anchor-client-with-kit.mdx): Build one real program action flow by keeping instruction building in a service layer and transport in the shared client pipeline. - [Client Testing Strategy: Lite Unit and Integration](https://www.learnsol.site/learn/solana-kit-clients/client-testing-strategy-lite-unit-and-integration.mdx): Test Solana client code at the right layers: pure logic first, UI behavior second, and one meaningful integration path on top of the shared runtime. - [Frontend Transaction UX: Status, Errors, Recovery](https://www.learnsol.site/learn/solana-kit-clients/frontend-transaction-ux-status-errors-recovery.mdx): Wrap a real kit-based send flow in a strict UI state machine so users always know what happened and what to do next. - [Solana Kit Clients](https://www.learnsol.site/learn/solana-kit-clients.mdx): Learn the modern Solana client stack with @solana/client, @solana/react-hooks, and @solana/kit so your frontend reads state, manages wallet sessions, and sends transactions cleanly. - [Kit Foundations](https://www.learnsol.site/learn/solana-kit-clients/kit-foundations.mdx): Set up one shared Solana client runtime so your app reads state, manages wallet sessions, and sends transactions without duplicating transport logic. - [Mini Capstone: Kit Client for an Anchor Program](https://www.learnsol.site/learn/solana-kit-clients/mini-capstone-kit-client-for-anchor-program.mdx): Ship one real client slice: connect a wallet, read state, send a real transaction, submit a real program action, and verify the outcome. - [RPC Reads and Account Decoding with Kit](https://www.learnsol.site/learn/solana-kit-clients/rpc-reads-and-account-decoding-with-kit.mdx): Fetch accounts safely with @solana/kit, normalize the result for UI code, and decode account data only after you know what you fetched. - [Send, Confirm, Retry and Lifetime Management](https://www.learnsol.site/learn/solana-kit-clients/send-confirm-retry-and-lifetime-management.mdx): Send a signed transaction the right way, separate sending from confirmation, and retry only when rebuilding is actually safe. - [SPL Token and Token-2022 Client Flows](https://www.learnsol.site/learn/solana-kit-clients/spl-token-and-token-2022-client-flows.mdx): Build token transfer plans with explicit program selection, real instruction builders, and validation that happens before the wallet prompt. - [Transaction Message Building and Signers](https://www.learnsol.site/learn/solana-kit-clients/transaction-message-building-and-signers.mdx): Build one transaction message in the correct order, understand who really signs it, and see why message mutation after signing is invalid. - [Wallet Standard Connection Flow](https://www.learnsol.site/learn/solana-kit-clients/wallet-standard-connection-flow.mdx): Build a wallet connection panel that reflects the real session state, offers the right connectors, and never lies about connection status. - [Challenge 1 - Constant Product Invariant](https://www.learnsol.site/learn/challenges/cpmm/1.mdx): Implement the core constant-product invariant used by CPMMs and verify that reserves produce the expected k value. - [Challenge 10 - Invariant Does Not Decrease](https://www.learnsol.site/learn/challenges/cpmm/10.mdx): Verify that the post-swap reserve state does not decrease the pool invariant when fees are applied. - [Challenge 11 - Initial LP Supply](https://www.learnsol.site/learn/challenges/cpmm/11.mdx): Compute the initial LP token supply for a brand new pool using the integer square root of the reserve product. - [Challenge 12 - Proportional Deposit Quote](https://www.learnsol.site/learn/challenges/cpmm/12.mdx): Given an X token deposit, compute how much Y must also be deposited to keep the pool price unchanged. - [Challenge 13 - LP Shares Minted On Deposit](https://www.learnsol.site/learn/challenges/cpmm/13.mdx): Mint LP shares for a proportional deposit based on the existing total LP supply and reserve balances. - [Challenge 14 - Withdraw Amounts From LP Burn](https://www.learnsol.site/learn/challenges/cpmm/14.mdx): Given LP shares being burned, compute the proportional X and Y amounts the liquidity provider should receive. - [Challenge 15 - Reject Unbalanced Deposit](https://www.learnsol.site/learn/challenges/cpmm/15.mdx): Check whether a proposed liquidity deposit is proportional to the current pool reserves. - [Challenge 16 - Checked Product Helper](https://www.learnsol.site/learn/challenges/cpmm/16.mdx): Build a safe multiplication helper that returns an error instead of silently overflowing. - [Challenge 17 - Conservative Quote Rounding](https://www.learnsol.site/learn/challenges/cpmm/17.mdx): Round a quoted output amount down to the nearest whole token unit so the pool never pays out too much. - [Challenge 18 - Pause State Guard](https://www.learnsol.site/learn/challenges/cpmm/18.mdx): Reject swaps when the pool is paused and allow them only when the pool is active. - [Challenge 19 - Authority Match Check](https://www.learnsol.site/learn/challenges/cpmm/19.mdx): Validate that the caller matches the configured admin authority before a sensitive pool action is allowed. - [Challenge 2 - Spot Price From Reserves](https://www.learnsol.site/learn/challenges/cpmm/2.mdx): Compute the spot price implied by pool reserves using integer math scaled to basis points. - [Challenge 20 - Secure CPMM Swap Flow](https://www.learnsol.site/learn/challenges/cpmm/20.mdx): Combine pause-state validation, fee-adjusted exact-in quoting, and slippage protection into one secure swap function. - [Challenge 3 - Exact In Swap Quote](https://www.learnsol.site/learn/challenges/cpmm/3.mdx): Implement the basic constant-product exact-in quote for a swap without fees. - [Challenge 4 - Fee Adjusted Swap Input](https://www.learnsol.site/learn/challenges/cpmm/4.mdx): Apply a 30 basis point trading fee to the input amount before quoting the output of a swap. - [Challenge 5 - Slippage Protected Swap](https://www.learnsol.site/learn/challenges/cpmm/5.mdx): Combine fee-adjusted input, constant-product quote math, and a minimum output check to protect the trader from excessive slippage. - [Challenge 6 - Mutating Swap Reserves](https://www.learnsol.site/learn/challenges/cpmm/6.mdx): Update pool reserves after an exact-in swap with a 30 basis point fee and return the new reserve balances. - [Challenge 7 - Trading Fee Collected](https://www.learnsol.site/learn/challenges/cpmm/7.mdx): Compute how much fee the protocol collects from a swap input amount when the fee rate is 30 basis points. - [Challenge 8 - Effective Execution Price](https://www.learnsol.site/learn/challenges/cpmm/8.mdx): Calculate the average execution price of a swap using integer math scaled by 10,000. - [Challenge 9 - Slippage In Basis Points](https://www.learnsol.site/learn/challenges/cpmm/9.mdx): Compare spot price and execution price to compute realized slippage in basis points. - [Challenge 1 - Valid Limit Order](https://www.learnsol.site/learn/challenges/orderbook/1.mdx): Define the basic limit order model and reject orders with zero price or zero quantity. - [Challenge 10 - Price Time Priority](https://www.learnsol.site/learn/challenges/orderbook/10.mdx): Sort resting orders by best price first and earlier timestamp first when prices are equal. - [Challenge 11 - Post Only Rejection](https://www.learnsol.site/learn/challenges/orderbook/11.mdx): Reject post-only orders that would immediately cross the top of book and take liquidity. - [Challenge 12 - Immediate Or Cancel Buy](https://www.learnsol.site/learn/challenges/orderbook/12.mdx): Execute as much of an IOC buy as possible against asks and cancel any unfilled remainder instead of posting it. - [Challenge 2 - Crossing Logic](https://www.learnsol.site/learn/challenges/orderbook/2.mdx): Implement the core price-crossing rule that decides whether a taker order can match a maker order. - [Challenge 3 - Best Bid And Best Ask](https://www.learnsol.site/learn/challenges/orderbook/3.mdx): Find the top of book: highest bid price and lowest ask price from a list of orders. - [Challenge 4 - Single Fill Calculation](https://www.learnsol.site/learn/challenges/orderbook/4.mdx): Compute the filled amount and remaining quantities when one taker order meets one maker order. - [Challenge 5 - Market Buy Against Asks](https://www.learnsol.site/learn/challenges/orderbook/5.mdx): Match a market buy against ask liquidity from cheapest ask upward and compute filled base and quote spent. - [Challenge 6 - Market Sell Against Bids](https://www.learnsol.site/learn/challenges/orderbook/6.mdx): Match a market sell against bid liquidity from highest bid downward and compute filled base and quote received. - [Challenge 7 - Average Fill Price](https://www.learnsol.site/learn/challenges/orderbook/7.mdx): Compute average execution price from total quote and base filled using integer math scaled by 10,000. - [Challenge 8 - Insert Limit Order Sorted](https://www.learnsol.site/learn/challenges/orderbook/8.mdx): Insert a limit order into one side of the book while preserving the side-specific price ordering. - [Challenge 9 - Cancel Order By ID](https://www.learnsol.site/learn/challenges/orderbook/9.mdx): Remove an order from the book by ID and return whether a matching order was found. - [Day 1 - Hello Rust](https://www.learnsol.site/learn/challenges/rust/1.mdx): Start your Rust journey with Day 1: Learn to declare variables, understand basic types, and use println! macro for output. Perfect for Solana development beginners. - [Day 10: Methods & impl](https://www.learnsol.site/learn/challenges/rust/10.mdx): Add behavior to types with impl blocks in Day 10: methods, associated functions, and self parameter. Build reusable components for Solana programs. - [Day 11: Result & Error Handling](https://www.learnsol.site/learn/challenges/rust/11.mdx): Handle errors gracefully in Day 11: Result type, the ? operator, and error propagation patterns. Master Solana's error handling conventions. - [Day 12: Vectors](https://www.learnsol.site/learn/challenges/rust/12.mdx): Master Vec in Day 12: Rust's growable, heap-allocated array. Learn push, pop, iteration, and memory management for dynamic Solana data. - [Day 13: Strings](https://www.learnsol.site/learn/challenges/rust/13.mdx): Understand String vs &str in Day 13: owned strings, string slices, and manipulation methods. Essential for handling text data in Solana programs. - [Day 14: HashMaps](https://www.learnsol.site/learn/challenges/rust/14.mdx): Store key-value pairs with HashMap in Day 14: insertion, lookup, iteration, and common patterns. Perfect for mapping accounts in Solana applications. - [Day 15: Generics](https://www.learnsol.site/learn/challenges/rust/15.mdx): Write flexible code with generics in Day 15: generic functions, structs, and type parameters. Build reusable Solana program components. - [Day 16: Traits](https://www.learnsol.site/learn/challenges/rust/16.mdx): Define shared behavior with traits in Day 16: Rust's approach to interfaces. Learn trait bounds and implementations for Solana program design. - [Day 17: Trait Objects](https://www.learnsol.site/learn/challenges/rust/17.mdx): Use dyn Trait for runtime polymorphism in Day 17: trait objects and heterogeneous collections. Advanced patterns for flexible Solana architectures. - [Day 18: Lifetimes](https://www.learnsol.site/learn/challenges/rust/18.mdx): Master lifetime annotations in Day 18: Rust's way of ensuring reference validity. Critical for understanding Solana's account lifetime requirements. - [Day 19: Iterators](https://www.learnsol.site/learn/challenges/rust/19.mdx): Master Rust iterators in Day 19: functional data processing with map, filter, fold, and collect. Write efficient Solana data transformations. - [Day 2: Primitive Types](https://www.learnsol.site/learn/challenges/rust/2.mdx): Master Rust's fundamental types in Day 2: integers, floats, tuples, and basic arithmetic operations. Build a strong foundation for Solana smart contract development. - [Day 20: Closures](https://www.learnsol.site/learn/challenges/rust/20.mdx): Capture environment with closures in Day 20: anonymous functions with superpowers. Learn Fn, FnMut, FnOnce traits for Solana callback patterns. - [Day 21: Modules](https://www.learnsol.site/learn/challenges/rust/21.mdx): Organize code with modules in Day 21: visibility, pub keyword, and clean API design. Structure your Solana programs professionally. - [Day 22: Smart Pointers](https://www.learnsol.site/learn/challenges/rust/22.mdx): Explore smart pointers in Day 22: Box, Rc, and RefCell for advanced memory management. Understand patterns used in complex Solana programs. - [Day 23: Derive Macros](https://www.learnsol.site/learn/challenges/rust/23.mdx): Auto-implement traits with #[derive] in Day 23: Debug, Clone, Copy, PartialEq, and more. Essential macros for Solana account serialization. - [Day 24: Attributes](https://www.learnsol.site/learn/challenges/rust/24.mdx): Control compilation with attributes in Day 24: #[repr], #[allow], and memory layout control. Crucial for Solana program optimization. - [Day 25: Byte Serialization](https://www.learnsol.site/learn/challenges/rust/25.mdx): Manually serialize data to bytes in Day 25: the foundation for understanding Borsh serialization used throughout Solana development. - [Day 26: Working with Bytes](https://www.learnsol.site/learn/challenges/rust/26.mdx): Build a Pubkey-like struct in Day 26: implement a 32-byte public key type similar to Solana's. Essential for Solana address handling. - [Day 27: The From Trait](https://www.learnsol.site/learn/challenges/rust/27.mdx): Implement type conversions in Day 27: From/Into traits used everywhere in Solana for seamless type transformations. - [Day 28: Error Enums](https://www.learnsol.site/learn/challenges/rust/28.mdx): Create Solana-style error enums in Day 28: numeric error codes, error messages, and the patterns used in production Solana programs. - [Day 29: Account Validation](https://www.learnsol.site/learn/challenges/rust/29.mdx): Implement account validation in Day 29: discriminators, type checking, and the security patterns that protect Solana programs. - [Day 3: Functions](https://www.learnsol.site/learn/challenges/rust/3.mdx): Learn Rust functions in Day 3: parameters, return types, expressions vs statements, and function composition. Essential skills for writing Solana programs. - [Day 30: Capstone - State Machine](https://www.learnsol.site/learn/challenges/rust/30.mdx): Build a complete escrow state machine in Day 30: your capstone project combining all Rust concepts for a production-ready Solana pattern. - [Day 4: Control Flow](https://www.learnsol.site/learn/challenges/rust/4.mdx): Master Rust control flow in Day 4: if/else expressions, match patterns, and loops (loop, while, for). Critical for Solana program logic implementation. - [Day 5: Ownership Basics](https://www.learnsol.site/learn/challenges/rust/5.mdx): Understand Rust's ownership system in Day 5: the core concept that makes Rust memory-safe without garbage collection. Fundamental for Solana account management. - [Day 6: References & Borrowing](https://www.learnsol.site/learn/challenges/rust/6.mdx): Learn Rust borrowing and references in Day 6: immutable and mutable borrows, reference rules, and avoiding ownership transfer. Key for Solana account references. - [Day 7: Slices](https://www.learnsol.site/learn/challenges/rust/7.mdx): Master Rust slices in Day 7: string slices, array slices, and working with contiguous sequences. Essential for handling Solana account data efficiently. - [Day 8: Structs](https://www.learnsol.site/learn/challenges/rust/8.mdx): Create custom data types with Rust structs in Day 8: define fields, implement methods, and model complex data. Foundation for Solana account structures. - [Day 9: Enums & Option](https://www.learnsol.site/learn/challenges/rust/9.mdx): Master Rust enums and Option type in Day 9: define variants, pattern match, and handle null-safety elegantly. Critical for Solana error handling patterns.