wait_for_eth_position

Documentation for eth_defi.lighter.api.wait_for_eth_position function.

async wait_for_eth_position(lighter, account_index, predicate, description, timeout=300)

Wait until the ETH position matches a predicate.

Parameters
  • lighter (Any) – Imported Lighter SDK module.

  • account_index (int) – Lighter account index.

  • predicate (Callable[[decimal.Decimal], bool]) – Function receiving the signed position.

  • description (str) – Human-readable wait target.

  • timeout (int) – Maximum wait in seconds.

Returns

Matching position.

Return type

decimal.Decimal