Nija

Platform Account Configuration - Required for Full Operation

Version: 1.2
Last Updated: March 2026
Status: REQUIRED β€” without Platform account, new entries are blocked (standalone mode)


The ONE Fix for Full Trading Operation

Current Behavior (Platform Account Missing)

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

How to Restore Full Trading

Step 1: Connect Platform Kraken Account

Set the following environment variables for your Platform Kraken account:

KRAKEN_PLATFORM_API_KEY=<your-platform-api-key>
KRAKEN_PLATFORM_API_SECRET=<your-platform-api-secret>

Step 2: Restart NIJA

After setting the variables, restart the bot:

./start.sh

Result:

Step 3: Monitor Exit Cycles

While you are in standalone mode (before Platform account is connected), NIJA automatically manages your existing positions for profit exits and risk:


Understanding Standalone Mode

When the Platform account is not connected and a user account is connected, NIJA automatically enforces standalone mode (RECOVERY) for the affected user:

⚠️  HIERARCHY ISSUE β€” STANDALONE MODE ACTIVE
   Platform account NOT connected: KRAKEN
   User accounts are temporarily acting as primary.
   πŸ”’ NEW ENTRIES BLOCKED (exits still work).
      Connect the Platform account first, then configure users as secondary.

Standalone mode means:

This protects capital and prevents incorrect exposure while the hierarchy is misconfigured.


Understanding the Architecture

Primary / Secondary Structure

NIJA enforces a strict account hierarchy:

πŸ”· PLATFORM ACCOUNT (PRIMARY)
   ↓ Must be connected first
   ↓ Routes trades and maintains correct exposure limits
   ↓ Enables unified reporting and risk aggregation
   ↓ Enables capital orchestration

πŸ‘€ USER ACCOUNT (SECONDARY)
   ↓ Connects after Platform
   ↓ Adopts positions and risk limits from Platform context
   ↓ Trades with its own capital under Platform oversight

Without Platform account:


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 new entries)
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
βœ… HIERARCHY VALID: Platform is PRIMARY, all users are SECONDARY

❌ Still in standalone mode?

⚠️  HIERARCHY ISSUE β€” STANDALONE MODE ACTIVE
   Platform account NOT connected: KRAKEN
   πŸ”’ NEW ENTRIES BLOCKED (exits still work).

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)

Frequently Asked Questions

Q: Is Platform account required?

A: Yes, for new entries. Without Platform account:

For full trading capability, Platform account is required.

Q: What happens to my existing positions while in standalone mode?

A: NIJA continues to manage them automatically:

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

A: No disruption to existing positions. Platform account connection:

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 if Platform account connection fails?

A: Check logs for specific errors:

System will continue attempting connection and display warnings until Platform account connects successfully. Users remain in standalone mode (exits only) until Platform connects.


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:



Quick Reference

Restore Full Trading in 3 Steps

1. Set KRAKEN_PLATFORM_API_KEY=<key>
2. Set KRAKEN_PLATFORM_API_SECRET=<secret>
3. Restart NIJA

Result:

While in Standalone Mode

NIJA automatically monitors your existing positions: