Skip to content

Commit 515a701

Browse files
committed
[Tickers] ignore closed markets
1 parent b92b2be commit 515a701

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.2.2] - 2024-12-12
8+
### Fixed
9+
- ignore closed markets
10+
711
## [1.2.1] - 2024-10-24
812
### Updated
913
- remove non spot symbols from detection

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
# start arbitrage detection
2222
print("Scanning...")
23-
exchange_name = "binanceus" # allow pickable exchange_id from https://github.com/ccxt/ccxt/wiki/manual#exchanges
23+
exchange_name = "bitget" # allow pickable exchange_id from https://github.com/ccxt/ccxt/wiki/manual#exchanges
2424

2525
best_opportunities, best_profit = asyncio.run(detector.run_detection(exchange_name, max_cycle=3))
2626

triangular_arbitrage/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
PROJECT_NAME = "OctoBot-Triangular-Arbitrage"
2-
VERSION = "1.2.1"
2+
VERSION = "1.2.2"

triangular_arbitrage/detector.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __repr__(self):
2020

2121

2222
async def fetch_tickers(exchange):
23-
return await exchange.fetch_tickers() if exchange.has['fetchTickers'] else []
23+
return await exchange.fetch_tickers() if exchange.has['fetchTickers'] else {}
2424

2525

2626
def get_symbol_from_key(key_symbol: str) -> symbols.Symbol:
@@ -101,9 +101,16 @@ async def get_exchange_data(exchange_name):
101101
exchange_class = getattr(ccxt, exchange_name)
102102
exchange = exchange_class()
103103
tickers = await fetch_tickers(exchange)
104+
filtered_tickers = {
105+
symbol: ticker
106+
for symbol, ticker in tickers.items()
107+
if exchange.markets.get(symbol, {}).get(
108+
"active", True
109+
) is True
110+
}
104111
exchange_time = exchange.milliseconds()
105112
await exchange.close()
106-
return tickers, exchange_time
113+
return filtered_tickers, exchange_time
107114

108115

109116
async def get_exchange_last_prices(exchange_name, ignored_symbols, whitelisted_symbols=None):

0 commit comments

Comments
 (0)