Skip to content

[BUG] #1188

@jlfloresTeika

Description

@jlfloresTeika

⚠️ Before submitting: Please check the Troubleshooting Guide (中文版) to see if your issue can be resolved quickly.

🐛 Bug Description

The PnL calculation in the information sent to the AI doesn't match the position PnL information on the exchange.

🔍 Bug Category

Other: The aggregated data to AI prompt is not delivering accurate PnL, the values sent to LLM differs from the values seen on the exchange.

📋 Steps to Reproduce

  1. Watch the bot create a trade
  2. Wait position close for PnL on the next run
  3. PnL prompt is not accurate with exchange data.

✅ Expected Behavior

PnL should be accurate and authoritative source of truth must be exchange data. (Aster tested)

❌ Actual Behavior

The PnL delivered to LLM does not match the exchange position PnL.

📸 Screenshots & Logs

  1. NoFX prompt sent to LLM
Image
  1. Actual exchange position info
Image

📊 Additional Context

Frequency:

  • Happens every time

  • Other: The LLM doesn't recieve accurate PnL data.

💡 Possible Solution

Make exchange data the authoritative source of truth for positions PnL


📝 Quick Tips for Faster Resolution

For Trading Issues:

  1. ✅ Check Binance position mode: Go to Futures → ⚙️ Preferences → Position Mode → Must be Hedge Mode
  2. ✅ Verify API permissions: Futures trading must be enabled
  3. ✅ Check decision logs in decision_logs/{trader_id}/ for AI reasoning

For Connection Issues:
4. ✅ Test API connectivity: curl http://localhost:8080/api/health
5. ✅ Check API rate limits on exchange
6. ✅ Verify API keys are not expired

For UI Issues:
7. ✅ Hard refresh: Ctrl+Shift+R (or Cmd+Shift+R on Mac)
8. ✅ Check browser console (F12) for errors
9. ✅ Verify backend is running: docker compose ps or ps aux | grep nofx

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions