Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:HKUDS AI Trader Frontend Transaction Display

From Leeroopedia


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)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment