MiniApps are lightweight, focused applications that run directly within the Based Terminal. They extend the platform's functionality by providing specialized tools, custom interfaces, and automated trading strategies -- all while maintaining seamless integration with the core trading experience.
Think of MiniApps as plugins for traders -- small, powerful applications that solve specific problems or provide unique functionality without leaving the trading environment.
Why Build MiniApps?
Focused Solutions
Instead of building a complete trading platform, create targeted tools that solve specific problems:
Position sizing calculators
Market scanners for specific strategies
Risk management dashboards
Automated DCA (Dollar Cost Averaging) bots
Price alert systems
AI agent chatbots with trade recommendations
Liquidation heatmaps
Data analysis tools for traders
Grid trading bots
Portfolio trackers
Native Integration
MiniApps have direct access to:
Trading Functions -- Place orders, manage positions, cancel trades
Real-time Market Data -- Live prices, order books, trade feeds
Account Information -- Balances, positions, trading history
Wallet Integration -- Access to connected wallet address
Instant Deployment
No separate infrastructure needed
Built-in security and permissions
Automatic updates and distribution
Cross-platform compatibility
Architecture Overview
MiniApps run in sandboxed iframes and communicate with the Based Terminal via the PostMessage API:
Communication Flow
1
Your MiniApp sends requests via the SDK
2
Terminal processes requests with proper permissions
3
Trading Engine executes operations (orders, data requests)
4
Real-time updates flow back to your MiniApp
5
Your UI updates to reflect current state
Security Model
MiniApps use a layered security model to protect users and their data.
Permission-based Access -- Users explicitly grant capabilities
Sandboxed Execution -- MiniApps run in isolated environments
Secure Communication -- All data exchange is validated
User Control -- Users can revoke permissions at any time
SDK Overview
The Based MiniApp SDK provides two main integration paths:
Core SDK (Vanilla JavaScript/TypeScript)
For maximum control and flexibility:
React Integration
For building interactive UIs:
Key Features
Trading Operations
Order Placement -- Market, limit, stop, and stop-limit orders
Batch Operations -- Place or cancel up to 50 orders simultaneously
TP/SL Support -- Take profit and stop loss with price or percentage
Order Management -- Query, modify, and cancel orders
Position Tracking -- Real-time position updates
Market Data
Real-time Prices -- Live market data streaming
Order Book -- Best bid/offer updates
Trade Feed -- Real-time trade executions
Multiple Symbols -- Subscribe to multiple markets simultaneously
Account Management
Balance Information -- Spot and perpetual account balances
Position Data -- Open positions with PnL
Order History -- Query orders by status (open, filled, cancelled, partial)
Wallet Address -- Access connected wallet address
Advanced Features
Type Safety -- Full TypeScript support with discriminated unions