BTB Finance for agents

Protocols / Derivatives

Lighter

Perpetuals exchange on a zk rollup. Covers the zkLighter mainnet (settles to Ethereum, USDC collateral) and the Lighter exchange on Robinhood Chain (USDG collateral). An agent deposits collateral, trades perps with a signed API key, withdraws, and can also mint or burn shares of the protocol-run LLP pool.

On-chain + APIEVM3 contractsWebsite · Docs

get_protocol({ "protocol": "lighter" })

Risks an agent should know

What an agent can do

depositDeposit collateral from Ethereum or Robinhood Chain
approve the Lighter contract for the token, then call deposit(_to, _assetIndex, _routeType, _amount). On Robinhood Chain, a persistent intent address credits USDG on plain transfers without a contract call. The first credited deposit creates the account.
trade-perpPlace, change or cancel a perp order
create an API key, sign the order with the WASM signer (SignCreateOrder), and send it with sendTx. Read market IDs and decimals from orderBookDetails on each exchange. Market IDs are not shared between mainnet and Robinhood Chain.
withdraw-secureWithdraw to the account owner's own L1 address
sign SignWithdraw with the API key (no L1 signature needed) and send it with sendTx. Settles through Ethereum. If the withdrawal is not claimed, call withdrawPendingBalance on ZkLighter.
withdraw-fastFast withdrawal to any Ethereum address (USDC on mainnet, USDG on Robinhood Chain)
API key plus an L1 signature, through the fastwithdraw request. Minimum 4 USDC on mainnet and 1 USDG on Robinhood Chain. Robinhood Chain allows 20 fast withdrawals per hour.
transferMove funds between Lighter accounts or subaccounts
get the fee from transferFeeInfo, then sign and send the transfer. The fee is added on top of the amount.
lp-llp-mint-sharesDeposit USDC into the LLP pool for pool shares
sign TxTypeL2MintShares (type 18) with the LLP pool account index 281474976710654 as the pool, and send it with sendTx. Minted shares show up in the account endpoint. Check the price per share with publicPoolsMetadata (total asset value divided by total shares).
lp-llp-burn-sharesRedeem LLP pool shares for USDC
sign TxTypeL2BurnShares (type 19) for the LLP pool account index 281474976710654 and send it with sendTx. Redemption depends on the pool's available liquidity and strategy allocation.
check-accountRead balances, positions, orders and pool shares
GET account (by index or by L1 address through accountsByL1Address), accountActiveOrders and publicPoolsMetadata on the exchange's REST base. Use the WebSocket for live updates.

Contracts

ethereum · chain id 1

ContractAddressKey functionsTry
ZkLighter (proxy, zkLighter mainnet)
exchange · proxy
0x3B4D794a66304F130a4Db8F2551B0070dfCf5ca7
source
writedeposit(address,uint16,uint8,uint256)
Full ABI
L1CoreMessaging
bridge
0x183ef7195d443a3dA7EC1d7003BaCa1ff490757D
source
Full ABI

robinhood · chain id 4663

ContractAddressKey functionsTry
Lighter contract (Robinhood Chain)
exchange
0x94bAB9693Ba2f6358507eFfcbd372b0660AFfF9d
source
writedeposit(address,uint16,uint8,uint256)
Full ABI

APIs

Lighter REST and WebSocket (zkLighter mainnet)
auth: signature
https://mainnet.zklighter.elliot.ai/api/v1
Market data, account, positions, orders and history (read endpoints are public or need an auth token). Write actions are signed transactions sent with sendTx or sendTxBatch, signed by the official Python or TypeScript WASM signer with a registered API key. WebSocket: wss://mainnet.zklighter.elliot.ai/stream.
Lighter REST and WebSocket (Robinhood Chain)
auth: signature
https://api.rh.lighter.xyz/api/v1
Same API as mainnet for the Robinhood Chain exchange. Use chain ID 466324 when signing transactions. Keep base URL and chain ID together. WebSocket: wss://api.rh.lighter.xyz/stream.
Lighter deposit bridge (builders)
auth: api-key
https://bridge.lighter.xyz
Generate a universal deposit address and quote deposits from other chains. Needs an x-api-key that Lighter issues to builders. Robinhood Chain uses createIntentAddress on api.rh.lighter.xyz instead.

Notes

Mainnet addresses and chain IDs come from the Lighter environments page. ZkLighter's proxy was checked on Sourcify (EIP-1967, implementation 0x94E1f6d3e0c6fC3966747879299A089baF76A80F), but the implementation source is not verified on Sourcify. The deposit signature deposit(address,uint16,uint8,uint256) matches the documented selector 0x8a857083 on that proxy. withdrawPendingBalance (claim a pending secure withdrawal on ZkLighter) and depositBatch are documented by name only; their signatures were not confirmed, so they are not listed as keyFunctions. The withdraw function (selector 0xd20191bd) on L1CoreMessaging is documented, but no signature matching that selector was found, so it is left out. Since 2026-11-08, createOrder, cancelAllOrders, withdraw, changePubKey and burnShares go through L1CoreMessaging, not ZkLighter; that is why L1CoreMessaging is listed. The Robinhood Chain contract was not confirmed by eth_getCode (no public Robinhood mainnet RPC was reachable), and its ABI is not verified. The LLP is a public pool with account index 281474976710654. Other Lighter markets, RWA and binary option products are not covered.

Sources

Researched 2026-11-28. Addresses are copied from the official sources above; check them before moving large amounts.