AI-Investor

An n8n workflow to analyze crypto investments using AI.





8/8/2025 – Semtex

I was tinkering a lot with the idea of using local LLMs to analyze current crypto status and let it handle and manage a small wallet. See how it performs for a while in percentage refine it then scale it.

Note : I’m not opening the sources for this project, not that it is rocket science nor a new thing, it’s just a POC, easily reproductible but I wouldn’t want people to blindly copy it and lose money. To be fair, I wouldn’t trust it myself so why would you ?

The idea

Instead of coding everything and handling storage, functions, … even if I could do that easily with quite much any language and given that I already have all the services required running either on my jetson or on my workstation in docker containers. I thought it was a good idea to finally use my n8n instance as it’s typically a workflow and I could start to learn it better in a real case scenario.

The target

Buy my first beer- with the profits of this AI-Investor by October 2025.

Architecture

  • n8n: The workflow automation tool.
  • Ollama: The local LLM server.
  • ntfy: The notification service.
  • rss: The RSS feed for crypto news.
  • Binance: The crypto exchange API.

Approach

I’ll keep it very simplistic at first. Every 10 minutes >

I’ll fetch the Binance API for current prices and historical values of a coin.

  • 10m for 24h sliding window.
  • 1h for 30d sliding window.

I’ll edit a bit the payload then send it to the LLM with a prompt asking it to analyze the data and give me a recommendation on what to do with the coin for the next 10m window. He’ll be asked to buy, sell or hold the coing with a reason.

I’ll send the notification to ntfy to notify me of the decision and the reason.

Once I qualified the LLM’s decision, I’ll send it to the Binance API to execute the order.

flowchart LR
    A[Start] --> B[Fetch Binance Market Data]
    B --> C[Edit payload]
    C --> D[Send to LLM with prompt]
    D --> E[Receive recommendation from LLM]
    E --> F[Send notification to ntfy]
    F --> G[Execute order on Binance API]
    G --> H[End]

Implementation

Here is how the workflows look like in n8n:

AI-Investor n8n workflow
AI-Investor workflow
Binance fetch n8n workflow
Binance fetch workflow

Here is the prompt I use to analyze the data:

{{ JSON.stringify($json) }}

Shall I buy or sell with a reason, answer in 10 word, format,
`BUY/SELL/HOLD : REASON`

And the “system message” passed to give some context to the LLM:

You are a trustworthy investor agent. Given the information on input, decide if it is worth buying or selling cryptocurrency.
Stay concise, and answer in a short sentence. you can get information about crypto news on the RSS feed

Your goal will be to micromanage a wallet and optimize its output by buying low and selling higher.
Take your decisions with a 30 minutes forecast, think about your next step and don't sell too fast just to buy again.
You are allowed to hold if it seems the market is bouncing without a significant trend.

I’m pretty sure this agent isn’t using the RSS feed yet, I’ll have to understand this part better and how to integrate it into the workflow.

Here is the result :

Ntfy results
Ntfy results
Binance status
Binance status