Skip to content

Commit

Permalink
switched test to archived data
Browse files Browse the repository at this point in the history
  • Loading branch information
jepidoptera committed Jan 25, 2024
1 parent bc58951 commit 92fcc79
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions hydradx/tests/test_arbitrage_agent_refactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,30 +688,30 @@ def test_combine_step():
{'exchanges': {'omnipool': ('GLMR', 'USDT'), 'binance': ('GLMR', 'USDT')}, 'buffer': 0.001}
]

asset_list, asset_numbers, tokens, fees = get_omnipool_data(rpc='wss://rpc.hydradx.cloud', archive=False)

kraken = get_centralized_market(config=cfg, exchange_name='kraken', trade_fee=0.0016, archive=False)
binance = get_centralized_market(config=cfg, exchange_name='binance', trade_fee=0.001, archive=False)
cex = {
'kraken': kraken,
'binance': binance
}
# uncomment above to test with live data, below for archived data
#
# input_path = './data/'
# if not os.path.exists(input_path):
# input_path = 'hydradx/tests/data/'
# asset_list, asset_numbers, tokens, fees = get_omnipool_data_from_file(input_path)
# asset_list, asset_numbers, tokens, fees = get_omnipool_data(rpc='wss://rpc.hydradx.cloud', archive=False)
#
# cex = {}
# for exchange in ('kraken', 'binance'):
# cex[exchange] = CentralizedMarket(
# order_book=get_orderbooks_from_file(input_path=input_path)[exchange],
# unique_id=exchange,
# trade_fee={'kraken': 0.0016, 'binance': 0.001}[exchange]
# )
# kraken = cex['kraken']
# binance = cex['binance']
# kraken = get_centralized_market(config=cfg, exchange_name='kraken', trade_fee=0.0016, archive=False)
# binance = get_centralized_market(config=cfg, exchange_name='binance', trade_fee=0.001, archive=False)
# cex = {
# 'kraken': kraken,
# 'binance': binance
# }
# uncomment above to test with live data, below for archived data

input_path = './data/'
if not os.path.exists(input_path):
input_path = 'hydradx/tests/data/'
asset_list, asset_numbers, tokens, fees = get_omnipool_data_from_file(input_path)

cex = {}
for exchange in ('kraken', 'binance'):
cex[exchange] = CentralizedMarket(
order_book=get_orderbooks_from_file(input_path=input_path)[exchange],
unique_id=exchange,
trade_fee={'kraken': 0.0016, 'binance': 0.001}[exchange]
)
kraken = cex['kraken']
binance = cex['binance']

omnipool = OmnipoolState(
tokens=tokens,
Expand Down

0 comments on commit 92fcc79

Please sign in to comment.