Quantitative Finance · Book 2 · Markets

Markets II: Rates, FX and Credit

Markets II: Rates, FX and Credit · Markets

14The FX Market

In April 2025 the world’s banks and dealers traded, on an average day, USD 9.6 trillion of foreign exchange, 28% more than three years earlier. There is no exchange where this happens, no single price and no closing time. The market is a web of dealers who quote to each other and to their clients, a few electronic order books that most of the world watches, dozens of platforms that compete to connect them, and a settlement system that makes sure each side of a trade delivers its currency. The US dollar is on one side of almost nine trades in ten. This chapter describes the market’s conventions, its structure, the venues in which it trades and what the central banks’ survey of it says; the following chapters take its instruments one by one.

14.1 Currencies, pairs and conventions

Definition 14.1 (Currency pair, base and quote currency, pip)

A currency pair is written as two three-letter codes, BASEQUOTE, and its rate SS is the number of units of the second, the quote currency, per unit of the first, the base currency. A pip is the conventional unit of a rate’s movement: 0.0001 for most pairs, 0.01 for pairs quoted in yen.

EURUSD at 1.1464 means 1.1464 dollars per euro; USDJPY at 156.87 means 156.87 yen per dollar. Which currency is the base is a convention, not a choice: the Federal Reserve’s daily rates are quoted in units of currency per dollar except for the euro, sterling, and the Australian and New Zealand dollars, which are quoted in dollars per unit; the European Central Bank quotes every rate per euro, so EURGBP is pounds per euro. A trader who buys EURUSD buys euros and sells dollars; a quote of 1.1462/1.1464 means that the dealer buys euros at the bid, 1.1462, and sells them at the ask, 1.1464, a spread of two pips.

Definition 14.2 (Spot value date, cross rate)

The spot value date of a trade is the day on which the two currencies are exchanged: by convention the second business day after the trade, counting only days that are business days in both currencies, and the first for dollar–Canadian dollar. A cross rate is the rate between two currencies neither of which is the dollar, such as EURJPY, traded directly or through the two dollar pairs.

The rule has a detail every system must encode. Federal Reserve economists described it in 2003 with dollar–yen: a trade on a Tuesday settles on Thursday; if Wednesday is a holiday in Japan, on Friday; but if Wednesday is a holiday in the United States and not in Japan, still on Thursday, because a dollar holiday on the intermediate day does not delay a dollar pair (Figure 14.1). A day ends at 17:00 in New York: a trade just after it is dated the next day and settles a day later. Everything beyond spot is a forward, the subject of Chapter 16.

Spot value dates of a dollar–yen trade done on a Tuesday. A Japanese holiday on the intermediate day pushes settlement to Friday; a US holiday on it does not; a US holiday on the value date itself does. The rule as described by Federal Reserve economists in 2003; holidays hypothetical.
Figure 14.1. Spot value dates of a dollar–yen trade done on a Tuesday. A Japanese holiday on the intermediate day pushes settlement to Friday; a US holiday on it does not; a US holiday on the value date itself does. The rule as described by Federal Reserve economists in 2003; holidays hypothetical.

A cross rate can always be built from the two dollar pairs, and the construction fixes which side of each leg is used.

Proposition 14.3 (Triangulated cross)

With EURUSD quoted b1/a1b_1/a_1 and USDJPY b2/a2b_2/a_2, the synthetic EURJPY is b1b2/a1a2b_1b_2 / a_1a_2. With EURUSD b1/a1b_1/a_1 and GBPUSD b3/a3b_3/a_3, the synthetic EURGBP is (b1/a3)/(a1/b3)(b_1/a_3)/(a_1/b_3). In each case the relative spread of the cross is close to the sum of the legs’ relative spreads.

Proof. To sell euros for yen through the dollar, sell euros at the EURUSD bid b1b_1 and sell those dollars for yen at the USDJPY bid b2b_2: b1b2b_1b_2 yen per euro. To buy euros, pay the two asks. For EURGBP, selling euros gives b1b_1 dollars, and buying pounds with dollars costs a3a_3 dollars per pound. Relative spreads add to first order because log⁡(a1a2)−log⁡(b1b2)=(log⁡a1−log⁡b1)+(log⁡a2−log⁡b2)\log(a_1a_2) - \log(b_1b_2) = (\log a_1 - \log b_1) + (\log a_2 - \log b_2). ∎

Example 14.4 (Three crosses)

With EURUSD 1.1462/1.1464, USDJPY 156.86/156.88 and GBPUSD 1.3371/1.3373, the synthetic EURJPY is 179.7929/179.8472, 5.43 pips wide, a relative spread of 3.02 basis points against 1.74 and 1.27 for the legs; EURGBP is 0.85710/0.85738, 2.78 pips; GBPJPY 209.7375/209.7956, 5.81 pips. A dealer that quotes a cross directly can quote it tighter than the synthetic, but not crossed with it: a direct EURJPY bid above 179.8472 could be sold to and bought back through the legs at a profit.

14.2 Dealers, tiers and the over-the-counter structure

The market was built by banks trading with each other and with their clients, and still has that shape. The 2025 survey counts 46% of turnover as trades between reporting dealers and 50% as trades with other financial institutions, such as smaller banks, asset managers, hedge funds and principal trading firms; non-financial companies are the rest. Four places, the United Kingdom, the United States, Singapore and Hong Kong, book three quarters of it, London alone 38%.

A large dealer quotes thousands of clients in hundreds of pairs, and nets their flows against each other before it goes to the market: a client selling euros and another buying them within the same second leave the dealer with no risk, and neither trade reaches an interdealer venue. This internalisation (One Quant Book 1, chapter 10) is why the dealer market is concentrated: the more flow a dealer sees, the more it can net, the tighter it can quote and the more flow it attracts. Smaller banks and regional dealers, the second tier, take prices from the large ones and quote their own clients on top. Principal trading firms, which trade their own capital with fast algorithms, have become market makers too, streaming prices to banks and to platforms (Chapter 15).

The structure of the spot market. Dealers and principal trading firms trade with each other on the primary venues and on other electronic networks, and with clients on those networks and on their own single-dealer platforms; a prime broker lends a client its name and credit to trade with dealers it could not otherwise face (dashed). Schematic, after the Bank for International Settlements’ descriptions.
Figure 14.2. The structure of the spot market. Dealers and principal trading firms trade with each other on the primary venues and on other electronic networks, and with clients on those networks and on their own single-dealer platforms; a prime broker lends a client its name and credit to trade with dealers it could not otherwise face (dashed). Schematic, after the Bank for International Settlements’ descriptions.

14.3 Primary venues and electronic networks

Definition 14.5 (Primary venue, electronic communication network)

A primary venue is one of the interdealer electronic order books that the market treats as the reference for a pair’s price. An electronic communication network (ECN) is any other electronic trading platform where several liquidity providers and takers meet, by order book or by request for quote, anonymously or with names disclosed.

For three decades two electronic brokers, Refinitiv Matching, formerly Reuters, and EBS Market, now owned by CME Group, have been the primary venues of the spot market, central limit order books in which dealers, and since the mid-2000s principal trading firms, post and hit prices; their prices have been the references for the rest of the market. The BIS counted more than thirty secondary venues in the dealer-to-client segment in 2022, and volumes on the primary venues declining for more than a decade: dealers internalise more, execution algorithms slice orders across many venues, and dealers wary of being picked off by faster firms pushed the venues to add small delays, speed bumps, to incoming orders. Much price discovery now also happens in currency futures.

14.4 Single-dealer platforms and prime brokerage

Definition 14.6 (Single-dealer platform, FX prime brokerage)

A single-dealer platform is a dealer’s own electronic system through which its clients see its prices and trade with it. FX prime brokerage is the service by which a dealer lets a client trade with a set of other dealers in the prime broker’s name and on its credit: each trade is given up to the prime broker, which becomes the counterparty of the executing dealer and of the client.

The 2022 survey recorded a shift of seven percentage points of trading towards direct electronic channels, single-dealer platforms and direct price streams, away from anonymous venues. For a client a single-dealer platform offers personalised prices and, often, the dealer’s other services; for a dealer it is the best way to see its clients’ flow and to internalise it.

Prime brokerage is what lets a hedge fund or a principal trading firm act like a bank. The executing dealer sees only the prime broker’s name, so the client trades anonymously and with many dealers under one credit relationship, one set of settlements and one report; the prime broker charges a fee and bears the client’s credit risk. The BIS estimated that close to a third of the turnover with financial customers was prime-brokered in 2019, and Chapter 27 returns to what it takes to get such an arrangement and to the limits that come with it.

14.5 What the turnover surveys say

Every three years central banks ask the dealers in their jurisdictions to report their trading in April, and the BIS assembles the results: in 2025, 52 jurisdictions and more than 1 100 dealers. The survey counts each trade once across the world, by the location of the dealer’s sales desk.

Global FX turnover by instrument, as a share of the daily total, in April 2022 and April 2025. FX swaps remain the largest instrument, but spot, forwards and options grew faster. Data: BIS Triennial Central Bank Survey, 2025 release.
Figure 14.3. Global FX turnover by instrument, as a share of the daily total, in April 2022 and April 2025. FX swaps remain the largest instrument, but spot, forwards and options grew faster. Data: BIS Triennial Central Bank Survey, 2025 release.

Two messages stand out. First, spot is less than a third of the market: most trading is in FX swaps and forwards, instruments of funding and hedging (Figure 14.3). Second, the dollar is the market’s vehicle (Figure 14.4): the ten most traded pairs all include it, and a Swedish exporter paid in yen often finds it cheaper to sell yen for dollars and dollars for kronor than to trade the thin cross. Shares add up to 200% because each trade involves two currencies. The survey also warned that April 2025 was not a quiet month: it followed trade-policy announcements that moved currencies sharply.

Share of global FX trades involving each currency, April 2025 (the shares sum to 200% since every trade has two sides). The Australian and Canadian dollars, at about 6% each, are not shown. Data: BIS Triennial Central Bank Survey, 2025 release.
Figure 14.4. Share of global FX trades involving each currency, April 2025 (the shares sum to 200% since every trade has two sides). The Australian and Canadian dollars, at about 6% each, are not shown. Data: BIS Triennial Central Bank Survey, 2025 release.

As of September 2026 — Size and settlement

BIS Triennial Survey, April 2025: USD 9.6 trillion a day; spot USD 3 trillion, outright forwards USD 1.8 trillion, FX swaps USD 4 trillion; dollar on one side of 89.2% of trades, euro 28.9%, yen 16.8%, sterling 10.2%, renminbi 8.5%, Swiss franc 6.4%. The survey is repeated every three years. CLS, the settlement system for the main currencies (Chapter 20), settles 18 currencies, on average more than USD 8 trillion a day, for more than 75 settlement members.

14.6 Tutorial: spot dates and crosses

Goal. Name pairs by convention, compute spot value dates across two holiday calendars, and triangulate crosses with their bid and ask. End state: Figure 14.1, Example 14.4 and the numbers of the weekend problem.

  1. The spot date, with the dollar exception on the intermediate day.

    def spot_date(trade: dt.date, pair: str, holidays: dict[str, set[dt.date]]) -> dt.date:
        """Value date of a spot trade: T+2 (T+1 for USDCAD) in business days of both currencies."""
        ccys = (pair[:3], pair[3:])
    
        def open_in(d: dt.date, skip_usd: bool) -> bool:
            return d.weekday() < 5 and all(d not in holidays.get(c, set()) for c in ccys if not (skip_usd and c == "USD"))
    
        d, lag = trade, 1 if pair in T_PLUS_1 else 2
        for _ in range(lag - 1):                                   # intermediate days
            d += dt.timedelta(days=1)
            while not open_in(d, skip_usd=True):
                d += dt.timedelta(days=1)
        d += dt.timedelta(days=1)
        while not open_in(d, skip_usd=False):                      # the value date itself
            d += dt.timedelta(days=1)
        return d
    Listing 14.1. Spot value date of a pair across two holiday calendars. code/firm/fxpairs/firm_fxpairs.py
  2. The cross, each leg on the side the trade forces, and the arbitrage check of a direct quote.

    def cross_via_usd(leg1: tuple[str, Quote], leg2: tuple[str, Quote], target: str) -> Quote:
        """Bid and ask of `target` implied by two dollar pairs, trading each leg on the side that the
        trade forces: the cross's bid sells base and buys quote through the dollar."""
        base, quote = target[:3], target[3:]
        legs = dict((p, q) for p, q in (leg1, leg2))
    
        def usd_per(ccy: str, side: str) -> float:              # dollars received (bid) or paid (ask) per unit
            if ccy + "USD" in legs:
                q = legs[ccy + "USD"]
                return q.bid if side == "sell" else q.ask
            q = legs["USD" + ccy]
            return 1.0 / (q.ask if side == "sell" else q.bid)
    
        bid = usd_per(base, "sell") / usd_per(quote, "buy")    # sell base for USD, buy quote with USD
        ask = usd_per(base, "buy") / usd_per(quote, "sell")
        return Quote(bid, ask)
    
    
    def spread_pips(q: Quote, pair: str) -> float:
        return (q.ask - q.bid) / pip(pair)
    
    
    def arbitrage(direct: Quote, synthetic: Quote) -> str | None:
        """A direct cross quote that crosses the synthetic one can be arbitraged."""
        if direct.bid > synthetic.ask:
            return "sell direct, buy synthetic"
        if direct.ask < synthetic.bid:
            return "buy direct, sell synthetic"
        return None
    Listing 14.2. A cross rate through the dollar, and the arbitrage test. code/firm/fxpairs/firm_fxpairs.py
  3. Run fx_demo.crosses(), fx_demo.spot_examples(), fx_demo.the_cross() and fig_fx.py.

