Docs/Friction (Realistic Mode)

Friction (Realistic Mode)

App

What is Friction?

By default, MongoTrader fills your orders instantly at the live price, with no fees. Friction is an optional mode you can switch on per portfolio that makes trading behave like the real world: you pay fees, cross the bid/ask spread, move the price when you trade big, and large orders fill in pieces over time.

It's designed for traders who want their paper results to reflect what they'd actually achieve with real money — and for head-to-head leagues where everyone competes under the same realistic rules.

It’s per portfolio

Friction is set on each portfolio independently. A frictionless portfolio keeps trading exactly as before. Turning Friction on affects only that portfolio.

Turning it on or off

On any portfolio you'll see a Friction switch. Flipping it on opens a summary of what changes; confirm to enable. Flipping it off returns the portfolio to instant, fee-free fills.

One change per 24 hours

To keep Friction a real commitment (and prevent gaming the fees), the setting locks for 24 hours after each change. You also can't change it while the portfolio is entered in a league.

Fees you’ll be charged

  • Crypto trading fees. Every crypto order pays a maker/taker fee (around 0.1%). Market orders are takers; resting limit orders are makers and pay slightly less — just like a real exchange.
  • ETF expense ratios. If you hold an ETF, its annual expense ratio is charged a little each day you hold it.
  • Borrow & financing costs. Short positions accrue a daily borrow fee, and leveraged positions accrue daily margin interest.
  • Stocks have no commission — matching real zero-commission brokers. Their cost shows up as the spread instead.

How fills behave differently

  • Spread. Market buys fill at the ask and sells at the bid, instead of a free mid-price.
  • Slippage. Large orders push the price against you — the bigger the order relative to normal volume, the more it moves.
  • Partial fills. A big order can't consume more than a share of the volume actually trading, so it fills in pieces over time. Anything unfilled by the close is cancelled (a standard day order).
  • Market hours. Stock orders placed while the market is closed wait for the next open and fill at the opening price. Crypto trades 24/7.

Worked example: where the cost comes from

Friction is just three transaction costs stacked on top of the mid price. Here are the exact formulas, then the same 400-BTC order priced as a market order and as a marketable limit so you can see how each piece contributes. (Illustrative numbers; the live profile is crypto taker 0.10% / maker 0.08%, impact coefficient 1.0.)

The formulas
Spread   you buy at the ask / sell at the bid (not the free mid)
         cost = |fill − mid|   · per share

Impact   big orders walk the book — the square-root law:
         ΔP/P = Y · σ · √(Q / V)
           Y = impact coefficient (1.0)
           σ = daily volatility ≈ 0.601 · ln(High / Low)
           Q = order size
           V = consolidated daily volume

Fee      notional × rate   (taker 0.10% · maker 0.08% · stocks 0)

A — Market buy, 400 BTC. Takes liquidity now, so it pays the spread, the full size impact, and the taker fee.

Market order walkthrough
Inputs   mid = $62,000 · Q = 400 · day H/L = 62,450 / 60,790
         24h volume 17,000 BTC → consolidated V = 17,000 × 5 = 85,000

1 spread  ask = 62,000 × (1 + 0.0001)            = $62,006.20
          spread cost = $6.20 × 400              = $2,480

2 impact  σ    = 0.601 × ln(62,450/60,790)       = 1.62%
          move = 1.0 × 0.0162 × √(400/85,000)    = 0.111%  (11.1 bp)
          fill = 62,006.20 × 1.00111             = $62,075.11
          impact cost = $68.91 × 400             = $27,560

3 fee     0.10% × (62,075.11 × 400)              = $24,830

TOTAL FRICTION                                   = $54,870
          spread  $2,480   ( 5%)
          impact  $27,560  (50%)
          fee     $24,830  (45%)
          effective fill $62,075.11 — 22 bp above mid

B — Limit buy, 400 BTC at $62,020 (above the ask, so it's marketable). A taker only consumes liquidity up to its limit price: the part that fits fills now with real impact, and the rest rests as a maker and fills in pieces — no impact, cheaper fee.

Marketable-limit walkthrough
1 spread  ask = $62,006.20 (as above)

2 slice   how much fills now? invert the impact law:
          room   = (limit − ask)/ask = (62,020 − 62,006.20)/62,006.20 = 0.0223%
          Q_fill = V · (room / (Y·σ))²
                 = 85,000 × (0.000223 / 0.0162)²  = 16 BTC
          → 16 BTC fill now at $62,020 (taker):
            spread $99 + impact $221 + taker fee $995   ≈ $1,315

3 rest    remaining 384 BTC rest as a maker at $62,020,
          filling as volume trades at your price:
            no spread, no impact
            maker fee 0.08% × (62,020 × 384)            ≈ $19,050

TOTAL if fully filled                              ≈ $20,365
   vs the same 400 BTC as a MARKET order            = $54,870

Market vs. limit, in one line

A market order fills instantly but pays full impact on the whole size. A marketable limit caps your price and only the aggressive slice that fits below your limit pays impact — the rest waits and fills at the cheaper maker fee. A limit right at the touch pays zero impact but fills entirely as a slow maker.

The 24-hour lock

Once you turn Friction on or off, the setting is locked for 24 hours. This stops anyone from flipping it off for a single cheap trade and back on again. While a portfolio is competing in a league, the setting is frozen for the whole league.

How you’re charged fairly

Time-based costs (ETF expense ratios, borrow and margin interest) are charged for the exact fraction of the day Friction was switched on — not based on whether it happened to be on at the moment the daily charge runs.

No dodging the daily fee

If you hold an ETF all day with Friction on and switch it off a minute before the nightly charge, you still pay for ~99.9% of the day. You always pay for exactly the time you were on.

Friction leagues

Some leagues are Friction-required: every entrant competes under the same realistic costs, so results are comparable. To join one, your portfolio must have Friction enabled — and it stays on for the duration of the league. Regular leagues are unaffected and accept any portfolio.

Friction via the API

Programmatic agents can use Friction too. Create a portfolio with frictionEnabled: true, read a portfolio's state at GET /v1/portfolios/:id/friction, and toggle it at PATCH /v1/portfolios/:id/friction — subject to the same 24-hour and league locks. See the API docs for keys and scopes.