PART 2

Asset Classes

An asset class is not a category for filing things in. It is a claim of a particular shape — residual, contractual, relative, or purely conventional — and that shape decides what moves the price, how the thing trades, and which of your code’s silent assumptions it is about to break.

Six widgets · nothing is recorded Every path is seeded — the same slider gives the same market Code written for equities fails silently on FX and crypto
Part 2.1

1What is it? Five shapes of claim

Everything tradable is a claim on a future cash flow, on another claim, or on a convention. The five classes below differ in the shape of that claim, and the shape is what determines the price behaviour. An equity is a residual claim, so it absorbs surprises first and is volatile. A bond is a contractual claim, so its cash flows are fixed and its price has to move instead. A currency pair is a ratio, so there is no absolute level at all. A commodity is a physical thing with a storage cost. A coin is a convention with a protocol.

Pick a class and read what actually moves it. The bars are rough attributions of day-to-day variance — not precise estimates, but the right order of magnitude, and the right order of importance.

—

What the buyer owns

In a practice venue

Claim shape
—
Typical annual vol
—
Cash flow
—
Part 2.2

2How does it work? Four classes, four mechanics

Below are the four mechanics that a newcomer to each class most reliably gets wrong: how a single stock relates to its index, why a bond’s price is the inverse of its yield, what a currency cross has to be if no free money exists, and what “the market is closed” means when it never is.

Interactive · equities — one stock, one index, and the variance in between

A share is a residual claim on one company, so its price moves for two reasons: something happened to the market (systematic) and something happened to the company (idiosyncratic). An index is a weighted basket, and because the idiosyncratic parts partially cancel, the basket is far quieter than its members. Slide the basket size from 1 to 60 and watch the single-name noise disappear — that cancellation is diversification, and it is the only free lunch in finance. Then pay a dividend and run a split, and note that only one of them changes what you own.

index one stock your basket one name, as printed (unadjusted)
Single-name vol
—
Basket vol
—
Index vol
—
Variance from market
—
Price return
—
Total return
—

The basket

Sectors and concentration


      

Interactive · fixed income — price and yield are the same fact

A bond promises a fixed schedule: a coupon each period and the principal at maturity. Because the payments cannot change, the only way the market can demand a different return is by paying a different price today. So price and yield are not two properties of a bond — they are one number expressed two ways, and the relationship is inverse and convex. Move the yield and watch the price. Then push maturity out and watch the same yield move do far more damage: that sensitivity is duration.

Price
—
Modified duration
—
Convexity
—
Price if +100 bp
—
Price if −100 bp
—
Trading at
—

The bond

Face value $100, annual coupons, discounted at a flat yield. Real desks use a curve and day-count conventions; the mechanism is identical.

    

Interactive · the yield curve, and the price of credit

Yields are not one number, they are a curve: a yield for every maturity. Its shape is one of the most watched signals in finance — an inverted curve means the market expects rate cuts, which usually means it expects trouble. On top of the government curve sits a credit spread: the extra yield demanded for the possibility that the issuer does not pay. Investment grade might be 90–160 bp over; high yield, 300–800 bp; distressed, far more.

Curve shape

Govt yield
—
Corporate yield
—
Extra income
—
Implied default view
—
government curve corporate curve credit spread

Interactive · FX — the cross rate is not free to choose

An FX quote is a ratio, always of the form BASE/QUOTE: EUR/USD at 1.0850 means one euro costs 1.0850 dollars. There is no absolute price of a currency, only pairs — which has a strong consequence. Given EUR/USD and GBP/USD, the EUR/GBP cross is determined, because a round trip through all three must return you exactly what you started with. If it does not, the difference is free money, and it lasts milliseconds. Detune the cross below and watch the triangle open up.

Implied EUR/GBP
—
Quoted EUR/GBP
—
Mispricing
—
Round trip on $10m
—

Three quotes

Pips, and the carry you are also holding


      

Interactive · crypto — when there is no closing bell

Crypto’s most consequential difference is not volatility, it is the clock. US equities trade 6.5 hours a day, five days a week — 32.5 of 168 hours, under a fifth of the week. FX trades continuously from Sunday evening to Friday evening. Crypto never closes. Drag the cursor through a week and watch which venues are awake; then read what each of those gaps and non-gaps does to code that was written for one of the other two.

US equities
—
Equity futures
—
FX
—
Crypto
—
Hours open / week
—

—

Funding rates — the perpetual’s tether

A crypto perpetual future has no expiry, so nothing forces it back to spot. Venues instead charge a funding rate, usually every eight hours: when the perpetual trades above spot, longs pay shorts, and vice versa. Typical is ±0.01% per 8 hours — about 11% a year — but in a squeeze it can reach 0.3% per 8 hours, roughly 300% annualised. That payment stream is a carry trade with a very fat tail, and it is one of the few genuinely new instruments of the last decade.

Annualised
—
Who pays
—

Commodities, briefly

The claim is physical

A barrel of oil, a bushel of wheat, an ounce of gold, a megawatt-hour. There are no cash flows, so there is nothing to discount and no “fundamental value” in the equity sense — only supply, demand, and the cost of holding the thing until you need it.

Storage is the whole story

Because the asset is physical, the futures curve is shaped by storage, insurance and financing. Contango (later is dearer) is the normal state; backwardation (later is cheaper) signals a shortage now. Almost nobody takes delivery, so positions are rolled — and the roll is where the return actually comes from.

Why traders care

Commodities are the cleanest place to see carry as an alpha family: the roll yield is observable, contractual and separable from any view on the spot price. Trend-following managed-futures funds have traded them systematically for forty years, which makes the data unusually honest.

Part 2.3

3Why it matters: the matrix your code has to survive

Here is the practical payoff of this part. A trading system carries a set of assumptions about hours, tick size, spread, leverage and settlement, and they are usually inherited silently from whichever class you built it on first. Filter the matrix by the property you care about, and read the last column as a list of the specific ways each class breaks equity-shaped code.

Showing all six properties
InstrumentTrading hoursTick sizeTypical spread LeverageSettlementMain risk

Spreads are round numbers for a liquid, large name in normal conditions and widen by an order of magnitude in stress. Leverage figures are typical retail or exchange-margin levels, not limits.

The assumption each class breaks

  • Equities teach you that a session has a beginning and an end, that there is a closing price, and that positions can be flattened before the risk goes home overnight. None of that is universal.
  • Bonds break the idea that a price is quoted at all: most trade by request-for-quote with a dealer, so there is no continuous tape to compute a moving average on.
  • FX breaks the idea of a single price for a single thing. Every quote is a ratio, and the P&L currency is a choice you have to make explicitly.
  • Crypto breaks the session, the calendar, the tick size and often the venue itself. A bot that flattens “at the close” never flattens.
  • Commodities break the idea that an instrument persists. Contracts expire, and a strategy on “oil” is really a strategy on a rolling sequence of contracts.

How this shows up in a practice venue

The starter platform this site accompanies deliberately spans three of these five shapes, because they exercise different code paths:

  • Ten cash equities — AAPL, MSFT, NVDA, TSLA, AMZN, GOOGL, META, NFLX, AMD, INTC — on a central limit order book with a $0.01 tick, price-time priority, and a session that opens and closes. This is the default shape.
  • One index future on a basket of those ten. It has a mark, a margin requirement, periodic variation-margin settlement, and a basis to the cash basket — which is the cleanest arbitrage in the venue, and Part 3’s subject.
  • A crypto-style venue with no session boundary, so any strategy that assumed “flatten at the close” has to be rewritten. That rewrite is the point of the exercise.
The fee schedule is the same across all three: taker 15 bps of notional, maker rebate 10 bps. Whichever class you trade, that number decides whether crossing the spread can ever be correct.
Part 2.4

4Five ways this goes wrong

All five are silent: the code runs, the numbers look plausible, and the answer is wrong.

Using price returns when you meant total returns

A stock that pays a 3% dividend yield and ends the year flat on price returned 3%, not 0%. Every dividend is a discontinuity in the price series: on the ex-date the price drops by roughly the dividend, for no economic reason at all. A mean-reversion signal reads that as a dip and buys it.

