Skip to content
Roberto Mladina
Local time in Ingolstadt:
DE – Deutsch EN – English

Project · since 09/2026

Portfolio platform

This is my biggest project. A platform is meant to run my portfolio, from market watch through risk, trading and accounting all the way to tax. It should present every order to me on my phone for approval. No real money is flowing yet. That only comes in the last phases of the plan, and even then only my approval triggers an order.

Warning: Plan finished, build on hold since 12 Oct 2026

Cockpit · Order for approval Replica · planned
The path of an order, stopped at my approval, as a replica
StepStatus
Proposal from the portfolio managerfixed rules met
My approvalwaiting for me
Risk checkafter that
Placing the order in the simulatorafter that
Bookingafter that

This is how the cockpit is meant to present an order to me for approval, at first only in the simulator without real money. A replica of how it is planned.

In short

Minutes per week instead of hours per day

The problem

My first attempt, the Portfolio Manager, took too little work off my hands. For the rest I would need 3 to 4 hours a day.

My approach

I planned from scratch and had a second AI model attack the plan for 18 rounds. The build happens in small steps. Trading happens first in the simulator, which only calculates orders, then on a paper trading account with play money, and only at the very end with real money.

Today

The old Portfolio Manager keeps running, without real money. For the new platform, a first part of the foundation is in place.

In numbers · the build has been on hold since 12 Oct 2026

18review rounds in which a second model attacked the plan before any code was writtenAs of 12 Oct 2026
15of 69 work steps done. The plan is in place, the build is still at the beginning.As of 12 Oct 2026
577tests, all passing. They check the foundation built so far.As of 12 Oct 2026
25decisions, recorded with the alternatives I rejectedAs of 12 Oct 2026

It is built with Python, FastAPI and PostgreSQL, the app with TypeScript.

Terms on this page
Order
An instruction to buy or sell a security.
Approval
My yes to a single order. Without it, no order is triggered.
Simulator
A program that only calculates orders, with no stock exchange and no money.
Paper trading account
An account with play money at a broker, meaning a provider for trading on the stock exchange.
Live account
The account with real money, only after the simulator and the paper trading account.
Money path
Everything that changes money or holdings, from the order to the booking.
Kill switch
Blocks trading and cancels open orders, but can never trigger an order itself.
Passkey
Signing in with a fingerprint or a device instead of a password.
Cross-check
A second AI model looks specifically for mistakes. One round of this on the plan is called a review round.
Finding
Something the cross-check found, rated from critical through high and medium to low (explained in AI way of working).
Work session
A block of work with the AI agents, about 2.5 hours long.
Opus, Sonnet, Haiku, Fable
AI models. Opus, the strongest Claude model, builds. Sonnet is a mid-range model. Haiku is fast and cheap and searches. Fable is a different model and tries to disprove results.

Why a portfolio, of all things

A realistic test for AI agents

I chose this project on purpose, because it is so complex and because it is about money. That makes it a realistic test for AI agents. Mistakes are still allowed to happen, because no real money is involved until the end. Almost everything that makes software hard comes together here:

Data

Prices are only added and never overwritten. That way I can later trace every decision with the data from that time. On top of that come dividends, several currencies and the calendars of the stock exchanges.

Money paths

A booking happens completely or not at all, even when several parts access it at the same time. The accounting has to add up to the cent when recalculated.

Risk

A separate area for risk has fixed limits and can stop any order. The kill switch can only block and never trade itself.

Security

Approvals use a passkey, meaning a fingerprint or a device instead of a password. On top of that there is protection, even against my own agent.

Infrastructure

The parts run separately, depending on how much I trust them. If a new version fails, the previous one comes back automatically. The backup is restored as a test.

Tax

This includes German fund taxation, a yearly calendar and questions for the tax advisor.

My own agent is a risk too

The threat model also takes my own AI agent into account. A threat model describes who or what can harm the platform. I assume that my own agent can make mistakes or be tricked. That is why it should be technically impossible for it to reach real money.

Backstory

The backstory: the Portfolio Manager

Before that I built the Portfolio Manager as part of my dashboard. It was meant to take work off my hands, but above all I wanted to learn from it. It was about fixed workflows, about skills, meaning written instructions for the AI, and about knowledge management, operations and infrastructure.

  1. Start of the Portfolio Manager

    without real money from day one

  2. It grows

    to include risk monitors, approvals with a log of every step and daily status reports

  3. Three and a half months without a single paper trade

    I refocus it. Now fixed rules decide based on metrics, and the AI only explains why.

  4. Taking stock

    I take stock of the old system and decide to plan from scratch.

