wait_for_lighter_collateral

Documentation for eth_defi.lighter.api.wait_for_lighter_collateral function.

async wait_for_lighter_collateral(lighter, account_index, expected_usdc, timeout=900)

Wait until the Lighter account shows deposited collateral.

L1 deposits are asynchronous. The Ethereum transaction can be mined before Lighter’s API reflects the credited USDC balance, so callers must wait before registering a trading key and opening a position.

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

  • account_index (int) – Lighter account index.

  • expected_usdc (decimal.Decimal) – Expected deposited USDC amount.

  • timeout (int) – Maximum wait in seconds.

Returns

Observed collateral.

Return type

decimal.Decimal