Onflow: a model free, online portfolio allocation algorithm robust to transaction fees

This paper introduces Onflow, a model-free, online reinforcement learning algorithm that optimizes portfolio allocation via gradient flows to maximize expected log returns, demonstrating robustness to high transaction costs and superior performance compared to existing dynamic strategies without requiring assumptions about asset return distributions.

Gabriel Turinici, Pierre Brugiere

Published Fri, 13 Ma
📖 4 min read☕ Coffee break read

Imagine you are the captain of a ship navigating a vast, unpredictable ocean. Your goal is to reach the treasure island (maximum wealth) as fast as possible. However, the ocean has two tricky rules:

  1. The currents change constantly: You don't know if the wind will blow from the north or south tomorrow.
  2. There is a toll for turning: Every time you adjust your sails to face a new wind, you pay a fee. If you turn too often, the fees eat up all your treasure.

For decades, sailors (financial experts) have tried to build maps to predict the currents. Some maps assume the wind blows in a perfect, predictable pattern (like the famous Markowitz model). Others try to learn from the past without assuming a specific pattern (like Cover's "Universal Portfolio").

Enter "Onflow," a new navigation system.

The Core Idea: Flowing Like Water, Not Jumping Like a Frog

Most old navigation systems work like a frog jumping from one lily pad to another. They look at the data, make a big decision, and jump to a new strategy. If the wind changes slightly, the frog jumps again, paying the toll every time.

Onflow is different. It treats your investment strategy like water flowing down a hill.

  • Instead of making sudden, jerky jumps, it gently steers your portfolio in the direction that looks most promising.
  • It uses a mathematical concept called a "gradient flow." Imagine a ball rolling down a hill to find the lowest point. Onflow is like a ball that rolls smoothly toward the highest peak of profit, but it's heavy enough that it doesn't bounce around wildly. It glides.

The "Soft" Steering Wheel (The Softmax)

How does Onflow decide which way to turn? It uses a "Softmax" function. Think of this as a smart, flexible steering wheel.

  • If the wind looks good for Asset A, the wheel turns slightly toward A.
  • If Asset B suddenly looks amazing, the wheel turns more toward B.
  • Crucially, it never locks the wheel in one spot. It keeps the ship moving, but it does so with such smoothness that it avoids the "toll fees" caused by jerky, frequent adjustments.

The Secret Weapon: Ignoring the "Toll" Until Necessary

The paper highlights a major problem: Transaction Fees.

  • Scenario A (No Fees): If turning the wheel is free, Onflow is just as good as the best sailors. It finds the perfect balance of assets, matching the theoretical "best possible" portfolio.
  • Scenario B (High Fees): This is where Onflow shines. Imagine a toll booth that charges you 2% of your ship's value every time you turn the wheel.
    • Old Algorithms (The Frogs): They keep jumping back and forth, trying to catch every tiny wind shift. They pay so many tolls that they arrive at the island with almost no treasure left.
    • Onflow (The Water): It realizes, "Hey, this wind shift is small. If I turn, I'll pay a huge fee. I'll just glide a little bit and wait." It becomes patient. It only turns the wheel when the wind shift is so strong that the profit outweighs the toll.

Real-World Tests: The Old NYSE and Crypto

The authors tested this on two very different oceans:

  1. The "Old NYSE" (1965–1987): They used data from 36 old stocks. Even when they simulated a massive 2% fee (which usually breaks other strategies), Onflow kept the ship moving forward while others crashed or barely broke even.
  2. The "Crypto & Tech" Ocean (2020–2025): They tested it on wild, volatile assets like Tesla, Nvidia, Bitcoin, and Ethereum. These are like storms where the wind changes every second. Even here, Onflow managed to balance the ship, avoiding the fees that would have sunk a more aggressive strategy.

Why This Matters

The beauty of Onflow is that it is model-free.

  • Old way: "I assume the wind follows a bell curve, so I will sail this way." (If the wind breaks the bell curve, you crash).
  • Onflow way: "I don't care what the wind usually does. I just look at where the water is flowing right now and I glide toward it."

The Bottom Line

Onflow is a smart, patient investor. It doesn't try to outsmart the market with complex predictions. Instead, it uses a smooth, continuous motion to adjust its portfolio. It knows when to be aggressive and, more importantly, when to sit still to avoid paying the "turning fees."

In a world where trading fees can kill your profits, Onflow is the strategy that teaches you how to sail smoothly without burning your fuel.