I have an trading API that allows me to send/cancel/update orders. I have marketdata that I can use through another API that gives me orderbook data.
Now let's say I want to build a simple arbitrage strategy, for products X1 vs X2, Y1 vs Y2, and Z1 vs Z2.
X1 and X2 should have the same price, and if they differ more than 0.5% in price I want to trade on this difference.
My question is how to structure my python code, so that it can handle 100 of those pairs simultaneously and continuously. I find a lot of information on backtesting, but I want to trade this live and need to prevent any unnecessary loops.