Update trading thresholds in config and main logic for improved order placement

This commit is contained in:
Nawaz Haider
2026-01-10 19:10:40 +06:00
parent e0cd82553a
commit 32518bfceb
3 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -6,7 +6,8 @@ POLYMARKET_WS_USER_URL = "wss://ws-subscriptions-clob.polymarket.com/ws/user"
CHAIN_ID = 137
REQUEST_TIMEOUT = 5
PROFIT_MARGIN = 0.02
TRADING_BPS_THRESHOLD = 50
TRADING_BPS_THRESHOLD = 10
MAX_TRADING_BPS_THRESHOLD = 30
MARKET_SESSION_SECONDS = 900
TIMEZONE = "US/Eastern"
MAX_TRADES = 2
+4 -2
View File
@@ -13,7 +13,7 @@ from utils.clob_orders import (
cache_token_trading_infos,
)
from utils.cpu_affinity import set_cpu_affinity
from config import MAX_TRADES
from config import MAX_TRADES, MAX_TRADING_BPS_THRESHOLD
gc.disable()
@@ -76,7 +76,9 @@ async def main():
up_bid_price = market_data["best_bid_price"]
up_ask_price = market_data["best_ask_price"]
if not ((0.2 < up_ask_price < 0.35) or (0.65 < up_bid_price < 0.8)):
if not ((0.2 < up_ask_price < 0.35) or (0.65 < up_bid_price < 0.8)) or (
market_data["micro_vs_mid_bps"] > MAX_TRADING_BPS_THRESHOLD
):
continue
down_ask_price = 1 - up_bid_price
+1 -1
View File
@@ -165,7 +165,7 @@ class OrderBook:
micro_price = (best_bid_price + best_ask_price) / 2
mid_price = (best_bid_price + best_ask_price) / 2
micro_vs_mid_bps = (micro_price - mid_price) * 10000
imcro_vs_mid_bps = (micro_price - mid_price) * 10000
return {
"best_bid_price": best_bid_price,