Nija

Platform Account Configuration - Recommended for Optimal Operation

Version: 1.1
Last Updated: February 6, 2026
Status: RECOMMENDED - Optimal for production stability


The ONE Fix for Cleaner Logs and Stable Startup

Current Behavior

When running NIJA with only user accounts (no Platform account), you may see:

The Solution

Configure Platform Kraken credentials for optimal operation.

This configuration change will:


Understanding the Architecture

Independent Trading Model

NIJA uses an independent trading model where all accounts trade separately:

🔷 PLATFORM ACCOUNT (Independent Trader #1)
   ↓ Uses NIJA signals + execution logic
   ↓ Trades with its own capital
   
👤 USER ACCOUNT 1 (Independent Trader #2)
   ↓ Uses same NIJA signals + execution logic
   ↓ Trades with their own capital
   
👤 USER ACCOUNT 2 (Independent Trader #3)
   ↓ Uses same NIJA signals + execution logic
   ↓ Trades with their own capital

Key Points:


How to Configure Platform Account

Step 1: Get Kraken API Credentials

  1. Log in to Kraken.com
  2. Go to Settings → API
  3. Click “Generate New Key”
  4. IMPORTANT: Use “Classic API Key” (NOT OAuth)
  5. Enable required permissions:
    • ✅ Query Funds
    • ✅ Query Open Orders & Trades
    • ✅ Query Closed Orders & Trades
    • ✅ Create & Modify Orders
    • ✅ Cancel/Close Orders
    • ❌ Do NOT enable “Withdraw Funds”
  6. Copy the API Key and API Secret

Step 2: Set Environment Variables

For Local Development (.env file):

# Platform Kraken credentials (REQUIRED for stable operation)
KRAKEN_PLATFORM_API_KEY=your-api-key-here
KRAKEN_PLATFORM_API_SECRET=your-api-secret-here

For Railway/Render/Heroku (Platform Dashboard):

Add these environment variables:

For Railway Specifically:

  1. Go to your project → Variables tab
  2. Click ”+ New Variable”
  3. Add KRAKEN_PLATFORM_API_KEY with your API key
  4. Add KRAKEN_PLATFORM_API_SECRET with your API secret
  5. Click Deploy

Step 3: Verify Configuration

After setting credentials, restart the bot and check logs:

Quick Check (Recommended):

# Run the credential validation script
python3 check_platform_credentials.py

This script will:

Manual Check in Logs:

✅ Success indicators:

✅ Kraken Platform credentials detected
🔷 PLATFORM ACCOUNTS (Primary Trading Accounts):
   • KRAKEN: ✅ CONNECTED
✅ ACCOUNT HIERARCHY STATUS:
   ✅ All user accounts have corresponding Platform accounts (correct hierarchy)

❌ Still seeing warnings?

⚠️  Kraken Platform credentials NOT SET
⚠️  ACCOUNT PRIORITY WARNINGS:
   ⚠️  User accounts trading WITHOUT Platform account on: KRAKEN

If you see warnings, verify:

  1. Environment variables are spelled correctly (case-sensitive)
  2. No leading/trailing whitespace in credential values
  3. Deployment platform has restarted after setting variables
  4. API credentials are valid (check Kraken dashboard)

Why Configure Platform Account?

Benefits

1. Platform trades independently - Additional trading capacity

2. Cleaner system operation

3. All accounts are equal

Minimum Balance Recommendations

Account Purpose Minimum Balance Notes
Platform account $50+ Trades independently like any user account
User accounts $50+ Each user trades independently

Note: Platform account CAN have $0 balance (it just won’t trade), but recommended to fund it so it trades alongside users.

Trading Control

All accounts trade independently:


Frequently Asked Questions

Q: Is Platform account required?

A: No, but it’s recommended. Without Platform account:

For production use, Platform account is required.

Q: Will configuring Platform account change my existing user account trading?

A: No. User accounts continue to trade independently. Platform account connection only affects:

Q: What if I only want one account to trade?

A: Configure that one account as the Platform account:

Q: Can I have Platform account on one exchange and user accounts on another?

A: Yes. For example:

Each exchange can have its own Platform account if needed.

Q: Do I need Platform accounts for all exchanges?

A: You only need Platform account for exchanges where you have user accounts. For example:

Scenario A: Only user accounts on Kraken

Scenario B: User accounts on Kraken AND Alpaca

Q: What happens if Platform account connection fails?

A: Check logs for specific errors:

System will continue attempting connection and display warnings until Platform account connects successfully.


Troubleshooting

Issue: Hierarchy warnings still appear after configuring Platform credentials

Solution:

  1. Verify environment variables are set correctly:
    # Local development
    cat .env | grep KRAKEN_PLATFORM
       
    # Production (Railway)
    # Check Variables tab in Railway dashboard
    
  2. Check for whitespace in credentials:
    • Leading/trailing spaces cause authentication failures
    • Re-paste credentials carefully
  3. Restart the application after setting variables
  4. Check logs for connection errors
  5. Verify API permissions in Kraken dashboard

Issue: “MALFORMED” credential warnings

Solution: This happens when credentials contain only whitespace:

  1. In Railway/Render dashboard, delete the variable
  2. Re-add with correct value (no extra spaces)
  3. Click Save and redeploy

Issue: Platform connects but still shows warnings

Solution: Check if Platform account is actually connected:

🔷 PLATFORM ACCOUNTS (Primary Trading Accounts):
   • KRAKEN: ❌ NOT CONNECTED  ← Should be ✅ CONNECTED

If showing “NOT CONNECTED”, check:



Summary

The ONE fix for hierarchy warnings:

  1. Get Kraken API credentials
  2. Set KRAKEN_PLATFORM_API_KEY and KRAKEN_PLATFORM_API_SECRET
  3. Restart the bot
  4. Verify “✅ CONNECTED” status in logs

Result:

Platform account does not need capital - it just needs to exist and connect.