You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: sync stale placed orders to filled, improve market lookup
poly_get_open_orders:
- Now syncs DB: orders marked 'placed' in DB but no longer on CLOB exchange
are automatically updated to 'filled' (they were executed but status never updated)
- This fixes Trade History showing empty — filled orders now appear there
- Only truly live CLOB orders shown as open
- Reports sync count so agent knows orders were reconciled
poly_get_market:
- Added token_id lookup via clob_token_ids param
- Added CLOB API fallback to resolve condition_id from token
- Error message now shows the input that failed for debugging
summary: `${approvalPending.length} awaiting approval, ${placedOrders.length} placed (unfilled), ${clobLiveOrders.length} live on exchange`,
1881
+
summary: `${clobLiveOrders.length} open on exchange, ${approvalPending.length} awaiting approval`+(syncedCount>0 ? `, ${syncedCount} stale orders synced to filled` : ''),
...(syncedCount>0 ? {synced_to_filled: syncedCount,sync_note: `${syncedCount} orders were in DB as "placed" but no longer on exchange — marked as filled. They will now appear in Trade History.`} : {}),
0 commit comments