Use the UpsideMAX Python SDK Info client for market data, account and order queries, history, and realtime WebSocket subscriptions — no wallet or signing required.
The Info client covers every read: market data, account and order queries,
history, and realtime WebSocket streams. It needs no wallet and signs nothing.
Every method returns the raw parsed JSON — see the Info API
pages for the exact response shapes.
Pass skip_ws=True to construct a REST-only client (no background WebSocket
thread). Call info.close() when you are done to stop the WebSocket cleanly.
timeout, max_retries, and backoff work as described in
Timeouts and retries; reads are
always safe to retry.
info.configs() # contracts, coins, scales, tiers — cache thisinfo.l2_book(asset) # full order-book snapshotinfo.l2_book(asset, group=group) # a price grouping: one of the contract's digitMerge valuesinfo.market_state(asset) # mark / oracle / last price, fundinginfo.ticker(asset) # 24h rolling stats; omit asset for every contractinfo.candle_snapshot(asset, "1m", start_ms, end_ms) # historical OHLCV, ascending
configs is the source of truth for contract IDs, coin IDs, and the
priceScale / qtyScale / tickSize / stepSize you need to convert display
values to the raw integers the API expects. Fetch it once and cache it.
l2_book raises ServerError with code NOT_READY when the contract has no
book yet. A group the contract does not offer is rejected with 400.
candle_snapshot takes start and end times in Unix milliseconds; always pass
a window. The interval must be one of 1m, 3m, 5m, 15m, 30m, 1h,
2h, 4h, 8h, 12h, 1d, 3d, 1w, 1M.
ticker’s window slides over the last 24 hours; it is not a calendar day.
info.account_by_address("0x<address>") # master or agent address -> accountId ("0" = not registered)info.user_account(account_id, market_deployer_id) # balances + positionsinfo.user_market_deployers(account_id) # market deployers the account is enrolled ininfo.user_agents(account_id) # authorized API walletsinfo.user_orders(account_id) # live orders, every deployer and contractinfo.user_orders(account_id, market_deployer_id, contract_id)info.orders_by_ids(market_deployer_id, ["8280"]) # look up by exchange order idinfo.orders_by_cloids(account_id, market_deployer_id, ["1778844423064"]) # by client order idinfo.share_group_state() # portfolio-margin share groups
account_id accepts an int or string.
user_orders returns live orders only — resting and partially filled
orders, plus conditional orders not yet triggered. Finished orders are in
order_history. market_deployer_id=0 and contract_id=0 (the
defaults) mean all. The answer is capped: when truncated is true the list
is incomplete, so narrow the query by deployer or contract rather than treating
a missing order as gone.
orders_by_ids / orders_by_cloids only see live orders too. Filled,
canceled, and not-yet-triggered conditional orders are omitted, as are ids
from another deployer. Pass the order’s own market_deployer_id (0 matches
nothing and is refused locally), and at most 256 ids per call. Ids that are not
found are simply absent from the result.
Finished orders, fills, and funding payments come from the history queries.
All three take the same arguments and page the same way:
info.user_fills(account_id) # one row per side the account was oninfo.order_history(account_id, contract_id=0) # filled / canceled / rejected / triggered ordersinfo.user_funding_flows(account_id, start_time=start_ms, end_time=end_ms, limit=1000)
Rows are ascending by time. To page, pass the last row’s time as the next
start_time — the bound is inclusive, so de-duplicate the overlapping row
(execId for fills, orderId for orders).
limit is 1 to 1000 (the default is 1000). There may be more rows when the
page is full or when truncated is true — a page can be cut short to fit
the reply, so a page with fewer rows than limit is not proof you have reached
the end.
end_time=0 means no upper bound. Times are Unix milliseconds.
History is indexed shortly after execution: an order that just finished may
take a moment to appear here.
The Info client manages one shared WebSocket connection. Subscribe with a
subscription dict and a callback; the callback receives each decoded message.
subscribe returns an integer subscription id you pass back to unsubscribe.
asset may be given as an int; the SDK sends it as the string the server
requires.
l2Book groupings.group is optional and must be one of the contract’s
digitMerge values; each grouping is a separate stream. A group equal to the
contract’s tickSize is the raw book and is subscribed as such. A
GroupRemoved frame means the grouping was removed from the contract and the
stream has ended.
userAccount pushes the account view for one market deployer
periodically, so positions and balances can be streamed rather than polled.
Snapshot frames.openOrders sends one snapshot when you subscribe — the
userOrders response body — and no updates after it; use orderUpdates for
changes. orderUpdates / userFills (recent history rows) and trades
(recent trades, flagged isSnapshot) open with a snapshot whose shape differs
from the updates that follow. candle
has no snapshot: fetch history with candle_snapshot and apply the stream on
top. Your callback must handle both shapes.
Refused subscriptions come back as an error frame whose data.subscription
echoes the request that was refused. Pass Info(ws_error_callback=...) to
receive them.
A malformed subscription dict raises WebsocketError before anything is sent.
Callbacks run on the socket’s reader thread, so keep them short. The client
pings every 30 seconds and automatically reconnects, replaying its active
subscriptions.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"UpsideMAX","description":"UpsideMAX","colors":{"primary":"#0A7CFF","light":"#0A7CFF","dark":"#0A7CFF"},"logo":{"light":"https://mintcdn.com/upside-7a3380ba/OWuoW1HJEwbXR1x2/images/upside-logo.png?fit=max\u0026auto=format\u0026n=OWuoW1HJEwbXR1x2\u0026q=85\u0026s=53d4c4863f7db0c66ede07ae08499d68","dark":"https://mintcdn.com/upside-7a3380ba/OWuoW1HJEwbXR1x2/images/upside-logo.png?fit=max\u0026auto=format\u0026n=OWuoW1HJEwbXR1x2\u0026q=85\u0026s=53d4c4863f7db0c66ede07ae08499d68"},"favicon":{"light":"https://mintcdn.com/upside-7a3380ba/OWuoW1HJEwbXR1x2/images/favicon.svg?fit=max\u0026auto=format\u0026n=OWuoW1HJEwbXR1x2\u0026q=85\u0026s=5640909e7bb4d83c526ac54070f89a5d","dark":"https://mintcdn.com/upside-7a3380ba/OWuoW1HJEwbXR1x2/images/favicon.svg?fit=max\u0026auto=format\u0026n=OWuoW1HJEwbXR1x2\u0026q=85\u0026s=5640909e7bb4d83c526ac54070f89a5d"},"appearance":{"default":"dark"},"background":{"color":{"light":"#FFFFFF","dark":"#0A0F13"}},"navbar":{"links":[]},"footer":{"socials":{"x":"https://x.com/upside_max"}},"seo":{"indexing":"navigable"},"icons":{"library":"fontawesome"},"styling":{"eyebrows":"breadcrumbs","latex":false},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"upside-7a3380ba","hasAudioNarration":false,"actualSubdomain":"upside-7a3380ba","customDomains":["docs.upsidemax.xyz"],"gitSource":{"type":"github","owner":"chain-dex","repo":"mintlify-doc","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6ae2c1f7a10b39c9ca862760","collectionId":"e141fa6b-6a87-4e56-b0c7-42b6835e170c","liveDeploymentHistoryId":"6ae2c1f7a10b39c9ca862760","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae2c1f7a10b39c9ca862760","clientVersion":"0.0.4074","searchFilterCounts":[{"language":"default","tag":"Exchange API","count":26},{"language":"default","tag":"Info API","count":17},{"language":"default","tag":"Developer Hub","count":13},{"language":"default","tag":"WebSocket","count":13},{"language":"default","tag":"Orders","count":9},{"language":"default","tag":"Collateral Transfers","count":8},{"language":"default","tag":"Market Channels","count":7},{"language":"default","tag":"Account","count":6},{"language":"default","tag":"Overview","count":6},{"language":"default","tag":"Market Data","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}code,pre,kbd,samp{font-family:\"JetBrains Mono\", \"SF Mono\", ui-monospace, SFMono-Regular,\n Menlo, Consolas, \"Liberation Mono\", monospace;font-feature-settings:\"liga\" 0}::selection{background-color:rgba(64, 163, 255, 0.28)}"}],"page":{"pagePath":"sdk/python/reading-data","slug":"/sdk/python/reading-data","pageMetadata":{"title":"Reading data with Info","sidebarTitle":"Reading data (Info)","description":"Use the UpsideMAX Python SDK Info client for market data, account and order queries, history, and realtime WebSocket subscriptions — no wallet or signing required.","href":"/sdk/python/reading-data"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Use the UpsideMAX Python SDK Info client for market data, account and order queries, history, and realtime WebSocket subscriptions — no wallet or signing required.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`Info`}),` client covers every read: market data, account and order queries,\nhistory, and realtime WebSocket streams. It needs no wallet and signs nothing.\nEvery method returns the raw parsed JSON — see the `,_jsx(_components.a,{href:`/info/overview`,children:`Info API`}),`\npages for the exact response shapes.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` upside `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Info`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` upside.utils `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` constants`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Info(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`constants.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`MAINNET_API_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# WebSocket starts automatically`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Pass `,_jsx(_components.code,{children:`skip_ws=True`}),` to construct a REST-only client (no background WebSocket\nthread). Call `,_jsx(_components.code,{children:`info.close()`}),` when you are done to stop the WebSocket cleanly.\n`,_jsx(_components.code,{children:`timeout`}),`, `,_jsx(_components.code,{children:`max_retries`}),`, and `,_jsx(_components.code,{children:`backoff`}),` work as described in\n`,_jsx(_components.a,{href:`/sdk/python/overview#timeouts-and-retries`,children:`Timeouts and retries`}),`; reads are\nalways safe to retry.`]}),`\n`,_jsx(Heading,{level:`2`,id:`market-data`,children:`Market data`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.configs() `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# contracts, coins, scales, tiers — cache this`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.l2_book(asset) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# full order-book snapshot`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.l2_book(asset, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`group`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`group) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# a price grouping: one of the contract's digitMerge values`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.market_state(asset) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# mark / oracle / last price, funding`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.ticker(asset) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# 24h rolling stats; omit asset for every contract`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.candle_snapshot(asset, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1m\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, start_ms, end_ms) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# historical OHLCV, ascending`})]}),`\n`]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`configs`}),` is the source of truth for contract IDs, coin IDs, and the\n`,_jsx(_components.code,{children:`priceScale`}),` / `,_jsx(_components.code,{children:`qtyScale`}),` / `,_jsx(_components.code,{children:`tickSize`}),` / `,_jsx(_components.code,{children:`stepSize`}),` you need to convert display\nvalues to the raw integers the API expects. Fetch it once and cache it.`]})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`l2_book`}),` raises `,_jsx(_components.code,{children:`ServerError`}),` with code `,_jsx(_components.code,{children:`NOT_READY`}),` when the contract has no\nbook yet. A `,_jsx(_components.code,{children:`group`}),` the contract does not offer is rejected with `,_jsx(_components.code,{children:`400`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`candle_snapshot`}),` takes start and end times in Unix milliseconds; always pass\na window. The interval must be one of `,_jsx(_components.code,{children:`1m`}),`, `,_jsx(_components.code,{children:`3m`}),`, `,_jsx(_components.code,{children:`5m`}),`, `,_jsx(_components.code,{children:`15m`}),`, `,_jsx(_components.code,{children:`30m`}),`, `,_jsx(_components.code,{children:`1h`}),`,\n`,_jsx(_components.code,{children:`2h`}),`, `,_jsx(_components.code,{children:`4h`}),`, `,_jsx(_components.code,{children:`8h`}),`, `,_jsx(_components.code,{children:`12h`}),`, `,_jsx(_components.code,{children:`1d`}),`, `,_jsx(_components.code,{children:`3d`}),`, `,_jsx(_components.code,{children:`1w`}),`, `,_jsx(_components.code,{children:`1M`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`ticker`}),`’s window slides over the last 24 hours; it is not a calendar day.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`account-and-orders`,children:`Account and orders`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.account_by_address(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0x\u003caddress>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# master or agent address -> accountId (\"0\" = not registered)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.user_account(account_id, market_deployer_id) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# balances + positions`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.user_market_deployers(account_id) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# market deployers the account is enrolled in`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.user_agents(account_id) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# authorized API wallets`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.user_orders(account_id) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# live orders, every deployer and contract`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.user_orders(account_id, market_deployer_id, contract_id)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.orders_by_ids(market_deployer_id, [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"8280\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# look up by exchange order id`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.orders_by_cloids(account_id, market_deployer_id, [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1778844423064\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# by client order id`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.share_group_state() `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# portfolio-margin share groups`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`account_id`}),` accepts an int or string.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`user_orders`}),` returns live orders only`]}),` — resting and partially filled\norders, plus conditional orders not yet triggered. Finished orders are in\n`,_jsx(_components.a,{href:`#history`,children:_jsx(_components.code,{children:`order_history`})}),`. `,_jsx(_components.code,{children:`market_deployer_id=0`}),` and `,_jsx(_components.code,{children:`contract_id=0`}),` (the\ndefaults) mean all. The answer is capped: when `,_jsx(_components.code,{children:`truncated`}),` is `,_jsx(_components.code,{children:`true`}),` the list\nis incomplete, so narrow the query by deployer or contract rather than treating\na missing order as gone.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`orders_by_ids`}),` / `,_jsx(_components.code,{children:`orders_by_cloids`}),` only see live orders`]}),` too. Filled,\ncanceled, and not-yet-triggered conditional orders are omitted, as are ids\nfrom another deployer. Pass the order’s own `,_jsx(_components.code,{children:`market_deployer_id`}),` (`,_jsx(_components.code,{children:`0`}),` matches\nnothing and is refused locally), and at most 256 ids per call. Ids that are not\nfound are simply absent from the result.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`history`,children:`History`}),`\n`,_jsx(_components.p,{children:`Finished orders, fills, and funding payments come from the history queries.\nAll three take the same arguments and page the same way:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.user_fills(account_id) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# one row per side the account was on`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.order_history(account_id, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`contract_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# filled / canceled / rejected / triggered orders`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.user_funding_flows(account_id, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`start_time`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`start_ms, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`end_time`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`end_ms, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`limit`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Rows are `,_jsx(_components.strong,{children:`ascending`}),` by time. To page, pass the last row’s time as the next\n`,_jsx(_components.code,{children:`start_time`}),` — the bound is inclusive, so de-duplicate the overlapping row\n(`,_jsx(_components.code,{children:`execId`}),` for fills, `,_jsx(_components.code,{children:`orderId`}),` for orders).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`limit`}),` is 1 to 1000 (the default is 1000). There may be more rows when the\npage is full `,_jsx(_components.strong,{children:`or`}),` when `,_jsx(_components.code,{children:`truncated`}),` is `,_jsx(_components.code,{children:`true`}),` — a page can be cut short to fit\nthe reply, so a page with fewer rows than `,_jsx(_components.code,{children:`limit`}),` is not proof you have reached\nthe end.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`end_time=0`}),` means no upper bound. Times are Unix milliseconds.`]}),`\n`,_jsx(_components.li,{children:`History is indexed shortly after execution: an order that just finished may\ntake a moment to appear here.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`websocket-streams`,children:`WebSocket streams`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`Info`}),` client manages one shared WebSocket connection. Subscribe with a\nsubscription dict and a callback; the callback receives each decoded message.\n`,_jsx(_components.code,{children:`subscribe`}),` returns an integer subscription id you pass back to `,_jsx(_components.code,{children:`unsubscribe`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`sid `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` info.subscribe(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"l2Book\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"asset\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` lambda`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` m`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(m[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"levels\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]), `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# best bid`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.subscribe({`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"l2Book\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"asset\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"group\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: group}, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# a digitMerge grouping`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.subscribe({`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"trades\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"asset\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:\"# Per-address (private) channels take the wallet address as `user`:\"})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.subscribe({`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"orderUpdates\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0x\u003caddress>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.subscribe({`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"userFills\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0x\u003caddress>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.subscribe({`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"userAccount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0x\u003caddress>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"marketDeployerId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.unsubscribe({`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"l2Book\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"asset\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}, sid)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`info.close()`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Channels`}),` — see the `,_jsx(_components.a,{href:`/websocket/overview`,children:`WebSocket`}),` reference for payloads:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Scope`}),_jsx(_components.th,{children:`Channels`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Public`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`l2Book`}),`, `,_jsx(_components.code,{children:`bbo`}),`, `,_jsx(_components.code,{children:`trades`}),`, `,_jsx(_components.code,{children:`candle`}),`, `,_jsx(_components.code,{children:`ticker`}),`, `,_jsx(_components.code,{children:`allMarkets`}),`, `,_jsx(_components.code,{children:`config`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Per-address`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`orderUpdates`}),`, `,_jsx(_components.code,{children:`openOrders`}),`, `,_jsx(_components.code,{children:`userFills`}),`, `,_jsx(_components.code,{children:`userAccount`})]})]})]})]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`asset`})}),` may be given as an int; the SDK sends it as the string the server\nrequires.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`l2Book`}),` groupings.`]}),` `,_jsx(_components.code,{children:`group`}),` is optional and must be one of the contract’s\n`,_jsx(_components.code,{children:`digitMerge`}),` values; each grouping is a separate stream. A `,_jsx(_components.code,{children:`group`}),` equal to the\ncontract’s `,_jsx(_components.code,{children:`tickSize`}),` is the raw book and is subscribed as such. A\n`,_jsx(_components.code,{children:`GroupRemoved`}),` frame means the grouping was removed from the contract and the\nstream has ended.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`userAccount`})}),` pushes the account view for one market deployer\nperiodically, so positions and balances can be streamed rather than polled.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Snapshot frames.`}),` `,_jsx(_components.code,{children:`openOrders`}),` sends one snapshot when you subscribe — the\n`,_jsx(_components.code,{children:`userOrders`}),` response body — and no updates after it; use `,_jsx(_components.code,{children:`orderUpdates`}),` for\nchanges. `,_jsx(_components.code,{children:`orderUpdates`}),` / `,_jsx(_components.code,{children:`userFills`}),` (recent history rows) and `,_jsx(_components.code,{children:`trades`}),`\n(recent trades, flagged `,_jsx(_components.code,{children:`isSnapshot`}),`) open with a snapshot whose shape differs\nfrom the updates that follow. `,_jsx(_components.code,{children:`candle`}),`\nhas no snapshot: fetch history with `,_jsx(_components.code,{children:`candle_snapshot`}),` and apply the stream on\ntop. Your callback must handle both shapes.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Refused subscriptions`}),` come back as an `,_jsx(_components.code,{children:`error`}),` frame whose `,_jsx(_components.code,{children:`data.subscription`}),`\nechoes the request that was refused. Pass `,_jsx(_components.code,{children:`Info(ws_error_callback=...)`}),` to\nreceive them.`]}),`\n`,_jsxs(_components.li,{children:[`A malformed subscription dict raises `,_jsx(_components.code,{children:`WebsocketError`}),` before anything is sent.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`Callbacks run on the socket’s reader thread, so keep them short. The client\npings every 30 seconds and automatically reconnects, replaying its active\nsubscriptions.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Reading data with Info","sidebarTitle":"Reading data (Info)","description":"Use the UpsideMAX Python SDK Info client for market data, account and order queries, history, and realtime WebSocket subscriptions — no wallet or signing required.","href":"/sdk/python/reading-data"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Market data","slug":"market-data","depth":2,"children":[]},{"title":"Account and orders","slug":"account-and-orders","depth":2,"children":[]},{"title":"History","slug":"history","depth":2,"children":[]},{"title":"WebSocket streams","slug":"websocket-streams","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"upside-7a3380ba","siteName":"UpsideMAX","title":"Reading data with Info - UpsideMAX","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-29T03:16:15.667Z","originalFileLocation":"sdk/python/reading-data.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Use the UpsideMAX Python SDK Info client for market data, account and order queries, history, and realtime WebSocket subscriptions — no wallet or signing required.\">\u003cmeta data-mint-head name=\"application-name\" content=\"UpsideMAX\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/upside-7a3380ba/uSlkoW96xHffdhIo/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/upside-7a3380ba/uSlkoW96xHffdhIo/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/upside-7a3380ba/uSlkoW96xHffdhIo/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/upside-7a3380ba/uSlkoW96xHffdhIo/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/upside-7a3380ba/uSlkoW96xHffdhIo/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/upside-7a3380ba/uSlkoW96xHffdhIo/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/upside-7a3380ba/uSlkoW96xHffdhIo/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/upside-7a3380ba/uSlkoW96xHffdhIo/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/upside-7a3380ba/uSlkoW96xHffdhIo/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Reading data with Info - UpsideMAX\">\u003cmeta data-mint-head property=\"og:description\" content=\"Use the UpsideMAX Python SDK Info client for market data, account and order queries, history, and realtime WebSocket subscriptions — no wallet or signing required.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"UpsideMAX\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.upsidemax.xyz/sdk/python/reading-data\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://upside-7a3380ba.mintlify.site/_mintlify/api/og/v2?division=Python\u0026amp;title=Reading+data+with+Info\u0026amp;description=Use+the+UpsideMAX+Python+SDK+Info+client+for+market+data%2C+account+and+order+queries%2C+history%2C+and+realtime+WebSocket+subscriptions+%E2%80%94+no+wallet+or+signing+requir\u0026amp;theme=eb769b7c9165de27f354097d\u0026amp;signature=70e39883b24c9752eadf120b2f05af9da62037c7f28a94305136876e0b4012f6\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Reading data with Info - UpsideMAX\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Use the UpsideMAX Python SDK Info client for market data, account and order queries, history, and realtime WebSocket subscriptions — no wallet or signing required.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://upside-7a3380ba.mintlify.site/_mintlify/api/og/v2?division=Python\u0026amp;title=Reading+data+with+Info\u0026amp;description=Use+the+UpsideMAX+Python+SDK+Info+client+for+market+data%2C+account+and+order+queries%2C+history%2C+and+realtime+WebSocket+subscriptions+%E2%80%94+no+wallet+or+signing+requir\u0026amp;theme=eb769b7c9165de27f354097d\u0026amp;signature=70e39883b24c9752eadf120b2f05af9da62037c7f28a94305136876e0b4012f6\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/upside-7a3380ba/uSlkoW96xHffdhIo/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"UpsideMAX\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0A7CFF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.upsidemax.xyz/sdk/python/reading-data\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/sdk/python/reading-data.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.upsidemax.xyz/#organization\",\"name\":\"UpsideMAX\",\"url\":\"https://docs.upsidemax.xyz\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/upside-7a3380ba/OWuoW1HJEwbXR1x2/images/upside-logo.png?fit=max\u0026auto=format\u0026n=OWuoW1HJEwbXR1x2\u0026q=85\u0026s=53d4c4863f7db0c66ede07ae08499d68\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.upsidemax.xyz#website\",\"name\":\"UpsideMAX\",\"url\":\"https://docs.upsidemax.xyz\",\"publisher\":{\"@id\":\"https://docs.upsidemax.xyz/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.upsidemax.xyz/sdk/python/reading-data#webpage\",\"url\":\"https://docs.upsidemax.xyz/sdk/python/reading-data\",\"name\":\"Reading data with Info\",\"description\":\"Use the UpsideMAX Python SDK Info client for market data, account and order queries, history, and realtime WebSocket subscriptions — no wallet or signing required.\",\"dateModified\":\"2026-10-29T03:16:15.667Z\",\"isPartOf\":{\"@id\":\"https://docs.upsidemax.xyz#website\"},\"breadcrumb\":{\"@id\":\"https://docs.upsidemax.xyz/sdk/python/reading-data#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.upsidemax.xyz/sdk/python/reading-data#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"SDKs\",\"item\":\"https://docs.upsidemax.xyz/sdk/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\",\"item\":\"https://docs.upsidemax.xyz/sdk/python/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Reading data with Info\",\"item\":\"https://docs.upsidemax.xyz/sdk/python/reading-data\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.upsidemax.xyz/sdk/python/reading-data#article\",\"headline\":\"Reading data with Info\",\"name\":\"Reading data with Info\",\"description\":\"Use the UpsideMAX Python SDK Info client for market data, account and order queries, history, and realtime WebSocket subscriptions — no wallet or signing required.\",\"url\":\"https://docs.upsidemax.xyz/sdk/python/reading-data\",\"mainEntityOfPage\":{\"@id\":\"https://docs.upsidemax.xyz/sdk/python/reading-data#webpage\"},\"dateModified\":\"2026-10-29T03:16:15.667Z\",\"publisher\":{\"@id\":\"https://docs.upsidemax.xyz/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.upsidemax.xyz#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"UpsideMAX\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"UpsideMAX","nav":{"global":null,"tabs":[{"tab":"Developer Hub","groups":[{"group":"Overview","pages":[{"title":"Developer Hub","sidebarTitle":"Developer Hub","href":"/guide/introduction"},{"title":"Quick Start","sidebarTitle":"Quick Start","href":"/guide/quickstart"}]},{"group":"Authentication","pages":[{"title":"Requests","sidebarTitle":"Requests","href":"/guide/authentication"},{"title":"Nonce","sidebarTitle":"Nonce","href":"/guide/nonce"}]},{"group":"Request Format","pages":[{"title":"Exchange Requests","sidebarTitle":"Exchange Requests","href":"/guide/write-requests"},{"title":"Info Requests","sidebarTitle":"Info Requests","href":"/guide/read-requests"},{"title":"Response","sidebarTitle":"Responses","href":"/guide/responses"}]},{"group":"Reference","pages":[{"title":"Data Types","sidebarTitle":"Data Types","href":"/guide/data-types"},{"title":"Error Codes","sidebarTitle":"Error Codes","href":"/guide/error-codes"}]},{"group":"SDKs","pages":[{"title":"SDKs","sidebarTitle":"Overview","href":"/sdk/overview"},{"group":"Python","pages":[{"title":"Python SDK","sidebarTitle":"Overview","description":"Install and get started with the official UpsideMAX Python SDK — EIP-712 wallet-signed REST reads and writes plus realtime WebSocket streams, with no API keys.","href":"/sdk/python/overview"},{"title":"Reading data with Info","sidebarTitle":"Reading data (Info)","href":"/sdk/python/reading-data"},{"title":"Trading with Exchange","sidebarTitle":"Trading (Exchange)","description":"Use the UpsideMAX Python SDK Exchange client for signed writes — orders, cancels, margin and leverage, TP/SL, collateral, portfolio margin, and agent delegation.","href":"/sdk/python/trading"}]}]}]},{"tab":"Exchange API","pages":[{"title":"Exchange API","href":"/exchange/overview"}]},{"tab":"Info API","pages":[{"title":"Info API","href":"/info/overview"}]},{"tab":"WebSocket","pages":[{"title":"WebSocket","href":"/websocket/overview"}]},{"tab":"Agents","pages":[{"title":"Agents","href":"/agents/overview"}]}]},"basePath":"","title":"Reading data with Info - UpsideMAX","buildId":"dpl_BLQvU86QFwq3AhPofSTw6q8dGWKm","deploymentId":"dpl_BLQvU86QFwq3AhPofSTw6q8dGWKm","dynamics":[],"chunks":[]}