Skip to content
This repository was archived by the owner on Jul 7, 2026. It is now read-only.

Fix Poloniex trade parsing - #1115

Open
DeepCogNeural wants to merge 1 commit into
bmoscon:masterfrom
DeepCogNeural:codex/poloniex-trade-parsing
Open

Fix Poloniex trade parsing#1115
DeepCogNeural wants to merge 1 commit into
bmoscon:masterfrom
DeepCogNeural:codex/poloniex-trade-parsing

Conversation

@DeepCogNeural

@DeepCogNeural DeepCogNeural commented Jun 13, 2026

Copy link
Copy Markdown

Fixes #1113.

What changed

  • Parse every entry in Poloniex trades message batches instead of only data[0].
  • Set Trade.exchange to self.id and pass the Poloniex trade id via id=str(entry["id"]).
  • Use entry["quantity"] as Trade.amount; Poloniex amount is quote notional.
  • Add focused unit coverage for the issue sample and a two-trade batch sample.

Validation

  • .venv313/bin/python -m pytest tests/unit/test_poloniex.py 'tests/unit/test_exchange.py::test_exchange_playback[POLONIEX]' -q -> 3 passed
  • .venv313/bin/python -m flake8 cryptofeed/exchanges/poloniex.py tests/unit/test_poloniex.py -> passed
  • git diff --check -> passed

I also attempted .venv313/bin/python -m pytest tests/unit -q; it fails in unrelated non-Poloniex symbol/playback tests with stale fixture/API-shape errors, so I did not treat full unit as a passing signal.

No authenticated, private, or live trading paths were touched.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Poloniex: _trade emits quote notional as amount, puts trade id in exchange field, drops batched trades

1 participant