Sugar Money — Rust SDK
Lightweight Rust toolkit for building on Sugar Money: typed HTTP API client, on-chain instruction builders/quoters, and a slim Raydium CP-Swap compatibility layer — all in one workspace.
Documentation
- API module guide → https://docs.rs/sugar-money/latest/sugar_money/api/index.html
- Program module guide → https://docs.rs/sugar-money/latest/sugar_money/program/index.html
Modules
-
api/— Async client for the Sugar Money REST/WebSocket API.reqwest+tokiofor HTTP,tokio-tungstenitefor realtime.- Typed models via
serde. - Cookie-based auth (Sign-In with Wallet), payouts helpers, streaming updates.
- Docs: https://docs.rs/sugar-money/latest/sugar_money/api/index.html
-
program/— High-level Solana client for the SugarMoney and pSOL Anchor programs.- Instruction builders (buy/sell, admin), slippage & quoting, PDA discovery.
- Subscriptions with a local cache, pSOL wrap/unwrap utilities, migration helpers.
- Docs: https://docs.rs/sugar-money/latest/sugar_money/program/index.html
-
raydium_cp_swap/— Vendored raydium-cp-swap components adapted for off-chain use.- States (
AmmConfig,PoolState), curve math (CurveCalculator), Raydium-compatible swap accounts/args. - No on-chain handlers; used for local quotes and building swap instructions.
- Licensed under Apache-2.0 with attribution (see
LICENSEandNOTICE).
- States (
Quick Pointers
- Install: see each module’s guide for
Cargo.tomlsnippets and examples. - Auth: API uses cookie-based auth (sign-in with wallet).
- Quotes: Program client provides exact-in/out quoting + slippage helpers.
- Raydium: use
raydium_cp_swap::{accounts, instruction}for swap Ixs;raydium_cp_swap::curvefor local math.
License & Notices
This repository includes code derived from raydium-cp-swap under Apache-2.0.
See LICENSE and NOTICE for details and a summary of modifications.