I'm fetching the prices for arbitrage but some of the prices seem correct, some are incorrect. i tried more than 20 ways but cant fix it.
last_data = [["ETHBTC", "BTCPAX", "PAXETH"],["ETHBTC", "BTCTUSD", "TUSDETH"],... ...]
for a in last_data:
az = 1.0
for y in a:
response = requests.get(f"https://api.binance.com/api/v3/ticker/price?symbol={y}")
az *= float(response.json()["price"])
print(y)
print(az)
output:
ETHBTC
BTCPAX
PAXETH
23.520797834005702
ETHBTC
BTCTUSD
TUSDETH
16.47345165311804
Numbers that should normally be:
first avg: 0,909
second avg: 0,929