reflect-api-rs

Crates.ioreflect-api-rs
lib.rsreflect-api-rs
version0.0.1
created_at2025-12-14 21:52:34.509492+00
updated_at2025-12-14 21:52:34.509492+00
descriptionUnofficial Rust scaffold and server implementation for the Reflect Stablecoin API
homepagehttps://github.com/sawsimeon/reflect-api-rs
repositoryhttps://github.com/sawsimeon/reflect-api-rs
max_upload_size
id1985152
size49,914
Saw Simeon (sawsimeon)

documentation

README

Reflect API (reflect-api-rs) Reflect Logo

Unofficial Rust Library for the Reflect API

This repository provides a modular, production-ready scaffold for building a backend server compatible with the Reflect API — the programmable infrastructure behind Reflect, autonomous money designed for the stablecoin era.

Reflect issues income-generating stablecoins (such as rUSD, with future support for rEUR and others) that automatically farm the best DeFi rates on Solana while remaining fully liquid, fully insured on-chain, and non-custodial. Every stablecoin earns continuous yield with no lockups, no claims process, and built-in real-time insurance.

The official Reflect API (base URL: [https://prod.api.reflect.money](https://docs.reflect.money/reflect-api/)) enables developers and protocols to:

  • Mint and redeem stablecoins
  • Retrieve real-time/historical APYs and exchange rates
  • Set up whitelabeled integrations with branded tokens
  • Manage API keys, vaults, metadata, and user whitelists
  • Generate on-chain transactions securely
  • Access protocol statistics and events

This Rust implementation uses Axum as the web framework and is structured for clarity, maintainability, and future extension (e.g., adding database integration, authentication middleware, or on-chain interactions).

All endpoints are currently stubbed with placeholder/mock JSON responses, making this an ideal starting point for:

  • Local development and testing
  • Building a mirror/proxy server
  • Creating a custom backend for Reflect integrations
  • Learning the Reflect API structure

Project scaffold


├── Cargo.toml
├── src/
│   ├── health/
│   │   ├── health_check.rs
│   │   └── mod.rs
│   ├── stablecoin/
│   │   ├── generate_burn_transaction.rs
│   │   ├── generate_mint_transaction.rs
│   │   ├── get_all_apy.rs
│   │   ├── get_available_stablecoins.rs
│   │   ├── get_historical_apy.rs
│   │   ├── get_historical_exchange_rates.rs
│   │   ├── get_latest_exchange_rates.rs
│   │   ├── get_mint_redeem_quote.rs
│   │   ├── get_realtime_exchange_rate.rs
│   │   ├── get_specific_apy.rs
│   │   ├── get_supply_caps.rs
│   │   └── mod.rs
│   ├── integration/
│   │   ├── generate_claim_tx.rs
│   │   ├── generate_integration_mint_tx.rs
│   │   ├── generate_redemption_tx.rs
│   │   ├── get_current_exchange_rate.rs
│   │   ├── get_historical_integration_stats.rs
│   │   ├── get_integration_config.rs
│   │   ├── get_integration_events.rs
│   │   ├── get_integration_statistics.rs
│   │   ├── get_integrations_by_authority.rs
│   │   ├── initialize_integration_flow.rs
│   │   ├── initialize_integration_vault.rs
│   │   ├── initialize_integration.rs
│   │   ├── initialize_stablecoin_token.rs
│   │   ├── initialize_user_branded_token.rs
│   │   ├── mint_and_whitelabel.rs
│   │   ├── mod.rs
│   │   ├── redeem_whitelabeled.rs
│   │   ├── reveal_api_key.rs
│   │   ├── rotate_api_key.rs
│   │   ├── transfer_mint_authority.rs
│   │   ├── update_integration_config.rs
│   │   ├── upload_integration_metadata.rs
│   │   └── whitelist_users.rs
│   ├── stats/
│   │   ├── get_historical_tvl_and_volume.rs
│   │   ├── get_protocol_statistics.rs
│   │   └── mod.rs
│   └── events/
│       ├── get_events_by_signer.rs
│       ├── get_recent_events.rs
│       └── mod.rs
├── README.md

Each endpoint lives in its own file for easy navigation and modification.

Quick start

  1. Clone and build:
   git clone https://github.com/sawsimeon/reflect-api-rs.git
   df reflect-api-rs
   cargo build
  1. Run the server:
   cargo run
  1. The server listens on 0.0.0.0:3000. Try some endpoints with curl:
- Root health
  - GET http://localhost:3000/ → { "status": "reflect api running" }
- Health
  - GET http://localhost:3000/health/ → { "status": "ok" }
- Stablecoins
  - GET http://localhost:3000/stablecoins/ → list of available stablecoins
  - GET http://localhost:3000/stablecoins/supply-caps → supply caps
  - POST http://localhost:3000/stablecoins/quote → body { "stablecoin": "rUSD", "amount": 10.0, "side": "mint" }

Endpoints are mounted under:

  • /health
  • /stablecoins
  • /integrations
  • /stats
  • /events

Official Resources

Website: https://www.reflect.money Official API Documentation: https://docs.reflect.money/reflect-api Full Documentaiton Hub: https://docs.reflect.money

Note: This mirrors the official API structure but is a Rust implementation. However, it is unofficial and not affiliated with Reflect. Use the offical API (https://prod.api.reflect.money) in production.

Contributing

Contributions are welcome! Please open issues or pull requests for any improvements or bug fixes.

License

MIT License: https://opensource.org/license/MIT

Contact

For questions or feedback, please contact Saw Simeon.

Commit count: 0

cargo fmt