Mexico–United States arbitrage monitor
An arbitrage monitor between the Mexican exchange and the United States markets: pairs crossed by ADR ratio and exchange rate, spread net of costs, and a state machine that knows what to do when only one leg fills.
Prototype · demonstrable
How it works
Pairing
Five crossed pairs joined by ADR ratio and exchange rate. The canonical quote carries the delay measured per side as reception minus market time, so a stale price never looks like an opportunity.
Net spread
The engine works on the spread net of costs, not on the gross difference. Below the threshold there is no opportunity, however wide the raw gap looks.
Leg state machine
Partial fills and rejects are the normal case, not the exception. When one leg does not go in there are four policies: wait, cancel the other, hedge, or unwind.
Limits and kill switch
Exposure per issuer with an uncovered alert, operating limits, P&L, and a switch that stops everything with one click.
Append-only journal
Every decision is written down before it is acted on. What happened can be reconstructed line by line.
Web monitor
Pairs, chart, legs, exposure, parameters changed live and the uncovered-position resolver.
Where it stands
It is a prototype, and we say so plainly. It runs a replay of five recorded days at 60× or a public feed delayed by about fifteen minutes; execution is simulated per leg with fill, partial and reject probabilities, latency with jitter and timeouts. Forty-seven tests, none of them touching the network.
- Opportunity engine with spread net of costs
- Leg machine with four policies
- Exposure, limits, P&L and kill switch
- Append-only journal
- Live web monitor
- 47 tests without network access
- No real market feed and no order book (bid/ask)
- No FIX gateway and no real orders
- ADR conversion cost is not modelled
- It does not survive a restart yet
- No latency figure is promised until it is measured
Take it to production
The path from here is an adapter to the institution’s own market-data bus, a certified FIX gateway per leg, and the executions posting into the platform’s book. If that is the road you are on, we would like to hear about it.