All MicroEvals
Operational Rules & Constraints 1. Data Source The applicati...
Create MicroEval

Operational Rules & Constraints 1. Data Source The applicati...

Prompt

Operational Rules & Constraints 1. Data Source The application must use Binance USDⓈ-M Futures WebSocket streams exclusively for real-time market data. • Trade/aggregate-trade data must be used as the source for traded volume and last traded price. • No REST API endpoints may be used to obtain historical market data. • No historical backfill is permitted at startup or during normal operation. • The application must process only data received through the live WebSocket connection. 2. Historical Data and Startup The application must not request or reconstruct historical data when it starts. Upon startup: 1. Establish the required Binance Futures WebSocket subscriptions. 2. Begin collecting live trade data immediately. 3. Populate the rolling buffers exclusively from incoming live data. 4. Do not evaluate an asset as fully qualified until a complete 18-minute rolling window has been accumulated. The first 18 minutes constitute the mandatory cold-start/warm-up period. During warm-up, data continues accumulating, but Layer 1 and Layer 2 results are not considered valid until a complete 18-minute window is available. 3. Rolling Window Each monitored USDT Futures pair maintains an 18-minute rolling window of incoming trade data. At any evaluation time now, the window represents: [now - 18 minutes, now] As new trade events arrive: • New events are added to the buffer. • Events older than 18 minutes are removed. • The buffer therefore continuously represents the most recent 18 minutes of live market activity. The same rolling-window mechanism must be used consistently for price and volume calculations. 4. Sub-Window Definitions The 18-minute window is divided into three consecutive chronological periods: • Window A — Earliest: 15 minutes o [now - 18m, now - 3m) • Window B — Intermediate: 2 minutes o [now - 3m, now - 1m) • Window C — Latest: 1 minute o [now - 1m, now] Window B separates Window A from Window C. The Layer 1 volume calculation uses Window A and Window C. 5. Window Boundary Rules The implementation must use a consistent half-open interval convention to prevent double-counting: • Window A: [now - 18m, now - 3m) • Window B: [now - 3m, now - 1m) • Window C: [now - 1m, now] A trade occurring exactly at a boundary belongs to only one window. Binance-provided event/trade timestamps must be used when determining window membership rather than local message-arrival time. Layer 1 — Volume Spike Filtering 6. Volume Definition For this specification, volume means traded base-asset quantity reported by the Binance trade/aggregate-trade stream. For example, if an event represents 5 BTC traded, the volume contribution is 5 BTC rather than its USDT notional value. The same volume definition must be used consistently for all monitored pairs. 7. Volume Calculations For every monitored USDT pair, calculate: Window A Volume Volume_A = sum(volume of trades in Window A) Window C Volume Volume_C = sum(volume of trades in Window C) These values must be maintained or recalculated at every one-second evaluation. 8. Dynamic Volume Threshold The volume qualification threshold is controlled by the user. • Default threshold: 40% • Adjustment increment: 10 percentage points • The threshold must support 200% and all values above 200%. • There is no artificial upper limit unless a maximum is explicitly specified later. The threshold is interpreted as a ratio of Window C volume to Window A volume. The qualification condition is: Volume_C >= T × Volume_A Examples: • T = 40% → Volume_C >= 0.40 × Volume_A • T = 100% → Volume_C >= 1.00 × Volume_A • T = 200% → Volume_C >= 2.00 × Volume_A • T = 250% → Volume_C >= 2.50 × Volume_A • T = 500% → Volume_C >= 5.00 × Volume_A Reaching 200% means 200% or higher. A value above 200% must continue to qualify normally and must not be capped at 200%. Changing the threshold must apply immediately to the current rolling buffers and must not reset the rolling window or any existing Layer 2 cooldown timer. Layer 2 — Qualification and 25-Minute Retention 9. Layer 2 Admission When a USDT pair satisfies the active volume-threshold condition: Volume_C >= T × Volume_A the pair graduates from Layer 1 to Layer 2. The volume trigger starts a 25-minute Layer 2 retention/cooldown timer. The pair must remain in Layer 2 for the entire 25-minute period unless the Layer 2 state is extended by another qualifying trigger. 10. Mandatory 25-Minute Retention Once a pair enters Layer 2, it must remain in Layer 2 for a full 25 minutes. The pair must not return to Layer 1 simply because the volume ratio subsequently falls below the active threshold. The original qualifying event starts the 25-minute timer. For example: • Pair qualifies at 12:00:00. • Layer 2 timer expires at 12:25:00. • The pair remains in Layer 2 continuously during this period unless the timer is reset, in which case the new 25-minute period begins from the reset event. 11. Volume Trigger During Cooldown A new volume qualification during the existing 25-minute Layer 2 period resets the timer. If: Volume_C >= T × Volume_A again occurs while the pair is already in Layer 2: • The existing timer is discarded. • A new full 25-minute timer starts immediately. • The pair remains in Layer 2. This means repeated qualifying volume spikes can keep a pair in Layer 2 indefinitely. 12. Price Trigger During Cooldown The Layer 2 timer must also reset whenever the pair's price movement reaches either of the following conditions: • Price increases above +2% • Price decreases below -2% The price movement is measured using Metric 2: Metric 2 = ((Current_Price - Price_15m_Mark) / Price_15m_Mark) × 100 Therefore: • If Metric 2 > +2%, reset the Layer 2 timer to 25 minutes. • If Metric 2 < -2%, reset the Layer 2 timer to 25 minutes. The trigger must be based on crossing the specified boundary, not merely remaining on the same side indefinitely. 13. Trigger Reset Behavior Any qualifying trigger occurring during the Layer 2 cooldown resets the timer to a new full 25-minute period. Qualifying triggers are: 1. A new volume-threshold qualification. 2. A price movement above +2%. 3. A price movement below -2%. Each qualifying trigger has the same effect: Current Layer 2 timer → reset → 25 minutes The 25-minute period is therefore measured from the most recent qualifying trigger, not from the original Layer 2 admission. 14. Repeated Triggers The reset mechanism continues indefinitely while qualifying triggers continue to occur. For example: • 12:00 — volume threshold reached → Layer 2 for 25 minutes. • 12:10 — price exceeds +2% → timer resets to 25 minutes. • 12:25 — new volume threshold reached → timer resets again. • 12:40 — price falls below -2% → timer resets again. The pair remains in Layer 2 because each qualifying event starts a new full 25-minute period. There is no maximum number of timer resets. 15. Cooldown Expiration If none of the qualifying triggers occur during the complete 25-minute period: • The Layer 2 timer expires. • The USDT pair automatically returns to Layer 1. • No historical data is fetched or used to determine its new state. • The pair may subsequently graduate to Layer 2 again if a new qualifying volume threshold is reached. The pair must therefore satisfy a complete uninterrupted 25-minute period with no qualifying volume or price trigger before it can leave Layer 2. Layer 2 — Multi-Timeframe Price Performance 16. Reference Prices Layer 2 uses three price references: 1. Window Start Price o Price at approximately now - 18 minutes. 2. 15-Minute Mark Price o Price at approximately now - 3 minutes. o This is the boundary between Window A and Window B. 3. Current Price o Latest available traded price at the current one-second evaluation. If no trade occurs exactly at a target timestamp, use the latest trade at or before that timestamp. No future trade may be used to establish a historical reference price. If a valid reference price cannot be established from the available live buffer, the pair must not be ranked until sufficient valid data exists. 17. Metric 1 Metric 1 measures price performance during Window A: Metric 1 = ((Price_15m_Mark - Price_Window_Start) / Price_Window_Start) × 100 This represents the percentage price change over the first 15 minutes of the 18-minute rolling window. 18. Metric 2 Metric 2 measures price performance from the end of Window A to the current price: Metric 2 = ((Current_Price - Price_15m_Mark) / Price_15m_Mark) × 100 Metric 2 is the primary ranking metric and is also used for the ±2% Layer 2 price-trigger conditions. Layer 2 Ranking and Display 19. Ranking At every one-second evaluation: 1. Calculate Metric 1. 2. Calculate Metric 2. 3. Maintain the Layer 2 membership state and cooldown timers. 4. Separate Layer 2 pairs into positive and negative Metric 2 groups. 5. Sort positive pairs by Metric 2 in descending order. 6. Sort negative pairs by Metric 2 in ascending order. 7. Display up to 30 pairs on each side. Metric 1 is displayed for information but does not affect ranking. 20. Positive Performance The right side displays up to 30 Layer 2 USDT pairs where: Metric 2 > 0 They are sorted from the highest positive Metric 2 to the lowest positive Metric 2. Positive entries are displayed in green. Each entry displays: • USDT pair/symbol • Metric 1 • Metric 2 • Remaining Layer 2 cooldown time 21. Negative Performance The left side displays up to 30 Layer 2 USDT pairs where: Metric 2 < 0 They are sorted from the largest percentage decline to the smallest percentage decline. Negative entries are displayed in red. Each entry displays: • USDT pair/symbol • Metric 1 • Metric 2 • Remaining Layer 2 cooldown time Pairs with: Metric 2 = 0 are not displayed on either side. Layer 2 State Machine Each USDT pair effectively follows this state logic: LAYER 1 → volume threshold reached → LAYER 2 / 25-MINUTE TIMER While in Layer 2: New qualifying volume → reset timer to 25 minutes Metric 2 > +2% → reset timer to 25 minutes Metric 2 < -2% → reset timer to 25 minutes If none of the above triggers occur for the complete 25-minute period: LAYER 2 → LAYER 1 A new qualifying trigger at any later time can move the pair from Layer 1 back into Layer 2. Evaluation Frequency The application must execute the state-management and ranking cycle once every second. Each one-second cycle must: 1. Process the latest available WebSocket data. 2. Update the 18-minute rolling buffers. 3. Remove expired events. 4. Calculate Window A and Window C volume. 5. Evaluate the active volume threshold. 6. Check Layer 2 membership and cooldown timers. 7. Detect qualifying volume triggers. 8. Calculate Metric 1 and Metric 2. 9. Detect qualifying ±2% price triggers for Layer 2 pairs. 10. Reset any applicable 25-minute timers. 11. Expire timers that have completed a full 25 minutes without a qualifying trigger. 12. Recalculate the Layer 2 rankings. 13. Update the interface. Incoming WebSocket trades may arrive many times per second and must be retained in the rolling buffers. The one-second cycle controls the official calculation, state-transition, ranking, and UI-update frequency. Overall Flow The complete process is: Live Binance Futures WebSocket → 18-minute rolling buffers → Window A / B / C → Volume A + Volume C → Dynamic volume threshold → Volume qualification → Layer 2 → 25-minute cooldown → Volume / +2% / -2% trigger detection → Timer reset when triggered → Layer 2 ranking → Top 30 positive / Top 30 negative → Timer expires after 25 trigger-free minutes → Return to Layer 1 The Layer 2 timer is therefore a sliding 25-minute inactivity period: every qualifying volume or price trigger extends Layer 2 by another full 25 minutes from the latest trigger. No REST historical data may be used to initialize, backfill, repair, or extend any of these calculations.

A system prompt was added to support web rendering

Drag to resize

Response not available

Drag to resize
Drag to resize