The same trap with a much larger footprint: a 4-for-1 split quarters the price overnight. On an unadjusted series that is a −75% return, which will trip every stop loss, every volatility estimate and every outlier filter you own.

Fix: use adjusted close for signal research and unadjusted for execution and position sizing, and know which one your data vendor gave you. Reconcile the two: if the number of −40% single-day returns in your history exceeds the number of actual disasters, you are reading splits as crashes.

Treating yield as if it were the return

A 30-year bond yielding 4.6% does not return 4.6% over the next year. It returns the coupon plus or minus the price change, and with a modified duration near 15, a 60 bp rise in yields is roughly a −9% price move. Two years of coupons, erased by a move that barely makes the news.

The 2022 government bond market is the cleanest demonstration available: long-duration government bonds — the textbook “safe” asset — lost a third of their value while paying every coupon exactly as promised.

Fix: quote every bond position with a duration next to it, and express rate risk in the only unit that matters — dollars per basis point. Then ask what a 100 bp move does to the book, because 100 bp moves happen.

Getting the base and quote backwards

EUR/USD is euros priced in dollars, so a rising number means a stronger euro. USD/JPY is dollars priced in yen, so a rising number means a weaker yen. The market quotes some pairs one way by convention and some the other, and there is no rule you can derive — it is a convention list you have to look up.

The systematic version of this bug: a long/short book across eight pairs where two are inverted. The correlations look strange, the hedge does not hedge, and the P&L attribution never adds up — because two of the positions are the opposite of what you intended.

Fix: normalise everything internally to one convention on ingest, keep the P&L currency explicit in the position object, and unit-test the sign of the P&L for a known move in every pair you trade. Do it once, at the boundary, not in every strategy.

Assuming a session, a calendar and a closing price

“Flatten the book at the close.” In crypto there is no close, so the flattening never fires and you carry the position into a weekend that the risk model does not know exists. Conversely, code written for crypto assumes continuity and is surprised by a Monday open 4% away from Friday’s close — a gap it never had to handle, and one that no stop loss can protect you from, because nothing traded in between.

Then the calendar itself: holidays differ by exchange, half-days exist, and the last Friday of a quarter has an index rebalance and an option expiry landing on the same auction.

Fix: make the session an explicit object with an exchange calendar, not an if hour < 16. Test every strategy against a weekend, a holiday, a half-day and a 24/7 venue before it sees capital.

Ignoring settlement, and being surprised by leverage

US equities settle T+1: the cash is not actually yours for a day. FX spot is T+2. Crypto is effectively instant. If your position and cash tracking is a single number that updates on fill, all three look the same, and then a reconciliation breaks and you cannot say what you own.

Leverage is the same failure with bigger consequences. Cash equity is roughly 2:1 for retail, an index future can be 20:1 on exchange margin, and some crypto venues offer 50:1 or more. Position size in notional, not in contracts, or a “small” futures trade is a career-ending one.

Fix: track settled cash separately from trade-date cash, size everything from notional exposure, and put a hard notional cap in the risk layer that does not know or care which instrument asked. Part 3 makes you feel this with a margin slider.

Part 2.5

5Check yourself

Three questions, instant feedback, nothing recorded.

Q1A 10-year bond with a 4% coupon trades at par. The market yield rises to 5%. What happens to its price?

Q2EUR/USD is 1.0850 and GBP/USD is 1.2700. What must EUR/GBP be?

Q3You port an equity strategy to a crypto venue. Which difference is most likely to break it silently?

Part 2.6

6Do the work

Code
Get the code
Ten cash equities, an index future and a 24/7 venue, on a matching engine with a $0.01 tick and price-time priority. Use it as a template, clone, make install.
Previous
← Part 1 · What Is Systematic Trading?
The five pillars, the alpha families, and the four ways a backtest lies to you.
Next
Part 3 · Derivatives →
Contracts whose value is borrowed from something else — and the leverage that makes them both useful and lethal.