The "Stripe" for Web3 Recurring Payments
Live Demo β’ Documentation β’ Contract Explorer β’ Discord
This project was originally built during the Kolkata Hackathon and has been enhanced for the Stellar Journey program.
| Requirement | Status |
|---|---|
| Mini-dApp Functional | β Complete |
| README Documentation | β Complete |
| 3+ Meaningful Commits | β 12+ commits in March 2026 |
| 3+ Tests Passing | β 10 tests passing |
| Live Demo | β quantx-app.vercel.app |
| Demo Video | β Watch Demo (1 min) |
PASS src/utils.test.ts
QuantX SDK Utils
toContractAmount
β should convert whole numbers correctly
β should convert decimal amounts correctly
β should handle zero
fromContractAmount
β should convert contract amounts to human readable
β should handle decimal results
β should handle number input
β should handle string input
isValidAddress
β should return true for valid Stellar public keys
β should return true for valid contract IDs
β should return false for invalid addresses
Test Suites: 1 passed, 1 total
Tests: 10 passed, 10 total
cd quantx-sdk
npm install
npm testQuantX is a Recurring Finance Infrastructure (RFI) protocol built on Stellar's Soroban smart contract platform. It solves the critical automation gap in Web3 by enabling trustless, non-custodial recurring payments using stablecoins (USDC/XLM).
Unlike traditional Web3 transactions that require manual signing for each payment, QuantX implements a smart contract vault system allowing users to pre-authorize recurring payments while maintaining full custody of their assets.
- β Non-Custodial: Users maintain full control of their funds
- β Trustless Automation: Smart contracts execute payments based on predefined conditions
- β Multi-Token Support: USDC, XLM, and other Stellar assets
- β Flexible Scheduling: Daily, weekly, monthly, or custom intervals
- β Multi-Platform: Web dashboard, SDK integration, and Telegram bot
- β Gas-Efficient: Optimized Soroban contracts with minimal transaction costs
- β Decentralized Execution: Open keeper network for payment triggering
- Use Cases
- System Architecture
- Smart Contract Details
- Project Structure
- Getting Started
- Usage Guide
- Smart Contract Deployment
- API Reference
- Security
- Roadmap
- Contributing
- License
- Subscription Services: Accept recurring payments for your SaaS, newsletter, or premium content
- Membership Platforms: Automate member dues and tiered access
- Creator Economy: Enable fans to support creators with automated monthly contributions
- Automated Payroll: Schedule recurring payments to contributors and employees
- Vesting Schedules: Implement token vesting with automated distributions
- Treasury Management: Automate recurring operational expenses
- Dollar-Cost Averaging: Enable users to automate investment strategies
- Loan Repayments: Schedule automated loan installments
- Yield Distribution: Automate rewards distribution to stakeholders
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Interfaces β
ββββββββββββββββββββ¬βββββββββββββββββββ¬βββββββββββββββββββββββββββ€
β Web Dashboard β Telegram Bot β Third-party dApps β
β (Next.js) β (Telegraf) β (via SDK) β
ββββββββββ¬ββββββββββ΄βββββββββ¬ββββββββββ΄βββββββββββ¬ββββββββββββββββ
β β β
ββββββββββββββββββββΌβββββββββββββββββββββ
β
ββββββββββΌβββββββββ
β QuantX SDK β
β (TypeScript) β
ββββββββββ¬βββββββββ
β
ββββββββββββββββββββΌβββββββββββββββββββ
β β β
ββββββΌββββββ βββββββββΌβββββββββ ββββββΌββββββ
β Freighterβ β Soroban RPC β β Horizon β
β Wallet β β Indexer β β API β
ββββββ¬ββββββ βββββββββ¬βββββββββ ββββββ¬ββββββ
β β β
ββββββββββββββββββββΌβββββββββββββββββββ
β
βββββββββββββΌβββββββββββββ
β Stellar Blockchain β
ββββββββββββββββββββββββββ€
β QuantX Smart Contract β
β - Subscription Vault β
β - Payment Executor β
β - Token Allowances β
βββββββββββββ¬βββββββββββββ
β
βββββββββββββΌβββββββββββββ
β Keeper Network β
β (Automated Executors) β
ββββββββββββββββββββββββββ
- Web Dashboard: Next.js application for creating and managing subscriptions
- Telegram Bot: Chat interface for subscription management on-the-go
- SDK: TypeScript library for third-party integrations
- QuantX SDK: Handles wallet connections, transaction building, and state management
- Dual-Layer Polling: Bridges Soroban RPC and Horizon API for reliable transaction indexing
- Smart Contracts: Rust-based Soroban contracts managing vaults and payment logic
- Token Standards: Compatible with SEP-41 (Stellar Asset Contract)
- Keeper Network: Decentralized nodes monitoring and triggering due payments
- Incentive Mechanism: Executors earn fees for successfully processing payments
Network: Stellar Testnet (Soroban)
Contract ID: CDIDTRRDNMK4D6CIWFNLEML5L6FCVLMEVKCXXSAB6PJZ3J5JS74M7GFD
Explorer: https://stellar.expert/explorer/testnet/contract/[CONTRACT_ID]
Status: Pending Security Audit
Expected Launch: Q2 2025
pub fn create_subscription(
env: Env,
payer: Address,
recipient: Address,
token: Address,
amount: i128,
interval: u64,
start_time: u64,
) -> Result<u64, Error>Creates a new recurring payment subscription.
Parameters:
payer: Address authorizing the recurring paymentrecipient: Address receiving the paymentstoken: Asset contract address (USDC, XLM, etc.)amount: Payment amount per intervalinterval: Time between payments (in seconds)start_time: Unix timestamp for first payment
Returns: Subscription ID
pub fn execute_payment(
env: Env,
subscription_id: u64,
) -> Result<(), Error>Executes a due payment for an active subscription.
Authorization: Can be called by anyone (keeper network)
Validation:
- Checks if payment is due based on timestamp
- Verifies payer has sufficient allowance
- Ensures payer has adequate balance
pub fn cancel_subscription(
env: Env,
subscription_id: u64,
) -> Result<(), Error>Cancels an active subscription.
Authorization: Only subscription payer or recipient
pub fn get_subscription(
env: Env,
subscription_id: u64,
) -> SubscriptionRetrieves subscription details.
Returns:
pub struct Subscription {
pub payer: Address,
pub recipient: Address,
pub token: Address,
pub amount: i128,
pub interval: u64,
pub next_payment: u64,
pub is_active: bool,
}- Allowance-Based: Contract uses token allowances, never holding user funds
- Time-Locked: Payments can only execute after designated intervals
- Atomic Transactions: All operations are atomic, preventing partial states
- Reentrancy Protection: Guard mechanisms prevent reentrancy attacks
- Access Control: Role-based permissions for sensitive operations
QuantX/
βββ contracts/ # Soroban Smart Contracts
β βββ src/
β β βββ lib.rs # Main contract logic
β β βββ storage.rs # Storage definitions
β β βββ types.rs # Custom types
β β βββ test.rs # Contract tests
β βββ Cargo.toml
β βββ README.md
β
βββ quantx-sdk/ # TypeScript SDK
β βββ src/
β β βββ contract/ # Contract interaction layer
β β βββ wallet/ # Wallet connection handlers
β β βββ polling/ # Transaction status polling
β β βββ types/ # TypeScript definitions
β βββ package.json
β βββ README.md
β
βββ quantx-bot/ # Telegram Bot
β βββ src/
β β βββ bot.ts # Bot initialization
β β βββ commands/ # Command handlers
β β βββ scenes/ # Conversation flows
β β βββ utils/ # Helper functions
β βββ package.json
β βββ README.md
β
βββ web/ # Next.js Web Dashboard
β βββ app/
β β βββ (dashboard)/ # Dashboard routes
β β βββ api/ # API routes
β β βββ layout.tsx
β βββ components/ # React components
β βββ lib/ # Utilities
β βββ public/ # Static assets
β βββ package.json
β
βββ keeper/ # Automated Executor
β βββ src/
β β βββ monitor.ts # Subscription monitoring
β β βββ executor.ts # Payment execution
β β βββ config.ts # Configuration
β βββ package.json
β
βββ docs/ # Documentation
βββ scripts/ # Deployment scripts
βββ .github/ # GitHub workflows
βββ README.md # This file
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- Rust (v1.70 or higher)
- Stellar CLI (Soroban)
- Git
- Freighter Wallet (Browser extension)
git clone https://github.com/iamomm-hack/QuantX.git
cd QuantX# macOS
brew install stellar-cli
# Linux
cargo install --locked stellar-cli --features opt
# Verify installation
stellar --version# Add Testnet network
stellar network add \
--global testnet \
--rpc-url https://soroban-testnet.stellar.org:443 \
--network-passphrase "Test SDF Network ; September 2015"
# Generate a test identity
stellar keys generate alice --network testnet
# Fund the account (get test XLM)
stellar keys fund alice --network testnet# Install all workspace dependencies
npm install
# Or install individually
cd web && npm install
cd ../quantx-sdk && npm install
cd ../quantx-bot && npm install
cd ../keeper && npm installcd contracts
stellar contract build
# Deploy to testnet
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/quantx_contract.wasm \
--source alice \
--network testnetcd web
cp .env.example .env.local
# Edit .env.local with your contract address
# NEXT_PUBLIC_CONTRACT_ID=CXXXXXXX...
npm run devAccess at http://localhost:3000
cd quantx-bot
cp .env.example .env
# Edit .env with your bot token
# BOT_TOKEN=your_telegram_bot_token
# CONTRACT_ID=CXXXXXXX...
npm run devcd keeper
cp .env.example .env
# Configure keeper settings
# PRIVATE_KEY=your_executor_private_key
# CONTRACT_ID=CXXXXXXX...
npm start-
Connect Wallet
- Click "Connect Wallet" and approve Freighter connection
- Ensure you're on Stellar Testnet
-
Create Subscription Plan
- Navigate to "Create Subscription"
- Fill in details:
- Amount (e.g., 10 USDC)
- Interval (e.g., 30 days)
- Description
- Click "Create Plan"
- Confirm transaction in Freighter
-
Share Subscription Link
- Copy the generated subscription link
- Share with customers
-
Visit Subscription Link
- Open the merchant's subscription link
-
Review & Approve
- Review subscription details
- Click "Subscribe"
- Approve Token Allowance in Freighter (first time only)
- Confirm subscription creation
-
Manage Subscriptions
- View active subscriptions in dashboard
- Cancel anytime with one click
npm install @quantx/sdkimport { QuantXClient } from '@quantx/sdk';
// Initialize client
const client = new QuantXClient({
network: 'testnet',
contractId: 'CXXXXXXX...',
});
// Connect wallet
await client.connectWallet();
// Create subscription
const subscriptionId = await client.createSubscription({
recipient: 'GXXXXXXX...',
token: 'USDC_CONTRACT_ADDRESS',
amount: '10.00',
interval: 30 * 24 * 60 * 60, // 30 days in seconds
});
// Get subscription details
const subscription = await client.getSubscription(subscriptionId);
// Cancel subscription
await client.cancelSubscription(subscriptionId);// Listen to subscription events
client.on('payment_executed', (event) => {
console.log('Payment processed:', event);
});
// Execute payment manually (keeper functionality)
await client.executePayment(subscriptionId);
// Batch operations
const subscriptions = await client.getUserSubscriptions(address);-
Find the Bot
- Search for
@QuantXBoton Telegram - Send
/start
- Search for
-
Connect Wallet
-
Commands
/start - Initialize bot
/connect - Connect wallet
/subscribe - Create new subscription
/mysubs - View your subscriptions
/cancel [id] - Cancel subscription
/balance - Check token balances
/help - Show all commands
- Send
/subscribe - Follow the interactive prompts:
- Enter recipient address
- Select token (USDC/XLM)
- Enter amount
- Choose interval (Daily/Weekly/Monthly)
- Confirm via deep link
- Receive confirmation with subscription ID
# 1. Build the contract
cd contracts
stellar contract build
# 2. Optimize WASM
stellar contract optimize --wasm target/wasm32-unknown-unknown/release/quantx_contract.wasm
# 3. Deploy
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/quantx_contract.optimized.wasm \
--source alice \
--network testnet
# 4. Initialize contract (if needed)
stellar contract invoke \
--id CONTRACT_ID \
--source alice \
--network testnet \
-- initialize \
--admin GXXXXXXX...# Switch to mainnet network
stellar network add \
--global mainnet \
--rpc-url https://soroban-rpc.mainnet.stellar.org:443 \
--network-passphrase "Public Global Stellar Network ; September 2015"
# Deploy with mainnet source
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/quantx_contract.optimized.wasm \
--source mainnet-deployer \
--network mainnetComplete SDK documentation available at docs.quantx.fi/sdk
class QuantXClient {
// Wallet Management
connectWallet(): Promise<string>
disconnectWallet(): void
getAddress(): string
// Subscription Management
createSubscription(params: CreateSubscriptionParams): Promise<string>
getSubscription(id: string): Promise<Subscription>
getUserSubscriptions(address: string): Promise<Subscription[]>
cancelSubscription(id: string): Promise<void>
// Payment Execution
executePayment(id: string): Promise<void>
getPaymentHistory(id: string): Promise<Payment[]>
// Token Operations
approveToken(token: string, amount: string): Promise<void>
getAllowance(owner: string, spender: string): Promise<string>
}GET /api/subscriptions/:id - Get subscription details
POST /api/subscriptions - Create subscription
DELETE /api/subscriptions/:id - Cancel subscription
GET /api/subscriptions/user/:address - Get user subscriptions
POST /api/payments/:id/execute - Execute payment
GET /api/payments/:id/history - Get payment history
- β Internal security review completed
- β³ Third-party audit: Scheduled Q2 2025
- β³ Bug bounty program: Launching with mainnet
- Never share your private keys - QuantX never asks for them
- Verify contract addresses - Always check official sources
- Review allowances - Only approve what you need
- Monitor subscriptions - Regularly check active subscriptions
- Use hardware wallets - For large-value subscriptions
If you discover a security vulnerability, please email: security@quantx.fi
We offer rewards for responsible disclosure through our bug bounty program.
- Core smart contract development
- Web dashboard MVP
- TypeScript SDK
- Telegram bot integration
- Testnet deployment
- Multi-token support expansion
- Advanced subscription templates
- Payment analytics dashboard
- Mobile app (React Native)
- Enhanced keeper network
- Security audit completion
- Mainnet deployment
- Open keeper network
- Governance token launch
- DAO formation
- Plugin marketplace
- API marketplace
- Cross-chain bridges
- Enterprise solutions
- White-label offerings
We welcome contributions from the community! Here's how you can help:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Run tests
npm test - Commit with conventional commits
git commit -m "feat: add amazing feature" - Push and create PR
git push origin feature/amazing-feature
- Follow the existing code style
- Write tests for new features
- Update documentation
- Use conventional commit messages
- Ensure all tests pass
# Install development dependencies
npm install
# Run tests
npm test
# Run linter
npm run lint
# Format code
npm run formatThis project is licensed under the MIT License - see the LICENSE file for details.
- Stellar Development Foundation for Soroban platform
- Freighter Wallet for seamless integration
- Community Contributors for feedback and support
Built with β€οΈ on Stellar