What to change next. Add a holiday calendar from a public source for the euro area (the TARGET closing days) and Japan, and compute a year of EURJPY spot dates; then list the days on which the spot date jumps by more than two business days.

14.7 Build: the pair conventions

Purpose. Every FX system of the miniature firm starts here: the name and orientation of a pair, its pip, its spot date, and the synthetic price of a cross.

Interface. pair_name(a, b, priority); pip(pair); spot_date(trade, pair, holidays); Quote(bid, ask); cross_via_usd(leg1, leg2, target); spread_pips; arbitrage(direct, synthetic).

Rules. Base-currency priority kept as data; holidays passed in, never hard-coded; T+2 in both currencies’ business days, T+1 for USDCAD, a US holiday on the intermediate day ignored for dollar pairs; each leg of a cross on the side the trade forces.

Acceptance tests. code/firm/fxpairs/tests/: pair names and pips; the four published dollar–yen cases and USDCAD; a Friday trade settling on Tuesday; crosses equal to the products and quotients of the right sides; a crossed direct quote flagged as arbitrage.

Stretch. Real holiday calendars, versioned; the 17:00 New York roll; value dates for forwards (Chapter 16); crosses through a currency other than the dollar.

Sources and further reading

  • Bank for International Settlements, Triennial Central Bank Survey, “OTC foreign exchange turnover in April 2025” and press release, 30 September 2025.
  • Bank for International Settlements, Quarterly Review, December 2019 (“Sizing up global foreign exchange markets”) and December 2022 (boxes on trade execution and the fragmented spot market).
  • A. Chaboud and J. Wright, “Uncovered interest parity: it works, but not for long”, Federal Reserve Board, International Finance Discussion Paper 752, 2003.
  • Federal Reserve, H.10 foreign exchange rates; FR 3036 survey instructions; Foreign Exchange Committee, amendments to the 1998 FX definitions, 2011.
  • CLS Group, company information.

14.8 Exercises

Exercise 14.1 ★

EURUSD is 1.1462/1.1464. A client sells EUR 5 million. How many dollars does it receive, and what is the spread in pips and in basis points of the mid?

Solution

Solution of Exercise 14.1.

It sells at the dealer’s bid: 5 000 000×1.1462=USD 5 731 0005\,000\,000 \times 1.1462 = \text{USD}~5\,731\,000. The spread is 2 pips, 1.74 basis points of the mid.

Exercise 14.2 ★

Name the pairs formed by the dollar and the yen, the euro and sterling, the Australian dollar and the yen, and give the pip of each.

Solution

Solution of Exercise 14.2.

USDJPY, pip 0.01; EURGBP, pip 0.0001; AUDJPY, pip 0.01.

Exercise 14.3 ★

A USDJPY trade is done on Tuesday 6 October 2026. Give its spot date with no holidays, with a Japanese holiday on Wednesday, and with a US holiday on Thursday. A USDCAD trade on the same day?

Solution

Solution of Exercise 14.3.

Thursday 8 October with no holiday; Friday 9 October with a Japanese holiday on Wednesday; Friday 9 October with a US holiday on Thursday, the value date itself. USDCAD settles on Wednesday 7 October.

Exercise 14.4 ★★

From EURUSD 1.1462/1.1464 and GBPUSD 1.3371/1.3373, derive the synthetic EURGBP and its spread in pips.

Solution

Solution of Exercise 14.4.

Bid 1.1462/1.3373=0.857101.1462/1.3373 = 0.85710, ask 1.1464/1.3371=0.857381.1464/1.3371 = 0.85738: 2.78 pips.

Exercise 14.5 ★★

Why do the survey’s currency shares add up to 200%, and what does the dollar’s 89% say about how a cross such as SEKJPY is usually traded?

Solution

Solution of Exercise 14.5.

