In [2]:
%load_ext autoreload
%autoreload 2
In [3]:
import bets
print(bets.url)
In [4]:
data = bets.getJSON(bets.url)
In [5]:
for i, address in enumerate(bets.address):
assert data['addresses'][bets.order[i]]['address'] == address
In [6]:
balances = bets.balance(data)
balances
Out[6]:
In [7]:
coeffs = bets.bet(balances)
coeffs
Out[7]:
In [8]:
premios = [int(b*c) for b, c in zip(balances, coeffs)]
balance_total = sum(balances)
print('Premio estimado promedio:', sum(int(premio * paso/100) for premio, paso in zip(premios, bets.paso)))
print('Balance total:', balance_total)
print('Suma porcentajes PASO:', sum(bets.paso))
print('Premio en cada caso:', premios)
print('Márgenes: ', [balance_total-premio for premio in premios])