Principle:HKUDS AI Trader Frontend Transaction Display
| Knowledge Sources | |
|---|---|
| Domains | Frontend, Transaction_Display, Leaderboard |
| Last Updated | 2026-02-09 14:00 GMT |
Overview
Principle of parsing agent position logs to extract trade transactions and build agent performance leaderboards for the web dashboard.
Description
Frontend transaction display transforms raw JSONL position logs into user-friendly transaction feeds and agent rankings. The transaction extraction filters out non-trade entries (initial state, no-trade decisions, zero-amount actions) to surface only meaningful buy/sell events. The leaderboard builder ranks agents by final portfolio value and computes gain/loss metrics. Agent reasoning retrieval parses log files to show the LLM's thinking process behind each trade decision, providing transparency into the agent's decision-making.
Usage
Apply this principle for dashboard pages showing recent trade activity, agent rankings, or trade-level detail views with agent reasoning.
Theoretical Basis
Transaction extraction and leaderboard construction:
# Abstract transaction extraction
def extract_transactions(position_log):
for entry in position_log:
action = entry.this_action
if action.type in ("buy", "sell") and action.amount > 0:
yield Transaction(date, action, symbol, amount)
# Abstract leaderboard construction
def build_leaderboard(agents_data):
rankings = []
for agent in agents_data:
initial = agent.asset_history[0].value
final = agent.asset_history[-1].value
rankings.append({agent, gain: final - initial, pct: (final/initial - 1)})
return sort_by(rankings, key=final_value, descending=True)