A decentralized Automated Market Maker (AMM) smart contract built on Stellar's Soroban network. This contract implements the constant product formula (
-
Constant Product AMM — Swap tokens using the
$x \times y = k$ invariant with a 0.3% protocol fee. -
Fixed-Point Math — All arithmetic uses
u128integer math (#![no_std]), as Soroban does not support floating-point. -
Slippage Protection — Accepts a
min_outparameter to prevent front-running and excessive slippage. - LP Token Lifecycle — Mint and burn liquidity pool share tokens on deposit and withdrawal; tracks total LP supply in persistent state.
- Security Hardening — Guards against zero-liquidity edge cases and division-by-zero panics.
-
CI/CD Automation — Pre-configured GitHub Actions workflow that runs
cargo fmt,cargo clippy, andcargo teston every PR.
Issues are assigned point values based on complexity. Check the wave tags in the issue tracker before assigning yourself.
| Complexity | Points | Issue | Description |
|---|---|---|---|
| 🔴 High | 200 | #58 | Implement Constant Product Swap Math & Slippage Protection |
| 🟡 Medium | 150 | #62 | LP Token Minting & Burning Lifecycle |
| 🟢 Trivial | 100 | #65 | Standardize CI/CD Testing Actions |
Write the core token swap logic using native #![no_std] Rust math. The contract must calculate the output token amount minus a 0.3% protocol fee, while accepting a min_out parameter to prevent front-running and excessive slippage.
Requirements:
- Implement fixed-point math using
u128(no floating-point). - Unit tests demonstrating the invariant (
$x \times y = k$ ) holds after every swap.
Implement the logic to mint liquidity pool share tokens on deposit and burn them on withdrawal. Update persistent state to track total LP token supply.
Requirements:
- Prevent zero-liquidity edge cases that could cause division-by-zero panics.
- Test that users receive the mathematically correct proportion of pool fees upon withdrawal.
Update .github/workflows/rust.yml to automate testing for the Soroban contract. The action must run cargo fmt --check, cargo clippy, and cargo test --features testutils on every PR opened against main.
Requirements:
- The workflow must strictly use the
wasm32-unknown-unknowntarget.
This repository uses the Drips Wave Program to fund community contributions through recurring 1-week sprints. Browse the backlog, complete issues, and earn a share of the monthly reward pool via the Fix, Merge, and Earn workflow.
⚠️ Pre-Requisite: To participate and receive points for your PRs, you must complete KYC identity verification in the Drips App. This is a strict regulatory requirement for withdrawing funds and ensures Sybil resistance.
- Test Coverage — All math logic and state changes must achieve 95% test coverage using the Soroban Env mocking framework.
- AI Contribution Policy — AI tools may assist your workflow, but submitting untested, low-quality code you do not fundamentally understand is a Prohibited Activity under Drips Wave terms. PRs must pass rigorous code review.
- PR Linking — Pull request descriptions must clearly link the original issue (e.g.,
Resolves #58) so the Drips indexer can accurately award points upon merge.
- Rust toolchain (latest stable)
wasm32-unknown-unknowntarget installed- Soroban CLI
git clone https://github.com/yourusername/soroban-amm-pool.git
cd soroban-amm-pool
cargo build --target wasm32-unknown-unknown --release
cargo test