Conversation
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
🐛 1 issue in files not directly in the diff
🐛 Duplicate field names in Candle model destroy 5 of 12 data fields (lighter/models/candle.py:34-39)
The revert commit renamed the uppercase Pydantic field names (O, H, L, C, V) to lowercase (o, h, l, c, v), creating duplicates with the existing lowercase fields on lines 30–33 and 38. In Pydantic v2, the second definition silently overrides the first, so the model collapses from 12 fields to 7. The plain o (open), h (high), l (low), c (close), and v (volume0) fields are completely lost — their definitions are replaced by the aliased raw variants.
Verified impact via runtime test
Confirmed via Candle.model_fields: only 7 fields remain (t, o (alias=O), h (alias=H), l (alias=L), c (alias=C), v (alias=V), i). When validating {"o": 100, "O": 99, ...}, accessing candle.o returns 99 (the raw value) not 100 (the open value). model_dump(by_alias=True) produces only 7 keys, omitting o, h, l, c, v entirely.
View 18 additional findings in Devin Review.
Mirrors the real SignerClient shape where order submission returns only fill/tx info and post-order state is queried separately. Callers detect liquidation via get_position() returning None or get_health().has_been_liquidated. Fixes AttributeError in paper_trading_health.py when an aggressive order is liquidated on the same tick as the fill and get_position(0) returns None.
Summary
lighter-pythonWhat's included
lighter/paper_client/package: types, matching engine, accounting, risk/liquidation, order book runtimeTesting and Examples
examples/