For the complete documentation index, see llms.txt. This page is also available as Markdown.

Priority Transactions

Testnet already uses the new L1CoreMessaging contract for createOrder, cancelAllOrders, withdraw, changePubKey and burnShares. Mainnet switches on November 8, 2026. See Environments & endpoints.

Priority Transactions offer a way to interact with the Lighter protocol directly via Ethereum. You can think of them as censorship-resistant operations - and use them to e.g. cancel all orders or withdraw your collateral. They can be executed via Lighter's proxy smart contract on Ethereum, which holds the platform's collateral: 0x3B4D794a66304F130a4Db8F2551B0070dfCf5ca7. Everything here works even if Lighter's API is unavailable.

Read functions:

  • addressToAccountIndex: the master account index of a layer 1 address.

  • desertMode: boolean, set to False unless desert mode gets activated.

  • getPendingBalance: the pending balance for a certain layer 1 account, you can find a complete list of asset IDs via the assetDetails endpoint.

  • getPendingBalanceLegacy: the pending balance for a certain layer 1 account before the spot upgrade. In this case, it can only be a USDC value.

  • lastAccountIndex: the highest master-account index assigned to an L1 wallet. This counter does not include sub-accounts or pools, whose indexes count down from the upper end of the account-index range.

  • tokenToAssetIndex: match an ERC20 contract address to its corresponding asset_index on the Lighter protocol.

Most have been left out, but you can check out all functions on Ethereum block explorers, e.g. Etherscan.

Write functions:

  • activateDesertMode

  • burnShares: allows you to burn shares of a Public Pool.

  • cancelAllOrders: cancels all open orders on Lighter for the specified account index.

  • cancelOutstandingDepositsForDesertMode

  • changePubKey: assign a newly created api key to an account index. Each key is tied to a single account index (if you use sub-accounts, you'll need to create new ones).

  • createOrder: submit reduce-only IOC orders

  • deposit: deposit assets to the platform. See Deposits, Transfers and Withdrawals for more details.

  • depositBatch: deposit to multiple addresses.

  • withdraw: withdraw assets from the platform. See Deposits, Transfers and Withdrawals for more details.

  • withdrawPendingBalance: claim an existing secure withdrawal. Whenever the gas isn't too steep in price, withdrawals will be claimed by the platform on the users' behalf.

  • withdrawPendingBalanceLegacy: claim an existing secure withdrawal that was requested before the addition of spot assets to the protocol.

transferERC20 and transferETH are contract-internal transfer helpers exposed in the ABI. They require msg.sender == address(this) and cannot be called directly by users or multisigs; they are not priority transactions for transferring between Lighter account owners.

Other unlisted administrative functions are reserved for the governor (a multi-sig controlled by the protocol) to manage markets and the protocol's settings. If you specify an account_index, you should sign with the wallet that controls said index.

Audits and the vulnerability disclosure policy: Security audits.

Last updated

Was this helpful?