“Otherwise this is just a mini portfolio manager for me, and I have to work out the rest myself every day. But that would be 3 to 4 hours of work a day, and I don’t have those. I would rather put them into software projects.”

my verdict on the old system, 26 Sep 2026

Even so, it was not a failure. What I learned from it is part of all my projects today.

Way of working

  • “Done” means tested, deployed and checked on the running system. This has applied since a report turned out to be overconfident in June.
  • Tasks with serious consequences get a cross-check by a second model.

Knowledge

  • I record decisions in a knowledge graph, my collection of notes as linked files.
  • Memory lives in files, not in the chat.

Operations

  • There are fixed schedules and an encrypted backup every night, which is also restored as a test.
  • During a merge, 65 files got lost. I only noticed because I had counted the files before and after. Since then I recount.

Principles that stay

  • The server decides whether something may be approved, not the user interface.
  • If data is missing or out of date, the system shows it and blocks. It does not quietly fill anything in.

The rebuild

Starting over instead of building on

I took a close look at the old system. There I could only have got clean boundaries between its parts with permanent exceptions, and “half finished” would have stayed the normal state. A few examples, and next to them the new platform as it is planned:

The old Portfolio Manager

Data
All parts wrote to the same database file, and every part could overwrite everything.
Account balance
It was calculated separately in four places.
Risk
The figures came from sources that contradicted each other. A limit for daily loss never took effect.
Kill switch
Tests checked a kill switch path that the program no longer used.

The new platform, as it is planned

Data
Separate areas in the database. Whatever comes from outside, the AI included, can never write anything in the money path.
Account balance
Accounting is the sole authority for money and holdings.
Risk
A separate area with fixed limits can stop any order.
Kill switch
It can only block and never trade itself. Before real money there is a test of the kill switch.
The old system and the new platform as it is planned, as of 12 Oct 2026

The new platform is one single program, with the domains clearly separated. Many small separate services would be too much work for me alone.

Structure

How the platform is built

The simulator, the paper trading account and the live account keep separate books. When switching, only the connection changes, and the code of the domains stays the same.

  1. Me

    Every order needs my approval in the cockpit, the app on my phone. With real money I also confirm by passkey, and the approval is checked a second time, independently.

  2. Domains

    Market watch, portfolio manager, risk and control, trader, accounting, tax, reference and market data and the cockpit. Risk and control can stop any order. Accounting is the sole authority for money and holdings.

  3. The money path

    This is where money and holdings change, and every booking happens completely or not at all. Whatever comes from outside, the AI included, can never write anything in the money path.

  4. Running parts, separated by trust

    The user interface, the money path, outside data and the broker connection run separately. Outside data covers everything external, including the AI. Each account gets its own connection to the broker.

  5. Foundation underneath, without business rules

    Underneath there is a foundation without business rules: messages, scheduler, identity, evidence, backup and costs.

All interfaces between the parts are described in one place. Code and checks are generated from this description automatically.

Try it out · this is the plan

The path of an order

This is how an order is meant to pass through the platform once trading is built. Pick a case.

  1. Proposal The portfolio manager proposes an order when fixed rules are met. The AI decides nothing and books nothing.
  2. My approval in the cockpit I approve every order myself. With real money I also confirm by passkey.
  3. Risk check It checks limits, available money and whether the data is fresh. If it says no, I cannot overrule it.
  4. Placing the order The order goes to the simulator, the paper trading account or later to the live account. The money for it is reserved.
  5. Booking After execution, money and holdings change in one booking, completely or not at all.
  • All in order The order is executed and booked. Afterwards, money and holdings match.
  • I say no Without my approval, no order is created.
  • The risk check says no The reasons show up in the cockpit right away. I cannot overrule the check. I can only change a limit deliberately.
  • The kill switch is pulled Then I cannot approve a purchase. The kill switch cancels open orders, but it can still allow selling. Only I can lift it.
  • An agent tries to book directly Whatever comes from outside, the AI included, can never write anything in the money path. The only way to an order is through my approval.
The path of an order in five steps, as it is planned. Trading has not been built yet.

Planning

18 review rounds before any code was written

