wiki/exchanges/lighter.md
<a name="lighter" id="lighter"></a>
Kind: global class
Extends: <code>Exchange</code>
<a name="preLoadLighterLibrary" id="preloadlighterlibrary"></a>
if the required credentials are available in options, it will pre-load the lighter Signer to avoid delaying sensitive calls like createOrder the first time they're executed
Kind: instance method of <code>lighter</code>
Returns: <code>boolean</code> - true if the signer was loaded, false otherwise
| Param |
|---|
| params |
lighter.preLoadLighterLibrary (params, [undefined])
<a name="createOrder" id="createorder"></a>
create a trade order
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of currency you want to trade in units of base currency |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.timeInForce | <code>string</code> | No | 'GTT' or 'IOC', default is 'GTT' |
| params.clientOrderId | <code>int</code> | No | client order id, should be unique for each order, default is a random number |
| params.triggerPrice | <code>string</code> | No | trigger price for stop loss or take profit orders, in units of the quote currency |
| params.reduceOnly | <code>boolean</code> | No | whether the order is reduce only, default false |
| params.nonce | <code>int</code> | No | nonce for the account |
| params.apiKeyIndex | <code>int</code> | No | apiKeyIndex |
| params.accountIndex | <code>int</code> | No | accountIndex |
| params.orderExpiry | <code>int</code> | No | orderExpiry |
lighter.createOrder (symbol, type, side, amount[, price, params])
<a name="editOrder" id="editorder"></a>
cancels an order and places a new order
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of the currency you want to trade in units of the base currency |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountIndex | <code>string</code> | No | account index |
| params.apiKeyIndex | <code>string</code> | No | api key index |
lighter.editOrder (id, symbol, type, side, amount[, price, params])
<a name="fetchStatus" id="fetchstatus"></a>
the latest known information on the availability of the exchange API
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a status structure
See: https://apidocs.lighter.xyz/reference/status
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.fetchStatus ([params])
<a name="fetchTime" id="fetchtime"></a>
fetches the current integer timestamp in milliseconds from the exchange server
Kind: instance method of <code>lighter</code>
Returns: <code>int</code> - the current integer timestamp in milliseconds from the exchange server
See: https://apidocs.lighter.xyz/reference/status
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.fetchTime ([params])
<a name="fetchMarkets" id="fetchmarkets"></a>
retrieves data on all markets for lighter
Kind: instance method of <code>lighter</code>
Returns: <code>Array<object></code> - an array of objects representing market data
See: https://apidocs.lighter.xyz/reference/orderbookdetails
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.fetchMarkets ([params])
<a name="fetchCurrencies" id="fetchcurrencies"></a>
fetches all available currencies on an exchange
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - an associative dictionary of currencies
See: https://apidocs.lighter.xyz/reference/assetdetails
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.fetchCurrencies ([params])
<a name="fetchOrderBook" id="fetchorderbook"></a>
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See: https://apidocs.lighter.xyz/reference/orderbookorders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.fetchOrderBook (symbol[, limit, params])
<a name="fetchTicker" id="fetchticker"></a>
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a ticker structure
See: https://apidocs.lighter.xyz/reference/orderbookdetails
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.fetchTicker (symbol[, params])
<a name="fetchTickers" id="fetchtickers"></a>
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a dictionary of ticker structures
See: https://apidocs.lighter.xyz/reference/orderbookdetails
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.fetchTickers (symbols[, params])
<a name="fetchOHLCV" id="fetchohlcv"></a>
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>lighter</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
See: https://apidocs.lighter.xyz/reference/candles
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest candle to fetch |
lighter.fetchOHLCV (symbol, timeframe[, since, limit, params])
<a name="fetchFundingRates" id="fetchfundingrates"></a>
fetch the current funding rate for multiple symbols
Kind: instance method of <code>lighter</code>
Returns: <code>Array<object></code> - a list of funding rate structures
See: https://apidocs.lighter.xyz/reference/funding-rates
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.fetchFundingRates ([symbols, params])
<a name="fetchPosition" id="fetchposition"></a>
fetch data on an open position
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a position structure
See: https://apidocs.lighter.xyz/reference/account-1
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market the position is held in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.by | <code>string</code> | No | fetch balance by 'index' or 'l1_address', defaults to 'index' |
| params.value | <code>string</code> | No | fetch balance value, account index or l1 address |
lighter.fetchPosition (symbol[, params])
<a name="fetchPositions" id="fetchpositions"></a>
fetch all open positions
Kind: instance method of <code>lighter</code>
Returns: <code>Array<object></code> - a list of position structure
See: https://apidocs.lighter.xyz/reference/account-1
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.by | <code>string</code> | No | fetch balance by 'index' or 'l1_address', defaults to 'index' |
| params.value | <code>string</code> | No | fetch balance value, account index or l1 address |
lighter.fetchPositions ([symbols, params])
<a name="fetchAccounts" id="fetchaccounts"></a>
fetch all the accounts associated with a profile
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a dictionary of account structures indexed by the account type
See: https://apidocs.lighter.xyz/reference/account-1
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.by | <code>string</code> | No | fetch balance by 'index' or 'l1_address', defaults to 'index' |
| params.value | <code>string</code> | No | fetch balance value, account index or l1 address |
lighter.fetchAccounts ([params])
<a name="fetchOpenOrders" id="fetchopenorders"></a>
fetch all unfilled currently open orders
Kind: instance method of <code>lighter</code>
Returns: <code>Array<Order></code> - a list of order structures
See: https://apidocs.lighter.xyz/reference/accountactiveorders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch open orders for |
| limit | <code>int</code> | No | the maximum number of open orders structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountIndex | <code>string</code> | No | account index |
lighter.fetchOpenOrders (symbol[, since, limit, params])
<a name="fetchClosedOrders" id="fetchclosedorders"></a>
fetch all unfilled currently closed orders
Kind: instance method of <code>lighter</code>
Returns: <code>Array<Order></code> - a list of order structures
See: https://apidocs.lighter.xyz/reference/accountinactiveorders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch open orders for |
| limit | <code>int</code> | No | the maximum number of open orders structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountIndex | <code>string</code> | No | account index |
lighter.fetchClosedOrders (symbol[, since, limit, params])
<a name="transfer" id="transfer"></a>
transfer currency internally between wallets on the same account
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a transfer structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | amount to transfer |
| fromAccount | <code>string</code> | Yes | account to transfer from (spot, perp) |
| toAccount | <code>string</code> | Yes | account to transfer to (spot, perp) |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountIndex | <code>string</code> | No | account index |
| params.toAccountIndex | <code>string</code> | No | to account index, defaults to fromAccountIndex |
| params.apiKeyIndex | <code>string</code> | No | api key index |
| params.memo | <code>string</code> | No | hex encoding memo |
lighter.transfer (code, amount, fromAccount, toAccount[, params])
<a name="fetchTransfers" id="fetchtransfers"></a>
fetch a history of internal transfers made on an account
Kind: instance method of <code>lighter</code>
Returns: <code>Array<object></code> - a list of transfer structures
See: https://apidocs.lighter.xyz/reference/transfer_history
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code of the currency transferred |
| since | <code>int</code> | No | the earliest time in ms to fetch transfers for |
| limit | <code>int</code> | No | the maximum number of transfers structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountIndex | <code>string</code> | No | account index |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
lighter.fetchTransfers (code[, since, limit, params])
<a name="fetchDeposits" id="fetchdeposits"></a>
fetch all deposits made to an account
Kind: instance method of <code>lighter</code>
Returns: <code>Array<object></code> - a list of transaction structures
See: https://apidocs.lighter.xyz/reference/deposit_history
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch deposits for |
| limit | <code>int</code> | No | the maximum number of deposits structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountIndex | <code>string</code> | No | account index |
| params.address | <code>string</code> | No | l1_address |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
lighter.fetchDeposits ([code, since, limit, params])
<a name="fetchWithdrawals" id="fetchwithdrawals"></a>
fetch all withdrawals made from an account
Kind: instance method of <code>lighter</code>
Returns: <code>Array<object></code> - a list of transaction structures
See: https://apidocs.lighter.xyz/reference/withdraw_history
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch withdrawals for |
| limit | <code>int</code> | No | the maximum number of withdrawals structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountIndex | <code>string</code> | No | account index |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
lighter.fetchWithdrawals ([code, since, limit, params])
<a name="withdraw" id="withdraw"></a>
make a withdrawal
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a transaction structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | the amount to withdraw |
| address | <code>string</code> | Yes | the address to withdraw to |
| tag | <code>string</code> | No | |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountIndex | <code>string</code> | No | account index |
| params.apiKeyIndex | <code>string</code> | No | api key index |
| params.routeType | <code>int</code> | No | wallet type, 0: perp, 1: spot, default is 0 |
lighter.withdraw (code, amount, address[, tag, params])
<a name="fetchMyTrades" id="fetchmytrades"></a>
fetch all trades made by the user
Kind: instance method of <code>lighter</code>
Returns: <code>Array<object></code> - a list of trade structures
See: https://apidocs.lighter.xyz/reference/trades
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | No | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountIndex | <code>string</code> | No | account index |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
| params.until | <code>int</code> | No | timestamp in ms of the latest trade to fetch |
lighter.fetchMyTrades ([symbol, since, limit, params])
<a name="setLeverage" id="setleverage"></a>
set the level of leverage for a market
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | <code>float</code> | Yes | the rate of leverage |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountIndex | <code>string</code> | No | account index |
| params.apiKeyIndex | <code>string</code> | No | api key index |
| params.marginMode | <code>string</code> | No | margin mode, 'cross' or 'isolated' |
lighter.setLeverage (leverage, symbol[, params])
<a name="setMarginMode" id="setmarginmode"></a>
set margin mode to 'cross' or 'isolated'
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| marginMode | <code>string</code> | Yes | 'cross' or 'isolated' |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountIndex | <code>string</code> | No | account index |
| params.apiKeyIndex | <code>string</code> | No | api key index |
| params.leverage | <code>int</code> | No | required leverage |
lighter.setMarginMode (marginMode, symbol[, params])
<a name="cancelOrder" id="cancelorder"></a>
cancels an open order
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountIndex | <code>string</code> | No | account index |
| params.apiKeyIndex | <code>string</code> | No | api key index |
lighter.cancelOrder (id, symbol[, params])
<a name="cancelAllOrders" id="cancelallorders"></a>
cancel all open orders
Kind: instance method of <code>lighter</code>
Returns: <code>Array<object></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | No | unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountIndex | <code>string</code> | No | account index |
| params.apiKeyIndex | <code>string</code> | No | api key index |
lighter.cancelAllOrders ([symbol, params])
<a name="cancelAllOrdersAfter" id="cancelallordersafter"></a>
dead man's switch, cancel all orders after the given timeout
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - the api result
| Param | Type | Required | Description |
|---|---|---|---|
| timeout | <code>number</code> | Yes | time in milliseconds, 0 represents cancel the timer |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.cancelAllOrdersAfter (timeout[, params])
<a name="addMargin" id="addmargin"></a>
add margin
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a margin structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| amount | <code>float</code> | Yes | amount of margin to add |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.addMargin (symbol, amount[, params])
<a name="reduceMargin" id="reducemargin"></a>
remove margin from a position
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a margin structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| amount | <code>float</code> | Yes | the amount of margin to remove |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.reduceMargin (symbol, amount[, params])
<a name="setMargin" id="setmargin"></a>
Either adds or reduces margin in an isolated position in order to set the margin to a specific value
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - A margin structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market to set margin in |
| amount | <code>float</code> | Yes | the amount to set the margin to |
| params | <code>object</code> | No | parameters specific to the bingx api endpoint |
| params.accountIndex | <code>string</code> | No | account index |
| params.apiKeyIndex | <code>string</code> | No | api key index |
lighter.setMargin (symbol, amount[, params])
<a name="watchOrders" id="watchorders"></a>
watches information on multiple orders made by the user
Kind: instance property of <code>lighter</code>
Returns: <code>Array<object></code> - a list of order structures
See: https://apidocs.lighter.xyz/docs/websocket-reference#account-all-orders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.watchOrders (symbol[, since, limit, params])
<a name="watchOrderBook" id="watchorderbook"></a>
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See: https://apidocs.lighter.xyz/docs/websocket-reference#order-book
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.watchOrderBook (symbol[, limit, params])
<a name="unWatchOrderBook" id="unwatchorderbook"></a>
unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See: https://apidocs.lighter.xyz/docs/websocket-reference#order-book
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.unWatchOrderBook (symbol[, params])
<a name="watchTicker" id="watchticker"></a>
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a ticker structure
See: https://apidocs.lighter.xyz/docs/websocket-reference#market-stats
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.watchTicker (symbol[, params])
<a name="unWatchTicker" id="unwatchticker"></a>
unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a ticker structure
See: https://apidocs.lighter.xyz/docs/websocket-reference#market-stats
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.unWatchTicker (symbol[, params])
<a name="watchTickers" id="watchtickers"></a>
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a ticker structure
See: https://apidocs.lighter.xyz/docs/websocket-reference#market-stats
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.channel | <code>string</code> | No | the channel to subscribe to, tickers by default. Can be tickers, sprd-tickers, index-tickers, block-tickers |
lighter.watchTickers ([symbols, params])
<a name="unWatchTickers" id="unwatchtickers"></a>
unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a ticker structure
See: https://apidocs.lighter.xyz/docs/websocket-reference#market-stats
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.unWatchTickers ([symbols, params])
<a name="watchMarkPrice" id="watchmarkprice"></a>
watches a mark price
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a ticker structure
See: https://apidocs.lighter.xyz/docs/websocket-reference#market-stats
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.watchMarkPrice (symbol[, params])
<a name="watchMarkPrices" id="watchmarkprices"></a>
watches mark prices
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a ticker structure
See: https://apidocs.lighter.xyz/docs/websocket-reference#market-stats
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.watchMarkPrices ([symbols, params])
<a name="unWatchMarkPrice" id="unwatchmarkprice"></a>
unWatches a mark price
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a ticker structure
See: https://apidocs.lighter.xyz/docs/websocket-reference#market-stats
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.unWatchMarkPrice (symbol[, params])
<a name="unWatchMarkPrices" id="unwatchmarkprices"></a>
unWatches mark prices
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a ticker structure
See: https://apidocs.lighter.xyz/docs/websocket-reference#market-stats
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.unWatchMarkPrices ([symbols, params])
<a name="watchTrades" id="watchtrades"></a>
get the list of most recent trades for a particular symbol
Kind: instance method of <code>lighter</code>
Returns: <code>Array<object></code> - a list of trade structures
See: https://apidocs.lighter.xyz/docs/websocket-reference#trade
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.watchTrades (symbol[, since, limit, params])
<a name="unWatchTrades" id="unwatchtrades"></a>
unsubscribe from the trades channel
Kind: instance method of <code>lighter</code>
Returns: <code>Array<object></code> - a list of trade structures
See: https://apidocs.lighter.xyz/docs/websocket-reference#trade
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch trades for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.unWatchTrades (symbol[, params])
<a name="watchMyTrades" id="watchmytrades"></a>
subscribe to recent trades of an account.
Kind: instance method of <code>lighter</code>
Returns: <code>Array<object></code> - a list of trade structures
See: https://apidocs.lighter.xyz/docs/websocket-reference#account-all-trades
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | No | unified market symbol |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.watchMyTrades ([symbol, since, limit, params])
<a name="unWatchMyTrades" id="unwatchmytrades"></a>
unsubscribe from the account trades channel
Kind: instance method of <code>lighter</code>
Returns: <code>Array<object></code> - a list of trade structures
See: https://apidocs.lighter.xyz/docs/websocket-reference#account-all-trades
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | No | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.unWatchMyTrades ([symbol, params])
<a name="watchLiquidations" id="watchliquidations"></a>
watch the public liquidations of a trading pair
Kind: instance method of <code>lighter</code>
Returns: <code>Array<object></code> - a list of trade structures
See: https://apidocs.lighter.xyz/docs/websocket-reference#trade
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.watchLiquidations (symbol[, since, limit, params])
<a name="watchBalance" id="watchbalance"></a>
watch balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a balance structure
See: https://apidocs.lighter.xyz/docs/websocket-reference#account-all-assets
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code> | No | 'spot' or 'swap', default is 'swap' |
lighter.watchBalance ([params])
<a name="unWatchOrders" id="unwatchorders"></a>
unWatches information on multiple orders made by the user
Kind: instance method of <code>lighter</code>
Returns: <code>Array<object></code> - a list of order structures
See: https://apidocs.lighter.xyz/docs/websocket-reference#account-all-orders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
lighter.unWatchOrders (symbol[, params])