validate_position_reconstruction

Documentation for eth_defi.hyperliquid.position.validate_position_reconstruction function.

validate_position_reconstruction(fills)

Validate position reconstruction against API’s startPosition field.

The Hyperliquid API includes a startPosition field in each fill showing the position size before that fill. This function validates that our position tracking matches the API’s values.

Parameters

fills (list[eth_defi.hyperliquid.position.Fill]) – List of fills sorted by timestamp ascending

Returns

True if reconstruction matches API data, False otherwise

Return type

bool