Skip to content

Fix Tide Chart gTrade resolve-pair asset summary#46

Open
dive2tech wants to merge 1 commit intoentrius:mainfrom
dive2tech:fix-tidechart-gtrade-asset-summary
Open

Fix Tide Chart gTrade resolve-pair asset summary#46
dive2tech wants to merge 1 commit intoentrius:mainfrom
dive2tech:fix-tidechart-gtrade-asset-summary

Conversation

@dive2tech
Copy link

@dive2tech dive2tech commented Mar 16, 2026

Summary

This PR fixes the Tide Chart gTrade resolve-pair endpoint so it uses a supported SynthClient API and reliably returns the current asset price for the frontend.

Related Issues

#45

Type of Change

  • Bug fix
  • Improvement to existing tool
  • Documentation
  • Other (describe below)

Changes

  • Added get_asset_summary(asset, horizon) to SynthClient to expose a small, typed snapshot including asset, horizon, and current_price, backed by get_prediction_percentiles.
  • Updated /api/gtrade/resolve-pair in the Tide Chart server to call client.get_asset_summary(asset, horizon="24h") instead of a non-existent client method, and to always return a stable JSON shape with asset, pair_index, and current_price.
  • Extended tests to cover:
    • The new get_asset_summary helper, including validation of asset and horizon inputs.
    • The Tide Chart /api/gtrade/resolve-pair route, asserting that current_price is present and numeric when mock Synth data is available.

Testing

  • Unit tests for synth_client:
    • tests/test_synth_client.py::test_get_asset_summary_returns_current_price
    • tests/test_synth_client.py::test_get_asset_summary_rejects_unsupported_asset
    • tests/test_synth_client.py::test_get_asset_summary_rejects_unsupported_horizon
  • Tide Chart tool tests:
    • tools/tide-chart/tests/test_tool.py::test_flask_gtrade_resolve_pair_valid
      Run:
pytest tests/test_synth_client.py
pytest tools/tide-chart/tests/test_tool.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant