---
title: Trading & CEX Tools
description: Centralized exchange trading, bots, and automation tools
---
# Trading & CEX Tools
**35+ CEX integrations** with **60+ trading tools** for spot, futures, margin, and automated trading strategies.
## Binance (15 tools)
### Spot Trading
**`binance_get_price`** - Get current price
```typescript
{
symbol: string; // e.g., "BTCUSDT"
}
```
**`binance_place_order`** - Place spot order
```typescript
{
symbol: string;
side: 'BUY' | 'SELL';
type: 'MARKET' | 'LIMIT' | 'STOP_LOSS_LIMIT';
quantity: string;
price?: string; // For limit orders
timeInForce?: 'GTC' | 'IOC' | 'FOK';
}
```
**`binance_cancel_order`** - Cancel order
```typescript
{
symbol: string;
orderId: number;
}
```
**`binance_get_account`** - Get account info
```typescript
{} // Returns balances, permissions
```
### Futures Trading
**`binance_futures_order`** - Place futures order
```typescript
{
symbol: string;
side: 'BUY' | 'SELL';
type: 'MARKET' | 'LIMIT';
quantity: string;
price?: string;
leverage?: number;
positionSide?: 'LONG' | 'SHORT' | 'BOTH';
}
```
**`binance_set_leverage`** - Set leverage
```typescript
{
symbol: string;
leverage: number; // 1-125
}
```
## Coinbase (10 tools)
**`coinbase_get_accounts`** - List accounts
```typescript
{
limit?: number;
}
```
**`coinbase_place_order`** - Place order
```typescript
{
productId: string; // e.g., "BTC-USD"
side: 'buy' | 'sell';
orderType: 'market' | 'limit';
size: string;
price?: string;
}
```
**`coinbase_get_fills`** - Get trade history
```typescript
{
productId?: string;
orderId?: string;
limit?: number;
}
```
## OKX (8 tools)
**`okx_place_order`** - Place order
```typescript
{
instId: string; // Instrument ID
tdMode: 'cash' | 'cross' | 'isolated';
side: 'buy' | 'sell';
ordType: 'market' | 'limit';
sz: string; // Size
px?: string; // Price
}
```
**`okx_get_balance`** - Get balance
```typescript
{
ccy?: string; // Currency (optional)
}
```
## Trading Bots (20 tools)
### Volume Bot
**`create_volume_campaign`** - Create volume generation campaign
```typescript
{
token: string; // Token address (Solana)
targetVolume: string; // Daily volume target
walletCount: number; // Number of wallets to use
strategy: 'random' | 'gradual' | 'burst';
duration: number; // Campaign duration (hours)
}
```
**`start_campaign`** - Start volume campaign
```typescript
{
campaignId: string;
}
```
**`get_campaign_metrics`** - Get campaign stats
```typescript
{
campaignId: string;
}
// Returns: volumeGenerated, tradesExecuted, walletStats
```
### MEV Bot
**`mev_scan_mempool`** - Scan for MEV opportunities
```typescript
{
chainId: number;
minProfit: string; // Minimum profit in ETH
strategies: ('sandwich' | 'arbitrage' | 'liquidation')[];
}
```
**`mev_execute_bundle`** - Execute MEV bundle
```typescript
{
transactions: string[]; // Signed transactions
targetBlock: number;
chainId: number;
}
```
### Arbitrage Bot
**`find_arbitrage`** - Find arbitrage opportunities
```typescript
{
token: string;
dexes: string[]; // DEXs to compare
minProfit: string; // Minimum profit threshold
chainId: number;
}
```
**`execute_arbitrage`** - Execute arbitrage
```typescript
{
buyDex: string;
sellDex: string;
token: string;
amount: string;
flashLoan?: boolean;
}
```
### Sniper Bot
**`snipe_token_launch`** - Snipe token at launch
```typescript
{
tokenAddress: string;
buyAmount: string;
maxGas: string;
slippage: number;
}
```
**`monitor_new_pairs`** - Monitor new liquidity pairs
```typescript
{
dex: 'uniswap' | 'pancakeswap' | 'raydium';
minLiquidity: string;
autoSnipe?: boolean;
}
```
## Usage Examples
### Automated Trading Strategy
```typescript
import { trading } from '@universal-crypto/tools';
// Simple grid trading bot
async function gridTradingBot() {
const symbol = 'BTCUSDT';
const gridLevels = 10;
const gridSize = 100; // $100 per grid
// Get current price
const price = await trading.binance_get_price({ symbol });
// Place buy orders below current price
for (let i = 1; i <= gridLevels; i++) {
await trading.binance_place_order({
symbol,
side: 'BUY',
type: 'LIMIT',
quantity: (gridSize / (price - i * 100)).toString(),
price: (price - i * 100).toString(),
timeInForce: 'GTC',
});
}
// Place sell orders above current price
for (let i = 1; i <= gridLevels; i++) {
await trading.binance_place_order({
symbol,
side: 'SELL',
type: 'LIMIT',
quantity: (gridSize / (price + i * 100)).toString(),
price: (price + i * 100).toString(),
timeInForce: 'GTC',
});
}
}
```
### Cross-Exchange Arbitrage
```typescript
// Monitor price difference between exchanges
async function findArbitrage() {
const symbol = 'BTC-USD';
const [binancePrice, coinbasePrice, okxPrice] = await Promise.all([
trading.binance_get_price({ symbol: 'BTCUSDT' }),
trading.coinbase_get_ticker({ productId: 'BTC-USD' }),
trading.okx_get_ticker({ instId: 'BTC-USDT' }),
]);
// Find best buy and sell
const prices = [binancePrice, coinbasePrice, okxPrice];
const minPrice = Math.min(...prices);
const maxPrice = Math.max(...prices);
const profit = ((maxPrice - minPrice) / minPrice) * 100;
if (profit > 0.5) { // 0.5% profit threshold
console.log(`Arbitrage opportunity: ${profit}%`);
// Execute trades...
}
}
```
### Volume Generation Campaign
```typescript
// Generate volume for token listing
const campaign = await trading.create_volume_campaign({
token: 'TokenMintAddress', // Solana token
targetVolume: '100000', // $100k daily volume
walletCount: 50, // 50 wallets
strategy: 'gradual', // Gradual throughout day
duration: 24, // 24 hours
});
// Start campaign
await trading.start_campaign({
campaignId: campaign.id,
});
// Monitor progress
setInterval(async () => {
const metrics = await trading.get_campaign_metrics({
campaignId: campaign.id,
});
console.log(`Volume: $${metrics.volumeGenerated}`);
console.log(`Trades: ${metrics.tradesExecuted}`);
}, 60000); // Check every minute
```
## Supported Exchanges
| Exchange | Spot | Futures | Margin | WebSocket |
|----------|------|---------|--------|-----------|
| **Binance** | ✅ | ✅ | ✅ | ✅ |
| **Coinbase** | ✅ | ❌ | ✅ | ✅ |
| **OKX** | ✅ | ✅ | ✅ | ✅ |
| **Bybit** | ✅ | ✅ | ✅ | ✅ |
| **Kraken** | ✅ | ✅ | ✅ | ✅ |
| **KuCoin** | ✅ | ✅ | ❌ | ✅ |
| **Gate.io** | ✅ | ✅ | ❌ | ✅ |
| **HTX** | ✅ | ✅ | ✅ | ✅ |
## Bot Strategies
| Bot Type | Complexity | Profit Potential | Risk |
|----------|------------|------------------|------|
| Grid Trading | Low | Medium | Low |
| DCA Bot | Low | Low-Medium | Low |
| Arbitrage | Medium | Medium | Medium |
| MEV | High | High | High |
| Sniper | High | High | Very High |
| Market Maker | High | Medium | Medium |
## Pricing
| Tool Type | Cost | Notes |
|-----------|------|-------|
| CEX API calls | Free | Rate limits apply |
| Market data | Free | Real-time prices |
| Trading bots | $0.001/trade | Platform fee |
| MEV bundles | Free + gas | Flashbots compatible |
## Next Steps
- [Trading Bot Guide](/guides/trading/bots) - Build custom bots
- [Risk Management](/guides/trading/risk) - Safe trading practices
- [API Keys Setup](/guides/trading/api-keys) - Configure exchange APIs
- [Backtesting](/guides/trading/backtest) - Test strategies