-
Notifications
You must be signed in to change notification settings - Fork 15
Description
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:
passThe 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.