Lesson 2 of the course "Build your own arbitrage bot". Lesson 1 gave you a scanner for one coin on two exchanges. Today you meet the whole family and choose your bot's type.
One idea, four disguises
Every kind of arbitrage uses the same trick: two prices that should agree do not, and you trade both sides so that the disagreement is yours. What changes is which two prices you compare. There are four common choices.
Kind 1: cross-exchange
This is lesson 1. The same coin has a different price on two exchanges. You buy on the cheap one and sell on the expensive one.
Example with numbers. Bitcoin costs 100.10 to buy on exchange A and sells for 100.30 on exchange B. The gap is 0.20 per coin.
The hard part is that you need money (or coins) on both exchanges at the same moment, and moving money between exchanges is slow and costs a fee. Many cross-exchange bots keep a stock of coins on each exchange so that they never have to move them in a hurry.
Kind 2: cyclic (triangular)
Here you stay on one exchange and trade in a circle. Suppose the exchange lists three markets: USD to EUR, EUR to GBP, and GBP to USD. Start with 100 USD.
- 100 USD buys 90 EUR (rate 0.90).
- 90 EUR buys 79.2 GBP (rate 0.88).
- 79.2 GBP buys 102.96 USD (rate 1.30).
You end with 102.96 USD, so you made 2.96. The three prices disagree with each other: the product of the rates, 0.90 × 0.88 × 1.30, is 1.0296, and an honest market would give 1.0000.
The word triangular comes from three currencies. The circle can be longer, four or five steps. Lessons 5 to 8 teach how a program finds such circles fast.
Kind 3: statistical
Now the two prices are not the same thing, but they usually move together. Think of two shops that sell different brands of bottled water in the same street. When one raises its price, the other does too, a bit later. If today one brand costs much more than usual compared with the other, you bet that the gap will shrink: you sell the expensive one and buy the cheap one.
In crypto, the two things might be Ethereum and a coin built on Ethereum. You measure how far their price ratio is from its normal level. This is called a spread, and when it is unusually wide you open the pair.
The word statistical matters. Nothing forces the prices to meet. They usually do, and sometimes they do not, so you can lose. Kinds 1 and 2 are close to certain when you can really trade at the prices you see. Kind 3 is a probability bet with a small edge.
Kind 4: futures and spot
Spot means you buy the coin itself. A futures contract is an agreement to trade the coin later, or a perpetual contract that tracks the coin's price and pays or charges a small amount of money every few hours (the funding rate) to stay close to it.
When the futures price is above the spot price, you can buy the coin and sell the futures at the same time. Your position does not care whether the coin goes up or down, because a loss on one side is a gain on the other. What you collect is the difference between the two prices as the contract approaches its end, or the funding payments that perpetual contract holders pay each other.
Example: spot 100.00, futures 101.00. You buy spot and sell futures. At the end of the contract both prices meet, say at 95. You lose 5 on the coin and gain 6 on the short futures, net 1.
The comparison table
| Kind | What you compare | What can go wrong | Needs |
|---|---|---|---|
| Cross-exchange | one coin on two exchanges | gap closes before you trade; slow transfers | accounts and funds on both exchanges |
| Cyclic | rates in a circle on one exchange | fees; prices move between the legs | one account, fast code |
| Statistical | two related coins | the relation breaks | statistics, patience |
| Futures-spot | spot price and futures price | margin calls, exchange problems | funds on spot and on futures |
How to choose the type of your bot
Ask three questions.
- How many accounts can you open? One account points to cyclic. Two or more allow cross-exchange.
- Do you want something you can verify with school arithmetic? Cyclic and cross-exchange are exactly that. Statistical needs a little statistics.
- How fast must the program be? Cyclic is the most demanding, because a circle can vanish in a fraction of a second.
For the rest of the course, the main bot is cyclic, because it teaches the graph algorithms that make the course special (lessons 5 to 8). Lesson 14 adds futures-spot as a second strategy, and lesson 15 lets you add pairs trading or a machine learning filter.
Let an AI agent help you decide
A vague request:
Which arbitrage is best?
A request with a decision in it:
I can open two exchange accounts and I know basic Python. List the four kinds of arbitrage in one table with: what I compare, the main risk, and what I need. Then recommend one for a beginner with a 100 dollar paper account, and give me one number I can check by hand.
Read the answer critically. If the agent recommends something and does not explain the risk, ask it to explain the risk again.
Your exercise
Write a short file called idea.md with five lines:
- The kind of arbitrage for your bot.
- The two prices it compares.
- One thing that can go wrong.
- One number you will check by hand in every lesson.
- What "the bot works" means for you in one sentence.
There is no wrong answer. The result you should have is a page you can read again in lesson 16 and see how much changed.
What comes next
Lesson 3 shows the stages every arbitrage system goes through, so you know where each later lesson fits.