Intro
Introduction to Based Terminal MiniApps
What Are MiniApps?
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
Your MiniApp sends requests via the SDK
Terminal processes requests with proper permissions
Trading Engine executes operations (orders, data requests)
Real-time updates flow back to your MiniApp
Your UI updates to reflect current state
Security Model
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
Permission System - Granular permission controls
Event System - Real-time event subscriptions
Theme Management - Automatic theme synchronization
Error Handling - Comprehensive error types and recovery
Use Cases
Trading Automation
Grid Trading Bots - Automated buy/sell grids for ranging markets
DCA Bots - Dollar cost averaging with custom schedules
Arbitrage Tools - Cross-exchange price difference monitoring
Stop Loss Managers - Advanced stop loss and take profit systems
Analytics and Insights
Portfolio Analyzers - Advanced portfolio tracking and reporting
P&L Calculators - Real-time profit/loss analysis with projections
Risk Meters - Position sizing and portfolio risk assessment
Performance Trackers - Trading statistics and improvement metrics
Market Tools
Custom Scanners - Find trading opportunities based on technical patterns
Alert Systems - Price, volume, and technical indicator alerts
Correlation Analyzers - Asset correlation tracking and visualization
Market Sentiment - Social sentiment and on-chain data aggregation
Educational and Utility
Trading Simulators - Paper trading with real market data
Strategy Backtesting - Test strategies against historical data
Learning Tools - Interactive tutorials and trading guides
Calculators - Position size, leverage, and risk calculators
Entertainment
Video Streaming - Livestream financial events or entertainment
Idle Games - Simple games while waiting for trade execution
Monetization
Developers can monetize their MiniApps through:
CTA-based Revenue - Share of fees from orders placed via your app
Session-based Revenue - Share of fees when your app is open during trading
See the Monetization Guide for detailed information.
Getting Started
Ready to build your first MiniApp? Continue to:
Quick Start Guide - Build your first MiniApp in 5 minutes
Architecture Guide - Understand how MiniApps work at High level
API Reference - Complete API documentation
Monetization - How would you make money
Sample App - Working code examples
Last updated