🏛️

# Exchange Integration

Connect to KuCoin, Binance, XT, Kraken, and other exchanges

Need Help?

For additional support, visit our Support Center

## KuCoin Exchange

### API Configuration

#### KuCoin API Credentials

`KUCOIN_API_KEY="your_api_key" KUCOIN_SECRET_KEY="your_secret_key" KUCOIN_PASSPHRASE="your_passphrase" KUCOIN_ENVIRONMENT="sandbox" # or "live"`

Get these credentials by following the setup guide below.

### How to Create KuCoin API Keys

Reference

Based on official KuCoin documentation: KuCoin API Creation Guide

#### Step 1: Access API Management

1. Log in to www.kucoin.com
2. Click on your avatar in the top-right corner
3. Select API Management from the dropdown menu
4. Click Create API

#### Step 2: Configure API Settings

1. Choose API Trading option
2. Enter a descriptive API Name (e.g., "V5 Exchange Provider")
3. Create a strong API Passphrase (save this securely - you'll need it later)
4. Enable all permissions needed for trading:

Required Permissions:

- ✅ General - Basic account information
- ✅ Spot Trading - Spot market trading
- ✅ Withdrawal

#### Step 3: Security Configuration

Important Security Settings:

1. Whitelist your VPS IP address to secure access to the exchange APIs
2. Enable IP whitelist restriction
3. Save your API passphrase in a secure location
4. Never share your API credentials

#### Step 4: Complete Verification

1. Enter your trading password
2. Complete email verification with the code sent to your email
3. Complete Google 2FA verification (if enabled)
4. Click Confirm to create the API

#### Step 5: Save Your Credentials

Once created, you'll receive:

- API Key - Copy and save securely
- Secret Key - Copy and save securely (shown only once)
- Passphrase - The one you created earlier

⚠️ Warning:

The secret key is shown only once. Make sure to copy and store it securely before closing the window.

## Binance Exchange

### Binance API Configuration

#### API Keys

`BINANCE_API_KEY="your_binance_api_key" BINANCE_SECRET_KEY="your_binance_secret_key" BINANCE_TESTNET="true" # false for mainnet`

Get these credentials by following the setup guide below.

### How to Create Binance API Keys

Reference

Based on official Binance documentation: Binance API Creation Guide

#### Step 1: Access API Management

1. Log in to www.binance.com
2. Click on your profile icon in the top-right corner
3. Select API Management from the dropdown menu
4. Click Create API

#### Step 2: Choose API Type & Set Label

1. Select System generated API key type
2. Enter a descriptive API key label (e.g., "V5 Exchange Provider")
3. Click Next

#### Step 3: Complete Security Verification

1. Complete Email Verification - Enter the code sent to your email
2. Complete Phone Verification - Enter the SMS code
3. Complete 2FA Verification - Enter your Google Authenticator code
4. Click Submit

#### Step 4: Configure API Permissions

Enable all required permissions for your trading needs:

Required Permissions:

- ✅ Enable Reading - View account data
- ✅ Enable Spot & Margin Trading - Place and manage orders
- ✅ Enable Withdrawals

#### Step 5: IP Access Restriction

Critical Security Step:

1. Enable "Restrict access to trusted IPs only"
2. Add your VPS server IP address to the whitelist
3. Enter your server's public IP address in the IP whitelist field
4. This ensures only your server can access the API

How to find your VPS IP:

- Run `curl ifconfig.me` on your server
- Or check your VPS provider's dashboard
- Use the public/external IP, not the private IP

#### Step 6: Save Your API Credentials

After completing the setup, you'll receive:

- API Key - Your public identifier
- Secret Key - Your private key (shown only once)

⚠️ Important:

Your Secret Key will be displayed only once. Make sure to copy and store it securely immediately.

## XT Exchange

### XT API Configuration

#### API Keys

`XT_API_KEY="your_xt_api_key" XT_SECRET_KEY="your_xt_secret_key" XT_ENVIRONMENT="live"`

Get these credentials by following the setup guide below.

### How to Create XT API Keys

Reference

Based on CryptoRobotics guide: XT API Creation Guide

#### Step 1: Create XT Account

1. Go to XT.com
2. Click the "Sign Up" button in the upper right corner
3. Fill in the registration form:
   - Enter your email address
   - Create a secure password
   - Click "Sign Up"
4. Complete email verification with the confirmation code
5. Complete account verification (KYC) as required

#### Step 2: Access API Management

1. Log in to your XT account
2. Find your account button and select API Management
3. Click on the "Create API" button

#### Step 3: Configure API Settings

1. Set an optional name for the new API key in the Alias Name field (e.g., "V5 Exchange Provider")
2. Enable required permissions for trading:

Required Permissions:

- ✅ Spot Trading - Essential for spot market trading
- ✅ Margin Trading - Required for margin trading
- ✅ Withdrawal - Required for platform functionality

Important:

You must enable all the required permissions above for the V5 platform to function properly.

#### Step 4: Security Configuration

Critical Security Steps:

1. Whitelist your VPS IP address to secure access to the exchange APIs
2. Enable IP whitelist restriction for API access
3. Never share your API credentials with anyone

How to find your VPS IP:

- Run `curl ifconfig.me` on your server
- Or check your VPS provider's dashboard
- Use the public/external IP, not the private IP

#### Step 5: Complete Verification

1. Enter the confirmation code sent to your email
2. Click "Confirm" to create the API

#### Step 6: Save Your API Credentials

After creation, you'll receive:

- API Key - Copy and save securely
- Secret Key - Copy and save securely (shown only once)

⚠️ Critical:

The secret key will be shown only once. Make sure to copy and store it securely before closing the window.

#### Step 7: Fund Your Account

Important Note:

To trade on the V5 platform, you need to have your funds in an XT exchange spot account. Make sure to transfer funds to your spot trading account after setting up the API.

## Account Security Requirements

### Exchange Account Prerequisites

#### 🚨 Critical Account Requirements

1

##### Use Fresh Exchange Accounts Only

Never use existing accounts with transaction history. Create brand new accounts on exchanges specifically for the V5 platform. This prevents any potential issues with previous trading activities or account flags.

2

##### Enable Deposit Expiration Settings

Configure automatic deposit expiration in your exchange settings. This adds an extra security layer by automatically expiring unused deposit addresses after a specified time period.

#### ✅ Account Setup Checklist

- Create new exchange account
- Verify account fully (KYC)
- Enable 2FA authentication
- Configure deposit expiration
- Set strong account passwords

#### ❌ What to Avoid

- ✗ Using existing trading accounts
- ✗ Accounts with past violations
- ✗ Shared or borrowed accounts
- ✗ Accounts without 2FA enabled
- ✗ Using weak passwords

#### 💡 Why Fresh Accounts Matter

- • Clean slate - No previous trading patterns or flags
- • Security - No risk of compromised historical data
- • Compliance - Easier to track and audit all transactions
- • Support - Easier to get exchange support for new accounts
- • API limits - Fresh accounts often have better API rate limits

## Security Best Practices

### Essential Security Measures

#### 🔒 Critical Security Requirements

- • Always whitelist your VPS IP address - Never allow unrestricted IP access
- • Enable all required permissions but avoid withdrawal permissions unless absolutely necessary
- • Store API credentials securely - Use environment variables, never hardcode in source code
- • Regular monitoring - Check API activity logs regularly for suspicious behavior

#### API Permissions Checklist

- ✅ Reading/Viewing permissions
- ✅ Spot trading permissions
- ✅ Withdrawal permissions

#### IP Security

- ✅ Whitelist VPS server IP
- ✅ Enable IP restrictions
- ✅ Monitor access logs
- ❌ Allow unrestricted access
- ❌ Use dynamic IPs

#### ⚠️ Important Notes

- • Test all API connections with small amounts first
- • Keep backup copies of your API credentials in secure storage
- • Regularly rotate API keys as a security best practice
- • Monitor your account balance and trading activity
- • Set up account alerts for suspicious activity

## Apply Configuration Changes

### Apply Exchange Configuration

After configuring exchange integrations, apply the changes to your production environment:

Important

Exchange API configuration changes require running the updator to take effect.

#### Run the updator command

`pnpm updator`

This will apply your new exchange configuration to the production environment.