Concept site: what cryptoarbitragebots.com could become. The domain is for sale. See the main page

Lab notebook 1. Paper only.

The arbitrage lab

Learn how price gaps work by working them out by hand, then write a small bot that only ever trades on paper. No exchange, no money, no keys.

Coin ACoin BCoin C × 16.40− 0.10% fee × 0.0612− 0.10% fee × 0.9975− 0.10% fee 1.0012before 0.9982after
start with 1 Coin A
1 × 16.40 = 16.40
16.40 × 0.0612 = 1.0037
1.0037 × 0.9975 = 1.0012
Looks like a gap of 0.12%.
each leg keeps 0.999
1.0012 × 0.999³ = 0.9982
gone, and 0.18% under
Three small fees ate the whole loop. That is chapter 3, before any code. All figures here are made up.

Chapters

  1. Two prices, one coinstart herep. 3

    Why the same coin costs slightly different amounts in two places.

  2. Measuring a gapp. 11

    Bid, ask and mid, and which of them you could use.

  3. The fee stackp. 19

    Trading fees, moving fees, and the part most tutorials skip.

  4. Depthp. 28

    How much a listed price is good for before it moves.

  5. The clockp. 36

    Coins take time to move, and a gap does not wait for them.

  6. The trianglep. 44

    Three coins on one exchange: the loop drawn above, done properly.

  7. A paper botp. 52

    Replay a recorded order book and fill orders on paper.

  8. Why most gaps are gonep. 63

    Who else is looking, and how fast they are.

  9. Reading a bot's sales pagep. 71

    Use what you now know to question the claims.

On the bench

# paper_loop.py: paper only.
# No imports, no network, no keys.
# The rates and the fee are made up.

RATES = [("A>B", 16.40),
         ("B>C", 0.0612),
         ("C>A", 0.9975)]

def walk(units, fee=0.0):
    for leg, rate in RATES:
        units = units * rate * (1 - fee)
        print(f"{leg}  {units:.4f}")
    return round(units, 4)

print("before fees", walk(1.0))
print("after fees ", walk(1.0, fee=0.001))

No imports on purpose. With nothing imported, it has no way to reach an exchange. Change the fee and find where the loop turns over.

A>B  16.4000
B>C  1.0037
C>A  1.0012
before fees 1.0012
A>B  16.3836
B>C  1.0017
C>A  0.9982
after fees  0.9982

Rules of the bench

  • No real exchange.
  • No real keys.
  • No real coins.

Not financial advice, and this lab trades nothing. It teaches arithmetic and code, and makes no claim about what any bot would do with real money.

Example plansThe notebook, $48 example.
With a six-week cohort, $290 example.
Ask about this name