> ## Documentation Index
> Fetch the complete documentation index at: https://staging-docs.orderly.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Power your trading application with performant, React-native Orderly Hooks.

`@orderly.network/hooks`

The hooks libraries provides a series of React hooks for React developers to ensure a seamless integration experience. This library is a package built on top of `@orderly.network/core` and `@orderly.network/perp`.

## Coding standards

* If the hook returns an array, then the first element will be the actual data, and the second element will be an object containing some supporting functions.
* All hooks ending with `stream` will update in real-time, via relevant Websocket subscriptions.
* All hooks ending with `subscription` subscribe to relevant Websocket API and allow to pass in a function.
* All hooks ending with `query` is a wrapper of an API request.

## List of hooks

### REST & WS API

The REST API hooks can be used to facilitate interacting with Orderly REST & Websocket APIs.

* [useQuery](/sdks/hooks/api/use-query) - `GET` Public API
* [usePrivateQuery](/sdks/hooks/api/use-private-query) - `GET` Private API
* [usePrivateInfiniteQuery](/sdks/hooks/api/use-private-infinite-query) - A version of `usePrivateQuery` that supports infinite scrolling
* [useLazyQuery](/sdks/hooks/api/use-lazy-query)
* [useMutation](/sdks/hooks/api/use-mutation) - `POST` APIs
* [useWS](/sdks/hooks/api/use-ws) - WebSocket client
* [useWsStatus](/sdks/hooks/api/use-ws-status) - WebSocket client status
* `useSWR` - Reexport from [this npm package](https://www.npmjs.com/package/swr)

### Utility

These utility hooks provide ways to help handle UI states and some state management logic.

* [useConfig](/sdks/hooks/util/use-config) - An instance of the `ConfigStore`
* [useEventEmitter](/sdks/hooks/util/use-event-emitter) - An instance of the `EventEmitter`
* [useLocalStorage](/sdks/hooks/util/use-local-storage) - Management (CRUD) of localStorage
* [useSessionStorage](/sdks/hooks/util/use-session-storage) - Management (CRUD) of sessionStorage
* [useMediaQuery](/sdks/hooks/util/use-media-query) - Evaluates a media query to a boolean
* `useConstant` - Reexport from [this npm package](https://www.npmjs.com/package/use-constant)
* `useDebounce` - Reexport from [this npm package](https://www.npmjs.com/package/use-debounce)

### Account

* [useAccount](/sdks/hooks/account/use-account): Retrieves the current account info and status. With this hook you can also create an account and create an `orderlyKey`
* [useAccountInfo](/sdks/hooks/account/use-account-info) - Fetches account information
* [useAccountInstance](/sdks/hooks/account/use-account-instance) - Returns `Account` singleton
* [useWalletConnector](/sdks/hooks/account/use-wallet-connector) - Handles wallet connection
* [useWalletSubscription](/sdks/hooks/account/use-wallet-subscription) - Subscribe to wallet transactionsvia WebSocket
* [useLeverage](/sdks/hooks/account/use-leverage) - Retrieves the current account leverage
* [useMarginRatio](/sdks/hooks/account/use-margin-ratio) - Margin information
* [useSettleSubscription](/sdks/hooks/account/use-settle-subscription) - Subscribe to PnL settlement via WebSocket
* [useDaily](/sdks/hooks/account/use-daily) - Retrieving daily user volume

### Assets

* [useCollateral](/sdks/hooks/assets/use-collateral) - retrieves information about a user's collateral
* [useMaxQty](/sdks/hooks/assets/use-max-qty) - retrieves the maximum quantity a user can place based on the symbol, side, leverage etc.
* [useChain](/sdks/hooks/assets/use-chain) - Chain information
* [useChains](/sdks/hooks/assets/use-chains) - Retrieves the list of supported chains
* [useDeposit](/sdks/hooks/assets/use-deposit) - retrieves a Withdraw tokens from Orderly smart contract balance helper
* [useHoldingStream](/sdks/hooks/assets/use-holding-stream) - Retrieves user's assets

### Markets

* [useOrderbookStream](/sdks/hooks/market-data/use-orderbook-stream) - Orderbook stream
* [useIndexPrice](/sdks/hooks/market-data/use-index-price) - Get the index price of a single symbol
* [useMarkPrice](/sdks/hooks/market-data/use-mark-price) - Get the mark price of a single symbol
* [useMarkPricesStream](/sdks/hooks/market-data/use-mark-prices-stream) - Get the mark price of all symbols
* [useMarketTradeStream](/sdks/hooks/market-data/use-market-trade-stream) - Get the market trades history of a symbol
* [useMarkets](/sdks/hooks/market-data/use-markets) - Retrieve all listed symbols and its market data
* [useMarketsStream](/sdks/hooks/market-data/use-markets-stream) - Retrieve all listed symbols and its market data
* [useTickerStream](/sdks/hooks/market-data/use-ticker-stream) - Get the symbol market data stream
* [useSymbolsInfo](/sdks/hooks/market-data/use-symbols-info) - Get the symbol market data stream
* [useSymbolPriceRange](/sdks/hooks/market-data/use-symbol-price-range) - Get the price range for the specified symbol with an optional price

### Orders

* [useOrderEntry](/sdks/hooks/orders/use-order-entry) - Order placement
* [useOrderStream](/sdks/hooks/orders/use-order-stream) - Retrieving, editing and cancelling orders

### Positions

* [usePositionStream](/sdks/hooks/positions/use-position-stream) - Position management
* [usePoster](/sdks/hooks/positions/use-poster) - Generates a poster image based on position information

### Funding

* [useFundingRate](/sdks/hooks/funding/use-funding-rate) - Funding rate information

### Referral

* [useCheckReferralCode](/sdks/hooks/referral/use-check-referral-code) - Check if referral code exists
* [useGetReferralCode](/sdks/hooks/referral/use-get-referral-code) - Obtain referral code via `account_id`
* [useDaily](/sdks/hooks/referral/use-daily) - Returns `perp_volume` based on start and end time
* [useRefereeInfo](/sdks/hooks/referral/use-referee-info) - Retrieve referee info
* [useRefereeRebateSummary](/sdks/hooks/referral/use-referee-rebate-summary) - Provide statistics on referee rebates per date
* [useReferralInfo](/sdks/hooks/referral/use-referral-info) - Retrieve referral info
* [useReferralRebateSummary](/sdks/hooks/referral/use-referral-rebate-summary) - Provide statistics on referral rebates per date
