Lighter Get Account
Get Lighter account overview by L1 address or account index: account index(es), USDC collateral, available balance, and open perpetual positions with entry price, size, and PnL. Looks up all sub-accounts of an address in one call; falls back to the connected wallet when no address is given (Lighter account state is public, so any address can be queried). Ideal for: balance gates before trading, position monitoring, PnL alerts, and portfolio dashboards.
Catalog action Lighter
Get Lighter account overview by L1 address or account index: account index(es), USDC collateral, available balance, and open perpetual positions with entry price, size, and PnL. Looks up all sub-accounts of an address in one call; falls back to the connected wallet when no address is given (Lighter account state is public, so any address can be queried). Ideal for: balance gates before trading, position monitoring, PnL alerts, and portfolio dashboards.
At a Glance
| Field | Value |
|---|---|
| Action ID | lighter-get-account |
| Category | Lighter |
| Connector | Not required |
| Requires gas | No |
| Funds movement | None declared |
| Tags | perps, positions, balance, portfolio |
Payload Schema
| Field | Type | Required | Description |
|---|---|---|---|
l1Address | string | No | Ethereum L1 address (0x...) whose Lighter account(s) to read. Lighter account state is public, so any address can be queried. Omit to use the connected wallet's address. |
accountIndex | number | No | Explicit Lighter account index (e.g. 733136) to read a single account directly. Takes precedence over l1Address and the connected wallet. |
Result Schema
| Field | Type | Required | Description |
|---|---|---|---|
accountIndexes | array | Yes | All Lighter account indexes matched by the lookup (an L1 address can own several sub-accounts). These indexes identify the account in every other Lighter operation. |
truncated | boolean | No | True if the address has more sub-accounts than could be fetched. |
accounts | array | Yes | Matched Lighter account(s) with balances and open positions |
Examples
json{ "type": "lighter-get-account", "payload": { "l1Address": "0x0000000000000000000000000000000000000000", "accountIndex": 1 }, "children": []}
bashcurl -X POST "https://api.b3os.org/v1/actions/lighter-get-account/test" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "inputs": { "l1Address": "0x0000000000000000000000000000000000000000", "accountIndex": 1 }}'
Payload fields can use workflow expressions such as {{$trigger.body.amount}}, {{$nodes.fetch.result.price}}, and {{$props.asset}} when the value should come from a trigger, prior node, or reusable workflow prop.
