fix: market expiry guard, FAK orders, 2% slippage, sanitize CLOB logs
Market expiry guard (executor.js): - getMarketOptions() now returns endDateIso, active, acceptingOrders from Gamma API response - executeBuy() skips immediately if market is closed / not accepting orders - executeBuy() skips if market closes within MIN_MARKET_TIME_LEFT seconds (default 300 s = 5 min), logging exact time remaining - Add MIN_MARKET_TIME_LEFT to config and .env.example FAK + 2% slippage (executor.js): - Replace OrderType.FOK with OrderType.FAK for both BUY and SELL market orders — eliminates "FOK fully filled or killed" failures - Reduce slippage from 5% to 2% (price * 1.02 / price * 0.98) - Fix zero-fill detection: FAK success with 0 shares logs "no liquidity" and retries instead of recording a phantom fill CLOB log sanitization (logger.js + index.js): - Add sanitizeClobMessage(): strips axios config object (auth headers) from [CLOB Client] dumps, keeps only HTTP status + error string - Add interceptConsole(): overrides console.error/warn globally - Call interceptConsole() at startup in index.js Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
526076fe6e
commit
69d8d1401d
@@ -46,6 +46,9 @@ const config = {
|
||||
maxRetries: 5,
|
||||
retryDelay: 3000,
|
||||
|
||||
// Skip buy if market closes within this many seconds (default 5 minutes)
|
||||
minMarketTimeLeft: parseInt(process.env.MIN_MARKET_TIME_LEFT || '300', 10),
|
||||
|
||||
// ── Market Maker ──────────────────────────────────────────────
|
||||
mmAssets: (process.env.MM_ASSETS || 'btc')
|
||||
.split(',').map((s) => s.trim().toLowerCase()).filter(Boolean),
|
||||
|
||||
Reference in New Issue
Block a user