agent.lighter.orders.create takes the order shape every venue shares, perpOpen, perpReduce, spotBuy and spotSell, sized the same way against the session’s own holding; a spotBuy names its size or value, never "max", and a perpOpen’s leverage defaults to cross margin. asset is a Lighter perpetual symbol from data.markets({ venue: "lighter" }), such as ETH, or a spot pair such as ETH/USDC, which trades from the account’s spot balance. "gtc" and "alo" limits rest at most 28 days, Lighter’s maximum order expiry. Results and their observation follow the Hyperliquid order results, with orderId the client order index Circuit assigns before sending. perpOpen takes takeProfit and stopLoss with the same rules; a Lighter exit waiting on its entry reports the entry’s size until it activates, then the entry’s fill.
Preparation rounds sizes down to the market’s sizeStep and tightens prices to its priceTick, both on its data.markets row. Lighter applies its minimums to orders that rest: a resting or trigger order below the market’s minimumSize, or a resting limit below its minimumNotional, is refused with BELOW_MINIMUM before anything is sent. Market and "ioc" orders, which never rest, carry no minimum. agent.orders.listOpen({ venue: "lighter" }) returns the session’s resting orders and lighter.orders.cancel({ orderId }) cancels one the session placed, completing with the order’s state if it already closed. lighter.margin.update(margin) takes the Hyperliquid account change isolatedMargin, or moves USDC between perps margin and the spot balance ({ kind: "routeTransfer", to: "spot" | "perps", amountUsdc }); Paper trading handles leverage and isolatedMargin as the venue applies them, and their spot buys spend only the collateral that open positions leave free.
A Lighter account belongs to the wallet’s Ethereum address. A swap into Lighter USDC from any source creates the account: the first deposit bridges to Ethereum USDC, then deposits through the lighter provider; later deposits and withdrawals route through Relay. Before the first order, Circuit registers a per-wallet API key derived from the wallet’s signature. Lighter USDC is asset 3 on network lighter, and perp holdings use kind: "perp" with the same fields as Hyperliquid.
agent.lighterRobinhood trades Lighter’s separate deployment on Robinhood Chain with the same methods and rules. It has its own account, markets and API key setup (setup with venue: "lighterRobinhood"), margins in USDG, asset 3 on network lighter-robinhood, and lists stock and ETF perpetuals such as NVDA and spot pairs such as NVDA/USDG in data.markets({ venue: "lighterRobinhood" }). Its spot pairs trade straight from the unified USDG collateral, so routeTransfer is refused. value, amountUsdc and minimumNotional count USDG there. Its first deposit comes from Robinhood Chain USDG through the lighter provider; later deposits and withdrawals route through Relay.