Normal is a synthetic asset protocol enabling investors to trade any crypto asset or real-world asset (RWA) from a single DEX.
- Buy and sell any Top 100 crypto from a single DEX on Stellar using Normal Tokens (i.e. nBTC - Normal Bitcoin)
- Earn yield by providing XLM as liquidity to Normal Token pools
- Stake and earn yield from the Insurance Fund by helping cover liquidity deficits
- Earn reward tokens by using the Normal Protocol to swap and provide liquidity
- pool - A constant product AMM for synthetic assets that automatically mints/burns the synthetic asset to maintain an oracle price peg
- pool_router - entry point and catalogue of liquidity pools which is capable to deploy new pools if necessary
- insurance_fund - Additional backstop for liquidity deficits. Funded via liquidity provider staking deposits
- oracle_registry - Oracle aggegation and price validation making it easier for pools to source reliable oracle prices
- pool_swap_fee - A proxy for the
PoolRouterthat handles swap fee collection and distribution. - pool_plane - contract designed to store minimum information about any pool: type, parameters, reserves. being updated on every action with the pool (deposit, swap, withdraw, parameters update, etc)
- liquidity_calculator - smart contract containing pools liquidity calculation logic which is capable to compare many pools at once
- lp_token - SEP-0041 compatible token smart contract designed for liquidity pool share management
- token - SEP-0041 compatible token smart contract
- access_control - Handles permissioned access to contracts using role-based access control (RBAC)
- incentives - Handles how liquidity provider fees and pool rewards are calculated and claimed
- reentrancy_guard - Handles utilities helping prevent re-entrant calls (even though they're technically impossible on Soroban)
- token_lp - Handles LP token utilities
- token_synthetic - Handles synthetic token (
Pool.token_a) utilities - upgrade - Handles contract upgrades
- utils - Handles shared types, utils, constants, errors, macros, and more
- Register a XLM oracle:
yarn oracle:register testnet XLM 14 1 - Register a BTC oracle:
yarn oracle:register testnet BTC 14 1 - Deploy a nBTC/XLM pool:
yarn pool:deploy testnet BTC nBTC 30 A 1_000_000_0000000 - Deposit liquidity to the pool:
yarn pool:deposit testnet BTC 10_0000000 - Withdraw liquidity to the pool:
yarn pool:withdraw testnet BTC 5_0000000 - Swap:
yarn pool:swap testnet BTC Buy 1_0000000 <out_min>
- Task as task runner
- installed latest Rust version
- soroban cli
git clone [email protected]:normalfinance/normal-stellar-amm.git
task build
task test
check the Soroban documentation: https://soroban.stellar.org/docs/reference/rpc
- @AquaToken
- @jblewnormal
- @jaymalve
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
You can find audits of this codebase in the /audits directory. These are our most recent audits:
- Summer 2025 x Halborn - (https://github.com/normalfinance/normal-stellar-amm/audits/)
- 📧 Email: [email protected]
✈️ Telegram: @normalfinance- 🐣 Twitter: @normalfi
- 🥷🏼 GitHub: @normalfinance
- 👾 Discord: @Normal
- 📚 Docs: @normalfinance
- 🤓 Blog: @normalfinance
