Modular Soroban smart‑contract suite that lets a user deposit one asset (e.g. USDC) and spread it across several AMMs for swaps or liquidity‑provision—currently Aqua (0), Comet (1), Soroswap (2), and Phoenix (3)
contracts/
├─ common/ shared admin/events/error helpers
├─ adapter-interface/ trait every AMM adapter must follow
├─ adapters/
│ ├─ aqua/ adapter‑id 0
│ ├─ comet/ adapter‑id 1
│ ├─ soroswap/ adapter‑id 2
│ └─ phoenix/ adapter‑id 3
├─ router/ swap & liquidity dispatcher
├─ account/ user‑owned contract that holds balances
└─ account\_deployer/ deploys Account atomically
We need to add all the compiled contracts to the adapters/{protocol}/{protocol}-contracts locations.
| ID | Protocol | Crate |
|---|---|---|
| 0 | Aqua | aqua-adapter |
| 1 | Comet | comet-adapter |
| 2 | Soroswap | soroswap-adapter |
| 3 | Phoenix | phoenix-adapter |
These i128 values are what the router and front‑end use to choose an adapter.
rustup target add wasm32-unknown-unknown
cargo build --workspace --target wasm32-unknown-unknown --releaseOptimised .wasm files are produced under
target/wasm32-unknown-unknown/release/.
-
Account – smart account owned by the user. Receives USDC, approves the Router, and calls deposit / withdraw.
-
Router – takes USDC, splits it per user‑supplied plan, calls the correct adapter(s) to swap or add/remove liquidity.
-
Adapters – one per AMM. Translate the Router’s generic request into the AMM’s concrete contract calls (swap, add LP, remove LP).
- Replace pseudocode in each
src/protocol_interface.rswith the real function signatures once the external binaries are final. - Fill
router::provide_liquidityandrouter::redeem_liquidity. - Write Tests
- Write Javascript Bindings
Created for the Hoops‑Fi project