Skip to content

Fix Tide Chart gTrade resolve-pair endpoint using nonexistent SynthClient.get_asset_summary #45

@dive2tech

Description

@dive2tech

The Tide Chart tool’s gTrade integration currently calls a SynthClient method that does not exist, causing the /api/gtrade/resolve-pair endpoint to fail at runtime when it attempts to include the current asset price.

Affected Code

In tools/tide-chart/main.py:

# /api/gtrade/resolve-pair
current_price = None
try:
    summary = client.get_asset_summary(asset)
    if summary and "current_price" in summary:
        current_price = summary["current_price"]
except Exception:
    pass

The SynthClient implementation (synth_client/client.py) does not define get_asset_summary, only methods like get_prediction_percentiles, get_volatility, get_option_pricing, etc. As a result, this code path will raise an AttributeError in real usage:

AttributeError: 'SynthClient' object has no attribute 'get_asset_summary'

Tests for /api/gtrade/resolve-pair only assert the presence of pair_index and do not exercise or validate the current_price field, so this bug is not currently caught by the test suite.

Impact

The /api/gtrade/resolve-pair endpoint can crash whenever it tries to compute current_price for a valid asset, breaking Tide Chart’s gTrade wallet/position UI.
Frontend consumers expecting a stable JSON shape (including current_price) may receive 500 responses or responses missing this field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions