Back to Ccxt

Lighter

wiki/exchanges/lighter.md

4.5.5242.3 KB
Original Source

<a name="lighter" id="lighter"></a>

lighter{docsify-ignore}

Kind: global class
Extends: <code>Exchange</code>

<a name="preLoadLighterLibrary" id="preloadlighterlibrary"></a>

preLoadLighterLibrary{docsify-ignore}

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
javascript
lighter.preLoadLighterLibrary (params, [undefined])

<a name="createOrder" id="createorder"></a>

createOrder{docsify-ignore}

create a trade order

Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - an order structure

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified 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>Yeshow much of currency you want to trade in units of base currency
price<code>float</code>Nothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.timeInForce<code>string</code>No'GTT' or 'IOC', default is 'GTT'
params.clientOrderId<code>int</code>Noclient order id, should be unique for each order, default is a random number
params.triggerPrice<code>string</code>Notrigger price for stop loss or take profit orders, in units of the quote currency
params.reduceOnly<code>boolean</code>Nowhether the order is reduce only, default false
params.nonce<code>int</code>Nononce for the account
params.apiKeyIndex<code>int</code>NoapiKeyIndex
params.accountIndex<code>int</code>NoaccountIndex
params.orderExpiry<code>int</code>NoorderExpiry
javascript
lighter.createOrder (symbol, type, side, amount[, price, params])

<a name="editOrder" id="editorder"></a>

editOrder{docsify-ignore}

cancels an order and places a new order

Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - an order structure

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>Yesunified 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>Yeshow much of the currency you want to trade in units of the base currency
price<code>float</code>Nothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.accountIndex<code>string</code>Noaccount index
params.apiKeyIndex<code>string</code>Noapi key index
javascript
lighter.editOrder (id, symbol, type, side, amount[, price, params])

<a name="fetchStatus" id="fetchstatus"></a>

fetchStatus{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.fetchStatus ([params])

<a name="fetchTime" id="fetchtime"></a>

fetchTime{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.fetchTime ([params])

<a name="fetchMarkets" id="fetchmarkets"></a>

fetchMarkets{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.fetchMarkets ([params])

<a name="fetchCurrencies" id="fetchcurrencies"></a>

fetchCurrencies{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.fetchCurrencies ([params])

<a name="fetchOrderBook" id="fetchorderbook"></a>

fetchOrderBook{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the order book for
limit<code>int</code>Nothe maximum amount of order book entries to return
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.fetchOrderBook (symbol[, limit, params])

<a name="fetchTicker" id="fetchticker"></a>

fetchTicker{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.fetchTicker (symbol[, params])

<a name="fetchTickers" id="fetchtickers"></a>

fetchTickers{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>, <code>undefined</code>Yesunified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.fetchTickers (symbols[, params])

<a name="fetchOHLCV" id="fetchohlcv"></a>

fetchOHLCV{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch OHLCV data for
timeframe<code>string</code>Yesthe length of time each candle represents
since<code>int</code>Notimestamp in ms of the earliest candle to fetch
limit<code>int</code>Nothe maximum amount of candles to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Notimestamp in ms of the latest candle to fetch
javascript
lighter.fetchOHLCV (symbol, timeframe[, since, limit, params])

<a name="fetchFundingRates" id="fetchfundingrates"></a>

fetchFundingRates{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nolist of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.fetchFundingRates ([symbols, params])

<a name="fetchPosition" id="fetchposition"></a>

fetchPosition{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market the position is held in
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.by<code>string</code>Nofetch balance by 'index' or 'l1_address', defaults to 'index'
params.value<code>string</code>Nofetch balance value, account index or l1 address
javascript
lighter.fetchPosition (symbol[, params])

<a name="fetchPositions" id="fetchpositions"></a>

fetchPositions{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nolist of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.by<code>string</code>Nofetch balance by 'index' or 'l1_address', defaults to 'index'
params.value<code>string</code>Nofetch balance value, account index or l1 address
javascript
lighter.fetchPositions ([symbols, params])

<a name="fetchAccounts" id="fetchaccounts"></a>

fetchAccounts{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.by<code>string</code>Nofetch balance by 'index' or 'l1_address', defaults to 'index'
params.value<code>string</code>Nofetch balance value, account index or l1 address
javascript
lighter.fetchAccounts ([params])

<a name="fetchOpenOrders" id="fetchopenorders"></a>

fetchOpenOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
since<code>int</code>Nothe earliest time in ms to fetch open orders for
limit<code>int</code>Nothe maximum number of open orders structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.accountIndex<code>string</code>Noaccount index
javascript
lighter.fetchOpenOrders (symbol[, since, limit, params])

<a name="fetchClosedOrders" id="fetchclosedorders"></a>

fetchClosedOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
since<code>int</code>Nothe earliest time in ms to fetch open orders for
limit<code>int</code>Nothe maximum number of open orders structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.accountIndex<code>string</code>Noaccount index
javascript
lighter.fetchClosedOrders (symbol[, since, limit, params])

<a name="transfer" id="transfer"></a>

transfer{docsify-ignore}

transfer currency internally between wallets on the same account

Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a transfer structure

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
amount<code>float</code>Yesamount to transfer
fromAccount<code>string</code>Yesaccount to transfer from (spot, perp)
toAccount<code>string</code>Yesaccount to transfer to (spot, perp)
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.accountIndex<code>string</code>Noaccount index
params.toAccountIndex<code>string</code>Noto account index, defaults to fromAccountIndex
params.apiKeyIndex<code>string</code>Noapi key index
params.memo<code>string</code>Nohex encoding memo
javascript
lighter.transfer (code, amount, fromAccount, toAccount[, params])

<a name="fetchTransfers" id="fetchtransfers"></a>

fetchTransfers{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code of the currency transferred
since<code>int</code>Nothe earliest time in ms to fetch transfers for
limit<code>int</code>Nothe maximum number of transfers structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.accountIndex<code>string</code>Noaccount index
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
lighter.fetchTransfers (code[, since, limit, params])

<a name="fetchDeposits" id="fetchdeposits"></a>

fetchDeposits{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Nounified currency code
since<code>int</code>Nothe earliest time in ms to fetch deposits for
limit<code>int</code>Nothe maximum number of deposits structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.accountIndex<code>string</code>Noaccount index
params.address<code>string</code>Nol1_address
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
lighter.fetchDeposits ([code, since, limit, params])

<a name="fetchWithdrawals" id="fetchwithdrawals"></a>

fetchWithdrawals{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Nounified currency code
since<code>int</code>Nothe earliest time in ms to fetch withdrawals for
limit<code>int</code>Nothe maximum number of withdrawals structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.accountIndex<code>string</code>Noaccount index
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
lighter.fetchWithdrawals ([code, since, limit, params])

<a name="withdraw" id="withdraw"></a>

withdraw{docsify-ignore}

make a withdrawal

Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a transaction structure

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
amount<code>float</code>Yesthe amount to withdraw
address<code>string</code>Yesthe address to withdraw to
tag<code>string</code>No
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.accountIndex<code>string</code>Noaccount index
params.apiKeyIndex<code>string</code>Noapi key index
params.routeType<code>int</code>Nowallet type, 0: perp, 1: spot, default is 0
javascript
lighter.withdraw (code, amount, address[, tag, params])

<a name="fetchMyTrades" id="fetchmytrades"></a>

fetchMyTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Nounified market symbol
since<code>int</code>Nothe earliest time in ms to fetch trades for
limit<code>int</code>Nothe maximum number of trades structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.accountIndex<code>string</code>Noaccount index
params.paginate<code>boolean</code>Nodefault 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>Notimestamp in ms of the latest trade to fetch
javascript
lighter.fetchMyTrades ([symbol, since, limit, params])

<a name="setLeverage" id="setleverage"></a>

setLeverage{docsify-ignore}

set the level of leverage for a market

Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - response from the exchange

ParamTypeRequiredDescription
leverage<code>float</code>Yesthe rate of leverage
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.accountIndex<code>string</code>Noaccount index
params.apiKeyIndex<code>string</code>Noapi key index
params.marginMode<code>string</code>Nomargin mode, 'cross' or 'isolated'
javascript
lighter.setLeverage (leverage, symbol[, params])

<a name="setMarginMode" id="setmarginmode"></a>

setMarginMode{docsify-ignore}

set margin mode to 'cross' or 'isolated'

Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - response from the exchange

ParamTypeRequiredDescription
marginMode<code>string</code>Yes'cross' or 'isolated'
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.accountIndex<code>string</code>Noaccount index
params.apiKeyIndex<code>string</code>Noapi key index
params.leverage<code>int</code>Norequired leverage
javascript
lighter.setMarginMode (marginMode, symbol[, params])

<a name="cancelOrder" id="cancelorder"></a>

cancelOrder{docsify-ignore}

cancels an open order

Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - an order structure

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>Yesunified symbol of the market the order was made in
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.accountIndex<code>string</code>Noaccount index
params.apiKeyIndex<code>string</code>Noapi key index
javascript
lighter.cancelOrder (id, symbol[, params])

<a name="cancelAllOrders" id="cancelallorders"></a>

cancelAllOrders{docsify-ignore}

cancel all open orders

Kind: instance method of <code>lighter</code>
Returns: <code>Array<object></code> - a list of order structures

ParamTypeRequiredDescription
symbol<code>string</code>Nounified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.accountIndex<code>string</code>Noaccount index
params.apiKeyIndex<code>string</code>Noapi key index
javascript
lighter.cancelAllOrders ([symbol, params])

<a name="cancelAllOrdersAfter" id="cancelallordersafter"></a>

cancelAllOrdersAfter{docsify-ignore}

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

ParamTypeRequiredDescription
timeout<code>number</code>Yestime in milliseconds, 0 represents cancel the timer
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.cancelAllOrdersAfter (timeout[, params])

<a name="addMargin" id="addmargin"></a>

addMargin{docsify-ignore}

add margin

Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a margin structure

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
amount<code>float</code>Yesamount of margin to add
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.addMargin (symbol, amount[, params])

<a name="reduceMargin" id="reducemargin"></a>

reduceMargin{docsify-ignore}

remove margin from a position

Kind: instance method of <code>lighter</code>
Returns: <code>object</code> - a margin structure

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
amount<code>float</code>Yesthe amount of margin to remove
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.reduceMargin (symbol, amount[, params])

<a name="setMargin" id="setmargin"></a>

setMargin{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market to set margin in
amount<code>float</code>Yesthe amount to set the margin to
params<code>object</code>Noparameters specific to the bingx api endpoint
params.accountIndex<code>string</code>Noaccount index
params.apiKeyIndex<code>string</code>Noapi key index
javascript
lighter.setMargin (symbol, amount[, params])

<a name="watchOrders" id="watchorders"></a>

watchOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.watchOrders (symbol[, since, limit, params])

<a name="watchOrderBook" id="watchorderbook"></a>

watchOrderBook{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the order book for
limit<code>int</code>Nothe maximum amount of order book entries to return
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.watchOrderBook (symbol[, limit, params])

<a name="unWatchOrderBook" id="unwatchorderbook"></a>

unWatchOrderBook{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.unWatchOrderBook (symbol[, params])

<a name="watchTicker" id="watchticker"></a>

watchTicker{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.watchTicker (symbol[, params])

<a name="unWatchTicker" id="unwatchticker"></a>

unWatchTicker{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.unWatchTicker (symbol[, params])

<a name="watchTickers" id="watchtickers"></a>

watchTickers{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nounified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.channel<code>string</code>Nothe channel to subscribe to, tickers by default. Can be tickers, sprd-tickers, index-tickers, block-tickers
javascript
lighter.watchTickers ([symbols, params])

<a name="unWatchTickers" id="unwatchtickers"></a>

unWatchTickers{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nounified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.unWatchTickers ([symbols, params])

<a name="watchMarkPrice" id="watchmarkprice"></a>

watchMarkPrice{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.watchMarkPrice (symbol[, params])

<a name="watchMarkPrices" id="watchmarkprices"></a>

watchMarkPrices{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nounified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.watchMarkPrices ([symbols, params])

<a name="unWatchMarkPrice" id="unwatchmarkprice"></a>

unWatchMarkPrice{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.unWatchMarkPrice (symbol[, params])

<a name="unWatchMarkPrices" id="unwatchmarkprices"></a>

unWatchMarkPrices{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nounified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.unWatchMarkPrices ([symbols, params])

<a name="watchTrades" id="watchtrades"></a>

watchTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch trades for
since<code>int</code>Notimestamp in ms of the earliest trade to fetch
limit<code>int</code>Nothe maximum amount of trades to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.watchTrades (symbol[, since, limit, params])

<a name="unWatchTrades" id="unwatchtrades"></a>

unWatchTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch trades for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.unWatchTrades (symbol[, params])

<a name="watchMyTrades" id="watchmytrades"></a>

watchMyTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Nounified market symbol
since<code>int</code>Notimestamp in ms of the earliest trade to fetch
limit<code>int</code>Nothe maximum amount of trades to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.watchMyTrades ([symbol, since, limit, params])

<a name="unWatchMyTrades" id="unwatchmytrades"></a>

unWatchMyTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Nounified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.unWatchMyTrades ([symbol, params])

<a name="watchLiquidations" id="watchliquidations"></a>

watchLiquidations{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch trades for
since<code>int</code>Notimestamp in ms of the earliest trade to fetch
limit<code>int</code>Nothe maximum amount of trades to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.watchLiquidations (symbol[, since, limit, params])

<a name="watchBalance" id="watchbalance"></a>

watchBalance{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.type<code>string</code>No'spot' or 'swap', default is 'swap'
javascript
lighter.watchBalance ([params])

<a name="unWatchOrders" id="unwatchorders"></a>

unWatchOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market orders were made in
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
lighter.unWatchOrders (symbol[, params])