Horizon is a complete solution for managing PTN miners and exchange connectivity. Horizon is produced and maintained by Taoshi.
- Real-time order monitoring
- Automated order-to-signal conversion
- Dynamic leverage calculation
- WebSocket status updates
- Multi exchange support
- Modular exchange integration
Miner Management
- Start/stop miners
- Real-time log viewing
Order Monitoring
- Live order feed
- Status tracking
- Error reporting
Architecture
/
├── watcher/ # Exchange monitoring service
│ ├── modules/
│ │ ├── app/ # Core application logic
│ │ ├── ccxt/ # Exchange integration
│ │ ├── miner/ # Miner management
│ │ ├── order/ # Order processing
│ │ └── websocket/ # Real-time updates
│ └── routes/ # API endpoints
├── easy-miner/ # Web interface
│ ├── app/ # Next.js application
│ │ ├── actions/ # Server actions
│ │ └── store/ # State management
│ ├── components/ # UI components
│ └── features/ # Feature modules
└── config/ # Configuration files
- Node.js 20+
- Python 3.8+
- PTN installed and configured
- Exchange API credentials
- Clone the repository
git clone https://github.com/taoshidev/horizon.git
cd horizon
To install all dependencies and set up the environment, simply run:
./start.sh
You can proceed to step 4.
Add Easy Miner (optional):
git submodule update --init --remote --merge
- Install Watcher:
npm install
- Install Easy Miner
cd /easy-miner
npm install
- Configure the project:
cp config/default.example.json config/default.json
- Update configuration:
{
"port": 8080,
"signal-server": "http://127.0.0.1:3005",
"ptn-path": "/path/to/your/ptn",
"exchange": "",
"[exchange-id]": {
"apiKey": "your-api-key",
"secret": "your-secret",
"market": "future", // Optional
"password": "", // If required by exchange
"demo": false // Other params
}
}
Start both components:
npm run dev
Start individually:
# Watcher only
node index.js --exchange [exchange-id]
# Easy Miner only
cd easy-miner && npm run dev
The application automatically starts watching orders on the configured exchanges and processes them into signals.
- Create exchange module (
/watcher/modules/exchanges/[exchange-id].js
):
export function transformOrder(order) {
return {
trade_pair: TradePair[formatSymbol(order)],
order_type: determineOrderType(order),
};
}
export function configureExchange(exchange, config) {
// Configure sandbox mode if supported
if (typeof exchange.set_sandbox_mode === "function") {
exchange.set_sandbox_mode(config.demo);
}
// Add any exchange-specific configuration
}
// Optional: Custom options for CCXT initialization
export function getOptions() {
return {
defaultType: "future", // Or other CCXT options
};
}
- Add to exchange registry (
./watcher/modules/exchanges/index.js
):
import * as customExchange from "./[exchange-id].js";
const exchangeModules = {
[exchange-id]: customExchange,
};
Signal Processing
File: ./watcher/modules/orders/toSignal.js
Converts orders and balances into signals:
export function toSignal({ id, order, balance }) {
const leverage = calculateLeverage(order, balance);
return {
trade_pair: order.info.symbol,
order_type: order.side.toUpperCase() === "BUY" ? "LONG" : "SHORT",
leverage,
};
}
npm run build
npm start
- Fork the repository
- Create a feature branch
- Submit a pull request
Ensure your PR:
- Includes tests
- Updates documentation
- Maintains code style
- Has clear description
MIT License
- GitHub Issues
- Discord: Join
- Email: support@taoshi.io
Built by Taoshi