Complete guide for deployment verification and transparent trade decision logging
# REQUIRED: Kraken Platform Credentials
KRAKEN_PLATFORM_API_KEY=<your-64-char-api-key>
KRAKEN_PLATFORM_API_SECRET=<your-88-char-api-secret>
# REQUIRED: Trading Safety
LIVE_CAPITAL_VERIFIED=true
# REQUIRED: Heartbeat Verification (enable temporarily)
HEARTBEAT_TRADE=true
HEARTBEAT_TRADE_SIZE=5.50
HEARTBEAT_TRADE_INTERVAL=600
Watch for heartbeat execution (~10 minutes):
❤️ HEARTBEAT TRADE ENABLED: $5.50 every 600s
...
❤️ HEARTBEAT TRADE EXECUTION
✅ Heartbeat trade #1 EXECUTED
Update Railway environment variable:
HEARTBEAT_TRADE=false
That’s it! Full details below.
This guide covers the new features added to NIJA for deployment verification and enhanced transparency:
Heartbeat trades are minimal-size test trades ($5.50) that verify:
Add to .env or set as environment variables:
# Enable heartbeat trading
HEARTBEAT_TRADE=true
# Trade size in USD (default: $5.50 - minimum viable)
HEARTBEAT_TRADE_SIZE=5.50
# Interval between heartbeat trades in seconds (default: 600 = 10 minutes)
HEARTBEAT_TRADE_INTERVAL=600
Step 1: Enable Heartbeat
# In Railway/Render environment variables:
HEARTBEAT_TRADE=true
Step 2: Deploy and Monitor Logs
❤️ HEARTBEAT TRADE ENABLED: $5.50 every 600s
...
❤️ HEARTBEAT TRADE EXECUTION
Symbol: BTC-USD
Size: $5.50
Broker: KRAKEN
Purpose: Verify connectivity & order execution
✅ Heartbeat trade #1 EXECUTED
Order ID: ABC123
Status: filled
Step 3: Verify Trade Executed Check exchange transaction history for the small order.
Step 4: Disable Heartbeat
# After confirming execution:
HEARTBEAT_TRADE=false
⚠️ Production Usage:
✅ Best Practice:
💡 Auto-Disable Recommendation: While the bot won’t auto-disable heartbeat, you should:
Provides transparent logging of why the bot decided NOT to execute a trade. This builds trust and helps diagnose trading issues.
Every time a trade is vetoed (blocked), the bot logs:
🚫 TRADE VETO: KRAKEN not connected
Reason: Exchange API connection failed
🚫 TRADE VETO: KRAKEN in EXIT-ONLY mode
Reason: No new positions allowed (exit only)
🚫 TRADE VETO: KRAKEN balance $8.50 < $10.00 minimum
Reason: Insufficient balance for minimum trade size
🚫 TRADE VETO: KRAKEN balance fetch failed: timeout or error
Reason: Could not verify account balance
The bot tracks vetoed trades per session:
📊 Vetoed Trades (Session): 12
📋 Last Veto Reason: KRAKEN balance $8.50 < $10.00 minimum
Displays current account status at the start of each trading cycle, providing real-time visibility into:
======================================================================
📊 USER STATUS BANNER
======================================================================
💰 KRAKEN Balance: $127.50
📈 Active Positions: 3
✅ Trading Status: ACTIVE
❤️ Heartbeat: Last trade 245s ago (1 total)
======================================================================
When trades are vetoed:
======================================================================
📊 USER STATUS BANNER
======================================================================
💰 KRAKEN Balance: $8.50
📈 Active Positions: 0
🚫 Trading Status: VETOED
📋 Last Veto Reason: KRAKEN balance $8.50 < $10.00 minimum
📊 Vetoed Trades (Session): 5
======================================================================
In Railway dashboard, add:
KRAKEN_PLATFORM_API_KEY=<your-api-key>
KRAKEN_PLATFORM_API_SECRET=<your-api-secret>
HEARTBEAT_TRADE=true
HEARTBEAT_TRADE_SIZE=5.50
HEARTBEAT_TRADE_INTERVAL=600
LIVE_CAPITAL_VERIFIED=true
Railway will automatically:
start.shWatch Railway logs for:
✅ KRAKEN (Platform) - PRIMARY BROKER:
✅ Configured (Key: 64 chars, Secret: 88 chars)
❤️ HEARTBEAT TRADE ENABLED: $5.50 every 600s
📊 USER STATUS BANNER
💰 KRAKEN Balance: $150.00
✅ Trading Status: ACTIVE
Once you see:
❤️ HEARTBEAT TRADE EXECUTION
✅ Heartbeat trade #1 EXECUTED
Update environment variable:
HEARTBEAT_TRADE=false
Railway will automatically redeploy with heartbeat disabled.
Symptoms: No heartbeat trade after 10 minutes
Checks:
HEARTBEAT_TRADE=true in environmentHEARTBEAT_TRADE_SIZESymptoms: Status shows “VETOED” every cycle
Common Causes:
KRAKEN_PLATFORM_API_KEY and SECRET are set correctlySolution: Check veto reason in status banner, address the specific issue.
Symptoms: No status banner in logs
Checks:
trading_strategy.py imported successfully⚠️ API Key Security:
.env file to version control⚠️ Heartbeat Cost:
These features enhance trust and transparency in NIJA’s autonomous trading operations.