Each trade involves two currencies and each is counted, so the shares of all currencies sum to twice the total. With the dollar on one side of 89% of trades, a cross such as SEKJPY is thin: most of it is traded as two dollar trades, SEK against USD and USD against JPY, where liquidity is deep.

Exercise 14.6 ★★

A hedge fund with a prime broker executes USD 50 million of EURUSD with a dealer it has no agreement with. Who is the dealer’s counterparty, and who bears the fund’s credit risk?

Solution

Solution of Exercise 14.6.

The trade is given up to the prime broker, which becomes the executing dealer’s counterparty; the dealer faces the prime broker’s credit, not the fund’s. The prime broker faces the fund on an offsetting trade and bears its credit risk, which it limits and margins.

Exercise 14.7 ★★★

Coding. With cross_via_usd, give the synthetic GBPJPY and its relative spread, and check that it is close to the sum of the legs’ relative spreads.

Solution

Solution of Exercise 14.7.

209.7375/209.7956, a relative spread of 2.771 basis points; the legs’ relative spreads are 1.496 and 1.275, which sum to 2.771.

Exercise 14.8 ★★★

Find the flaw. “FX turnover is USD 9.6 trillion a day, so an exporter can sell any amount of any currency at the screen price.” Correct it.

Solution

Solution of Exercise 14.8.

The total is spread over hundreds of pairs, instruments and time zones; most of it is FX swaps and dealer-to-dealer trading, and a small currency against another may trade a few million an hour. Liquidity at the screen price is only the size shown; a large order is worked, pays a wider spread or moves the price, and at some times of day and in some pairs there is little to trade at all.

14.9 Problem: The Cross

Problem 14.1

Weekend problem — the most a client should pay for a cross

A client wants to buy EUR 10 million against yen. The market shows EURUSD 1.1462/1.1464 and USDJPY 156.86/156.88. Two dealers quote EURJPY directly: dealer A 179.80/179.84, dealer B 179.85/179.87.

Part I — The synthetic cross.

  1. Which side of each leg does the client hit to buy euros with yen?
  2. Give the synthetic EURJPY bid and ask.
  3. Give its spread in pips and in basis points of the mid.
  4. Give the legs’ relative spreads and compare their sum with the cross’s.
  5. How many dollars pass through the trade if the client buys synthetically?

Part II — The direct quotes.

  1. Is dealer A’s quote consistent with the legs?
  2. Is dealer B’s? What would an arbitrageur do?
  3. Give the arbitrage profit on EUR 10 million, in yen and in dollars.
  4. Why might such a quote exist for a moment, and why not for long?
  5. Where should the client buy?

Part III — Costs beyond the quote.

  1. Why does trading the legs cost the client more than the arithmetic?
  2. When is the direct cross cheaper than the synthetic?
  3. How does settlement differ between the two routes?
  4. What changes if Wednesday is a holiday in Japan and the trade is on Tuesday?
  5. Why can a dealer quote the cross tighter than the synthetic?

Part IV — Judgement.

  1. What is the danger in quoting the cross off stale legs?
  2. Why do thin crosses trade through the dollar?
  3. How would a large order in the cross move the legs?
  4. State the named result: the widest spread the client should accept for EURJPY today.
  5. In one sentence: what bounds the price of any cross?
Solution

Solution of Problem 14.1.

1. Both asks: it buys dollars with yen at the USDJPY ask, 156.88, and euros with dollars at the EURUSD ask, 1.1464. 2. 179.7929/179.8472. 3. 5.43 pips, 3.02 basis points. 4. 1.745 and 1.275 basis points, summing to 3.02: relative spreads add. 5. USD 11 464 000, bought and immediately spent. 6. Yes: its bid, 179.80, is below the synthetic ask and its ask, 179.84, above the synthetic bid; it is also tighter than the synthetic. 7. No: its bid, 179.85, is above the synthetic ask. Sell euros to B at 179.85 and buy them back through the legs at 179.8472. 8. 10 000 000×(179.85−179.84723)10\,000\,000 \times (179.85 - 179.84723), JPY 27 680, about USD 176. 9. A quote left behind a move in the legs, by a slow system or a distracted trader; arbitrageurs and the dealer’s own checks remove it within moments. 10. From dealer A at 179.84, below both B’s ask and the synthetic ask. 11. Two tickets and two spreads, the risk that the second leg moves before it is done, three currencies to settle, and possibly minimum sizes on the legs. 12. When a dealer has offsetting cross flow or sees two-way interest in the cross itself, and can quote inside the synthetic. 13. The direct trade exchanges euros and yen; the synthetic one also buys and sells dollars, which must be delivered and paid, usually through CLS. 14. The yen legs and the direct cross settle on Friday 9 October; the EURUSD leg on Thursday 8 October. The dollars bought on Thursday are needed on Friday: the synthetic route needs a one-day swap to line them up. 15. It nets the cross against other clients’ flows and hedges only the remainder, often at better prices than a client trading the legs. 16. If the legs move and the quote does not, it is crossed with the synthetic and is picked off, as dealer B’s was. 17. The dollar pairs are the deep markets; a thin cross is quoted from them and its own book adds little. 18. Buying EURJPY in size through the legs buys EURUSD and USDJPY: both rise, and so does the synthetic cross. 19. Named result: the synthetic bound for EURJPY is 179.7929/179.8472, 5.43 pips: the client should never pay more than 179.8472 for euros, since it can buy them through the legs; any direct quote is a gain only if it is inside that. 20. The bid and ask of the two dollar pairs, through which anyone can trade it.

