Arbellar is an automated User-Funded Atomic Arbitrage Platform built on the Stellar blockchain. This repository contains the backend infrastructure that powers the Arbellar platform, providing market intelligence, opportunity discovery, risk analysis, and execution coordination for atomic arbitrage opportunities.
Traditional arbitrage opportunities in decentralized finance (DeFi) are often inaccessible to retail users due to:
- High capital requirements
- Technical complexity
- Fast-paced execution requirements
- Risk of partial execution
- Infrastructure costs
Arbellar solves this by enabling users to pool capital through smart vaults while the platform's backend infrastructure identifies and executes arbitrage opportunities atomically.
Arbellar employs a user-funded atomic arbitrage architecture where:
- Users deposit funds into smart vaults
- The backend continuously scans for arbitrage opportunities
- Opportunities are evaluated for profitability and risk
- Atomic transactions are constructed and coordinated
- Profits are distributed automatically between users and the platform
User Wallet → Smart Vault → Market Intelligence → Opportunity Discovery →
Profitability Analysis → Risk Validation → Atomic Execution →
Profit Distribution → Analytics
- Market Intelligence: SDEX orderbook data + Soroswap liquidity routing
- Opportunity Discovery: Independent arbitrage logic layer
- Risk Engine: Slippage, liquidity, and safety evaluations
- Execution Coordinator: Atomic transaction construction and submission
- Analytics Engine: Performance tracking and reporting
- Lower Barriers: No minimum capital requirements through pooled vaults
- Reduced Risk: Atomic execution prevents partial transaction failures
- Automated: No need for constant monitoring or manual execution
- Transparent: All operations are verifiable on-chain
- Accessible: Retail users can participate in sophisticated arbitrage strategies
- Retail traders seeking passive yield opportunities
- Stellar ecosystem users looking to maximize asset utilization
- DeFi enthusiasts interested in automated strategies
- Passive yield seekers wanting automated arbitrage exposure
- Developers building on Stellar's DeFi ecosystem
- Future institutional participants (Phase 3+)
- Performance Fee: 10–20% of profitable arbitrage executions
- Zero fees when no positive arbitrage occurs
- Execution/Relayer Surcharge (Phase 2+)
- Treasury Routing for protocol sustainability
- Future Flash-Loan Revenue (Phase 4)
- User accounts and wallet association
- Vault information management
- USDC/XLM market intelligence
- SDEX orderbook monitoring
- Soroswap liquidity analysis
- Basic profitability analysis
- Risk and slippage evaluation
- Trade execution coordination
- P&L analytics
- Platform fee tracking
- Additional liquidity sources (Aqua DEX, Phoenix DEX)
- Additional Soroban AMM pools
- Multi-asset support (AQUA/USDC, BTC/USDC, ETH/XLM, EURC/USDC)
- Dynamic spread thresholds
- Network-condition awareness
- User risk profiles
- Advanced analytics and reporting
- AI strategy engine integration
- Multi-hop arbitrage strategies
- Automated alerts and notifications
- Telegram/Discord integration
- Network optimization
- Predictive market analysis
- Flash-loan protocol integration
- Arbellar token ecosystem
- DAO governance and voting
- Treasury management
- Protocol configuration governance
- Runtime: Node.js 18+
- Framework: Express.js
- Language: TypeScript
- Database: MongoDB with Mongoose ODM
- Package Manager: pnpm
- Blockchain: Stellar SDK
- Market Data: Stellar Horizon API, Soroswap API
- Smart Contracts: Soroban RPC
- Caching: Redis-ready architecture
- Containerization: Docker & Docker Compose
- CI/CD: GitHub Actions
- Testing: Vitest
- Code Quality: ESLint, Prettier, TypeScript
- Stellar Infrastructure: Fast finality (3-5 seconds) and low transaction costs
- SDEX Integration: Direct access to Stellar's native decentralized exchange
- Soroban Smart Contracts: Advanced DeFi capabilities through Soroban
- User-Funded Architecture: Capital efficiency through pooled vaults
- Atomic Execution: Guaranteed all-or-nothing transaction execution
- Non-Custodial Design: Users retain control of their funds
- Independent Profitability Engine: Not reliant on single DEX logic
- Progressive Roadmap: Clear path from MVP to advanced features
┌───────────────────────────┐
│ Arbellar Frontend │
│ Next.js / TypeScript │
└─────────────┬─────────────┘
│
│ REST / Realtime APIs
▼
┌───────────────────────────┐
│ Arbellar Backend │
│ Express / Node / TS │
│ │
│ API │
│ Market Intelligence │
│ Scanner │
│ Risk Engine │
│ Execution Coordinator │
│ Analytics │
│ Persistence │
└─────────────┬─────────────┘
│ │
▼ ▼
┌─────────────┐ ┌──────────────────┐
│ Stellar │ │ Arbellar │
│ Ecosystem │ │ Smart Contracts │
│ │ │ Soroban / Rust │
│ SDEX │ │ │
│ Soroswap │ │ Vaults │
│ Horizon/RPC │ │ Fees │
└─────────────┘ │ On-chain State │
└──────────────────┘
- User interface and interaction
- Wallet connection and management
- Transaction approval/signing UX
- Data visualization and dashboards
- API orchestration and versioning
- Market intelligence gathering
- Opportunity discovery and analysis
- Risk evaluation and validation
- Execution coordination and monitoring
- Persistence and analytics
- Off-chain service management
- On-chain vault state management
- Atomic fund movement execution
- Fee distribution logic
- Treasury routing
- Emergency protocol controls
MongoDB serves as the off-chain persistence layer for:
- User profiles and preferences
- Vault metadata and activity
- Market snapshots and historical data
- Arbitrage opportunity tracking
- Trade execution records
- Analytics and performance metrics
- System events and audit logs
Important: MongoDB is NOT the source of truth for financial state. Stellar/Soroban remains authoritative for on-chain financial transactions.
Versioned REST API available at /api/v1/ with the following resource groups:
/api/v1/users- User management/api/v1/wallets- Wallet association/api/v1/vaults- Vault information/api/v1/markets- Market data and intelligence/api/v1/arbitrage- Opportunity discovery/api/v1/executions- Execution coordination/api/v1/trades- Trade history/api/v1/analytics- Performance analytics/api/v1/risk- Risk configuration/api/v1/fees- Fee tracking/api/v1/notifications- Event notifications/api/v1/health- System health checks
- Environment Variable Protection: No secrets in code
- Request Validation: All inputs validated using Joi
- Authentication Boundary: JWT-based auth (future implementation)
- Authorization Boundary: Role-based access control
- Rate Limiting: Protection against API abuse
- CORS Configuration: Strict origin policies
- HTTP Security Headers: Helmet middleware
- Input Sanitization: Protection against injection attacks
- MongoDB Query Safety: Parameterized queries
- Structured Error Responses: No sensitive information leakage
- Wallet-Address Validation: Proper Stellar address validation
- Transaction Verification: On-chain transaction verification
- Replay Protection: Idempotency considerations
Important: Arbitrage opportunities are not guaranteed and involve risk:
- Market Risk: Arbitrage spreads can disappear rapidly
- Liquidity Risk: Insufficient liquidity for desired trade size
- Slippage Risk: Price movement during execution
- Execution Risk: Transactions may fail or revert
- Smart Contract Risk: Potential vulnerabilities in smart contracts
- Infrastructure Risk: Platform or network outages
- Financial Risk: Users can lose funds in unsuccessful arbitrage attempts
- Regulatory Risk: Changing regulatory environments
Arbellar employs multiple safety mechanisms but cannot eliminate all risks. Users should only participate with funds they can afford to lose.
| Phase | Product Area | Backend Responsibility | Status |
|---|---|---|---|
| Phase 1 | Core MVP | API, market intelligence, opportunity architecture, risk, execution boundaries, persistence | Current |
| Phase 2 | Multi-DEX & Multi-Asset | Expanded market sources, assets, risk profiles, analytics | Planned |
| Phase 3 | AI Strategy & Automation | AI orchestration boundaries, multi-hop strategies, alerts | Planned |
| Phase 4 | Flash Loans & Governance | Liquidity pools, flash-loan APIs, token/governance services | Planned |
This repository uses pnpm for package and dependency management. npm and yarn are not supported.
pnpm installpnpm devpnpm buildpnpm lint # Run ESLint
pnpm lint:fix # Fix ESLint issues
pnpm typecheck # TypeScript type checking
pnpm format # Format code with Prettier
pnpm format:check # Check formattingpnpm test # Run tests once
pnpm test:watch # Run tests in watch mode
pnpm test:coverage # Run tests with coveragepnpm startdocker-compose up # Start development environment
docker-compose up -d # Start in detached mode
docker-compose down # Stop development environment- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For technical support or questions:
- Create an issue in this repository
- Join our Discord community (coming soon)
- Follow updates on Twitter/X (coming soon)
Disclaimer: Arbellar is an experimental platform. Use at your own risk. The team is not responsible for any financial losses incurred while using the platform.