In each review round, a second AI model attacked the plan before a single line of code was written. From round to round the findings got fewer and less severe. From round five on, there was no high finding left. After 18 rounds, nothing was still open that affected the structure as a whole.

18review rounds on the plan. The line shows the medium findings in five rounds in a row: 8, 7, 5, 5 and 4.Planning done on 27 Sep 2026

Planning

The review rounds would not come to an end

What happened
The number of medium findings fell only slowly from round to round, from 8 to 7, 5, 5 and then 4.
Response
I introduced a new rule for signing off. It asks whether a finding affects the whole structure or only one spot. There was also an upper limit. I removed one difficult mechanism entirely instead of patching it.
Since then
Every review gets a rule in advance for when it ends.

11 Oct 2026

Two high findings in the first small step

What happened
The cross-check found two high findings in the very first small build step. One of them was a test that depended on the current time and could turn out differently depending on when it ran.
Response
I had both fixed before the step counted as done.
Since then
Small steps get the full review too when money is involved.

Decisions

Decisions and why

An app in TypeScript

Instead of
using lean pages served by the server, as the AI had recommended
Because
I wanted an interface that can do more, and later an app for the phone. Here I decided against the recommendation.

Models by task

Instead of
using one model for everything
Because
Opus, the strongest Claude model, builds the core. Sonnet, a mid-range model, only builds in an isolated folder and has to pass fixed tests there. If the cross-check finds clearly more errors with Sonnet than with Opus, I stop doing that. Haiku searches, and Fable tries to disprove the result.

Daily loss only as a warning

Instead of
selling automatically when the daily loss crosses a limit
Because
An automatic sale would sell at exactly the wrong moment.

Real money on a separate computer

Instead of
running everything on one server
Because
No AI that works on the code should ever be able to get at real money.
Status
not decided yet

Status

Where it stands and what comes next

The build has been on hold since 12 October 2026 because I built the Web-Zentrale first.

As of 12 Oct 2026
  1. 11 Oct 2026 first run in its own environment, tested from start to finish
  2. 12 Oct 2026 fixed formats, separate areas in the database, an outbox, 577 tests
  3. Next message dispatcher, scheduler, interface for the app
  4. After that reference data and prices

On 11 October 2026 the platform ran in its own environment for the first time. One command triggered an event, another part reacted to it, and this was tested from start to finish. The next day brought fixed formats in which the parts exchange data, and separate areas in the database. Also new was an outbox that only sends messages once they are saved. Along the way, the number of tests grew from 13 to 577.

Next up are the message dispatcher, the scheduler and the interface for the app, then reference data and prices. Until trading in the simulator replaces it, the old Portfolio Manager keeps running, without real money.

Roadmap

The roadmap in 13 phases

The plan has 69 work steps. Market watch comes before accounting and trading because it is the first to be useful without moving any money. Real money only comes after the simulator and the paper trading account.

As of 12 Oct 2026
  1. Planning in 18 review rounds done 27 Sep 20268 of 8
  2. Immediate fixes to the old Portfolio Manager done 9 Oct 20263 of 3
  3. Foundation and reference data for the securities started, on hold since 12 Oct 20264 of 17
  4. Market watch, first version the first result I use0 of 6
  5. Security, isolating the parts from each other0 of 4
  6. Accounting, recalculated to the cent0 of 5
  7. Trading in the simulator, after which the old Portfolio Manager retires0 of 6
  8. Paper trading account with play money at the broker, four weeks in operation0 of 5
  9. Before real money, approval by passkey and a test of the kill switch0 of 4
  10. Real money, at first only in the core0 of 1
  11. Tax, checked against sample cases with known results0 of 5
  12. Extensions and the full limits0 of 2
  13. App on the phone, one week in daily use0 of 3

✓ done · ! started · – open. The numbers show how many work steps of a phase are complete.

The stop rule

I estimate 158 to 231 work sessions of about 2.5 hours each, so roughly 400 to 580 hours. For the first result, the market watch, it is 43 to 59 sessions or roughly 110 to 150 hours. So that the project does not get out of hand without me noticing, I set in advance when I stop or decide again:

  • At 42 sessions (roughly 105 hours) there is an early warning.
  • If the first result has not been signed off after 65 sessions (roughly 160 hours), it gets at most 15 more (roughly 40 hours).
  • After 80 sessions (roughly 200 hours) I decide again on the whole rebuild.

You can read how I work with the AI agents in AI way of working. The Web-Zentrale shows what I built first. News goes into the logbook (in German).