14.10 Interview questions

Interview question 14.1 ★ trader, developer

What does EURUSD 1.1462/1.1464 mean, and which side does a client who buys euros hit?

Solution

Solution of Interview question 14.1.

The dealer buys euros at 1.1462 dollars and sells them at 1.1464; the spread is two pips. A client who buys euros hits the ask, paying 1.1464 dollars for each euro.

What the interviewer is looking for: base and quote, and the side a buyer pays.

Interview question 14.2 ★ developer

How do you compute the spot date of an FX trade? What edge cases would you test?

Solution

Solution of Interview question 14.2.

Take the trade date (after the 17:00 New York roll), move to the second day that is a business day in both currencies, ignoring a US holiday on the intermediate day for dollar pairs, and to the first for USDCAD; then check the value date is open in both. Test weekends, holidays on the intermediate and on the value day in each currency, US holidays in the middle, year ends, trades just before and after 17:00, and the T+1 pairs.

What the interviewer is looking for: the rule, its dollar exception, and a real list of edge cases.

Interview question 14.3 ★★ trader, researcher

Derive the bid and ask of EURGBP from EURUSD and GBPUSD.

Solution

Solution of Interview question 14.3.

Selling euros for pounds through dollars: sell euros at the EURUSD bid b1b_1, buy pounds with those dollars at the GBPUSD ask a3a_3: bid b1/a3b_1/a_3. Buying euros: pay the EURUSD ask a1a_1 with dollars from selling pounds at the GBPUSD bid b3b_3: ask a1/b3a_1/b_3.

What the interviewer is looking for: the correct sides of each leg.

Interview question 14.4 ★★ trader, bank

Why is the FX market over the counter rather than on an exchange, and how has electronic trading changed it?

Solution

Solution of Interview question 14.4.

Its participants are banks that trade with each other and their clients in large sizes, across time zones, in many currencies, and settle bilaterally; no single exchange or clearing house was needed or imposed. Electronic trading added interdealer order books, then multi-dealer and single-dealer platforms, algorithms and non-bank market makers; it lowered costs and fragmented liquidity, and concentrated dealing in the banks with the most flow.

What the interviewer is looking for: history and the effects of electronification.

Interview question 14.5 ★★ bank

What does a prime broker do for an FX client, and what risks does it take?

Solution

Solution of Interview question 14.5.

It lets the client trade with many dealers in the prime broker’s name, on its credit, and settles and reports everything in one place; the dealers face the prime broker. It takes the client’s credit risk: if the client fails, the prime broker must honour the trades. It limits that risk with trading limits, margin and intraday monitoring (Chapter 27).

What the interviewer is looking for: the give-up mechanism and the credit risk.

Interview question 14.6 ★★★ developer, trader

Design the component that publishes synthetic cross prices for a hundred crosses from the dollar legs, with a latency budget of a few microseconds.

Solution

Solution of Interview question 14.6.

Keep each dollar leg’s best bid and ask in a fixed array, updated from the market data handlers; on each leg update recompute only the crosses that use it, from a precomputed dependency table, with the side rules resolved at start-up so the hot path is two multiplications or divisions. Publish with a sequence number and the legs’ timestamps, suppress a cross when a leg is stale, and test against a slow reference implementation on recorded data.

What the interviewer is looking for: precomputed dependencies, no allocation on the hot path, staleness checks.

Terms defined in this chapter

See all 2333 terms in the glossary