A collection of Solana programs I built to learn how different types of contracts work on Solana. Each contract has tests so you can see how everything fits together.
An automated market maker that lets you swap tokens, add liquidity, and remove it. Uses the constant product formula (x * y = k) to set prices.
- Create pools for token pairs
- Add liquidity and get LP tokens
- Swap tokens
- Remove liquidity
See the AMM README for details.
A two-way bridge between Solana and EVM chains. Lock tokens on Solana to get wrapped tokens on EVM, or burn wrapped tokens on EVM to unlock the originals back on Solana.
- Solana program for locking/unlocking tokens
- EVM contract for minting/burning wrapped tokens
- Relayer service that watches both chains
See the Bridge README for details.
Each contract is in its own folder with its own setup. Check the README in each folder for specific instructions.
General requirements:
- Rust (latest stable)
- Solana CLI
- Anchor framework
- Node.js and Yarn (for tests)
All contracts include test suites. Run them from each contract's directory:
cd amm
anchor test
cd bridge/bridging-solana
anchor testThese are practice projects to understand:
- How Solana programs work
- PDAs and account management
- Token operations with SPL
- Cross-chain interactions
- Testing Solana programs
Each contract has tests that show how to interact with it, which is helpful when learning.