The formulas behind the account summary — how collateral, equity, margin usage, and
the margin ratios are derived. For the fields as returned, see the
Account Summary Stream and
Get Account Summary HTTP endpoint. Everything
is denominated in USDT.
Key Definitions
Term
Description
accountBalance
Settled collateral balance — the sum of every balance bucket. Unaffected by mark price movements
qty
Signed position quantity — positive for long, negative for short
notionalValue
Signed mark value of an open position — markPrice × qty. Returned on every position; see Position Metrics
positionMargin
Initial margin locked across open positions
orderMargin
Margin reserved for resting open orders
unrealizedPnl
Profit or loss on open positions measured against their average entry price. Reporting only — not a term in totalEquity, see Total Equity
Account Balance
accountBalance accumulates settled cash flows and does not move with the mark price. The
premium you pay or receive at entry has already flowed through it.
Realized PnL and volume do not move collateral — a closed trade’s cash has already moved
through premium and payoff, so they are reported for the record only.
Total Equity
totalEquity is accountBalance plus the signed mark value of every open position — that
is, the sum of each position’s notionalValue. A short’s notionalValue is negative, so it
subtracts.
totalEquity is notaccountBalance + unrealizedPnl. unrealizedPnl is measured
against the entry price, but the entry premium has already moved through
accountBalance — adding that PnL back would count entry twice. Use totalEquity
as published; the margin ratios are computed against it.
Unrealized PnL
unrealizedPnl measures each open position against its average entry price and sums across
positions. It is reported on the account summary and on every position, but it is not the
term added to totalEquity.
unrealizedPnl = Σ (markPrice - entryPrice) × qty
Available & Withdrawable Balance
availableBalance is the collateral free for new orders — accountBalance less the margin
already locked by positions and resting orders.
See Margin & Fees for how per-position initial and
maintenance margin are sized.
Usage in API
These calculations back the Get Account Summary
response and the Account Summary Stream.
totalEquity depends on the mark price, so it moves between balance changes; the summary is a
snapshot at the moment it is emitted. See the stream page for how to keep it current.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Rails Trading Developer API Documentation","colors":{"primary":"#0D9373","light":"#07C983","dark":"#0D9373"},"logo":{"light":"https://mintcdn.com/railsxyz/XTasO28fw_2bd6Tp/logo/light.svg?fit=max\u0026auto=format\u0026n=XTasO28fw_2bd6Tp\u0026q=85\u0026s=562d1517f28bb695fb280b18dd4310a4","dark":"https://mintcdn.com/railsxyz/XTasO28fw_2bd6Tp/logo/dark.svg?fit=max\u0026auto=format\u0026n=XTasO28fw_2bd6Tp\u0026q=85\u0026s=2dc52a8a93c85cb2edae7edc4f009831"},"favicon":"https://mintcdn.com/railsxyz/XTasO28fw_2bd6Tp/favicon.svg?fit=max\u0026auto=format\u0026n=XTasO28fw_2bd6Tp\u0026q=85\u0026s=508a9eb467ddd29d6d1034598ada1654","api":{"openapi":["latest/openapi/auth.json","latest/perps/openapi/account.json","latest/perps/openapi/order.json","latest/perps/openapi/market.json","latest/options/openapi/options.json","latest/options/openapi/matching.json"],"asyncapi":["latest/perps/asyncapi/perps-ws.yaml","latest/perps/asyncapi/test-public-stream.yaml","latest/perps/asyncapi/test-authenticated-stream.yaml","latest/options/asyncapi/options-ws.yaml"]},"navbar":{"links":[{"href":"https://help.rails.xyz/","label":"Support"}]},"footer":{"socials":{"website":"https://rails.xyz/","twitter":"https://twitter.com/rails_xyz","linkedin":"https://www.linkedin.com/company/railsxyz"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"railsxyz","hasAudioNarration":false,"actualSubdomain":"railsxyz","customDomains":["docs.rails.xyz"],"gitSource":{"type":"github","owner":"rails-xyz","repo":"api-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b08953e3255825ab84b78f7","clientVersion":"0.0.4377","searchFilterCounts":[{"language":"default","tag":"Options","count":44},{"language":"default","tag":"Perpetuals","count":42},{"language":"default","tag":"HTTP API Reference","count":29},{"language":"default","tag":"Get Started","count":25},{"language":"default","tag":"Guides","count":24},{"language":"default","tag":"WebSocket API Reference","count":18},{"language":"default","tag":"User Account","count":10},{"language":"default","tag":"Go SDK","count":9},{"language":"default","tag":"Formulas","count":9},{"language":"default","tag":"Market Data","count":7}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"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":"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":"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":"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":"turbopuffer-dual-write","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":"editor-metadata","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":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","content":".flex.flex-col.gap-8:not(.isolate)+#pagination{margin-top:3.5rem}.bindings-schema [title=\"expiration\"] [data-component-part=\"field-required-pill\"],.bindings-schema [title=\"strike\"] [data-component-part=\"field-required-pill\"],.bindings-schema [title=\"type\"] [data-component-part=\"field-required-pill\"],.bindings-schema [title=\"sessionId\"] [data-component-part=\"field-required-pill\"]{display:none!important}[data-testid=\"api-playground-modal\"] [title=\"expiration\"] [data-component-part=\"field-required-pill\"],[data-testid=\"api-playground-modal\"] [title=\"strike\"] [data-component-part=\"field-required-pill\"],[data-testid=\"api-playground-modal\"] [title=\"type\"] [data-component-part=\"field-required-pill\"],[data-testid=\"api-playground-modal\"] [title=\"sessionId\"] [data-component-part=\"field-required-pill\"]{display:none!important}@media (prefers-color-scheme: dark){[data-main-title]{color:#f0f0f0!important}[data-subtitle]{color:#d0d0d0!important}[data-quickstart-title]{color:#f0f0f0!important}[data-card]{background:#1f1f1f!important;border-color:#3f3f3f!important;color:#f0f0f0!important}[data-card]:hover{border-color:#0D9373!important;box-shadow:0 4px 16px rgba(13,147,115,0.3)!important}[data-card-title]{color:#f0f0f0!important}[data-card-desc]{color:#d0d0d0!important}[data-card-icon]{background:#1f1f1f!important}}.dark [data-main-title]{color:#f0f0f0!important}.dark [data-subtitle]{color:#d0d0d0!important}.dark [data-quickstart-title]{color:#f0f0f0!important}.dark [data-card]{background:#1f1f1f!important;border-color:#3f3f3f!important;color:#f0f0f0!important}.dark [data-card]:hover{border-color:#0D9373!important;box-shadow:0 4px 16px rgba(13,147,115,0.3)!important}.dark [data-card-title]{color:#f0f0f0!important}.dark [data-card-desc]{color:#d0d0d0!important}.dark [data-card-icon]{background:#1f1f1f!important}.dark [data-install]{background:#1f1f1f!important;border-color:#3f3f3f!important;color:#f0f0f0!important}.dark [data-install-copy]{background:#2a2a2a!important;border-color:#3f3f3f!important;color:#f0f0f0!important}.dark [data-install] a{color:#07C983!important}"}]}
{"page":{"pagePath":"latest/options/formulas/account-balance","slug":"/latest/options/formulas/account-balance","pageMetadata":{"title":"Account Equity \u0026 Balances","description":null,"href":"/latest/options/formulas/account-balance"},"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`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The formulas behind the account summary — how collateral, equity, margin usage, and\nthe margin ratios are derived. For the fields as returned, see the\n`,_jsx(_components.a,{href:`/latest/options/websocket-api/account-summary-stream`,children:`Account Summary Stream`}),` and\n`,_jsx(_components.a,{href:`/latest/options/rest-api/get-account-summary`,children:`Get Account Summary`}),` HTTP endpoint. Everything\nis denominated in USDT.`]}),`\n`,_jsx(Heading,{level:`2`,id:`key-definitions`,children:`Key Definitions`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Term`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`accountBalance`})}),_jsx(_components.td,{children:`Settled collateral balance — the sum of every balance bucket. Unaffected by mark price movements`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`qty`})}),_jsx(_components.td,{children:`Signed position quantity — positive for long, negative for short`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`notionalValue`})}),_jsxs(_components.td,{children:[`Signed mark value of an open position — `,_jsx(_components.code,{children:`markPrice × qty`}),`. Returned on every position; see `,_jsx(_components.a,{href:`/latest/options/formulas/position-metrics`,children:`Position Metrics`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`positionMargin`})}),_jsx(_components.td,{children:`Initial margin locked across open positions`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`orderMargin`})}),_jsx(_components.td,{children:`Margin reserved for resting open orders`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`unrealizedPnl`})}),_jsxs(_components.td,{children:[`Profit or loss on open positions measured against their average entry price. Reporting only — not a term in `,_jsx(_components.code,{children:`totalEquity`}),`, see `,_jsx(_components.a,{href:`#total-equity`,children:`Total Equity`})]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`account-balance`,children:`Account Balance`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`accountBalance`}),` accumulates settled cash flows and does not move with the mark price. The\npremium you pay or receive at entry has already flowed through it.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`4`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`accountBalance = deposits + transfersIn + premium + payoff`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` - withdrawals - transfersOut - withdrawFees`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` - fees - liquidationFees - profitFees - deliveryFees`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Realized PnL and volume do not move collateral — a closed trade’s cash has already moved\nthrough `,_jsx(_components.code,{children:`premium`}),` and `,_jsx(_components.code,{children:`payoff`}),`, so they are reported for the record only.`]}),`\n`,_jsx(Heading,{level:`2`,id:`total-equity`,children:`Total Equity`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`totalEquity`}),` is `,_jsx(_components.code,{children:`accountBalance`}),` plus the `,_jsx(_components.strong,{children:`signed mark value`}),` of every open position — that\nis, the sum of each position’s `,_jsx(_components.code,{children:`notionalValue`}),`. A short’s `,_jsx(_components.code,{children:`notionalValue`}),` is negative, so it\nsubtracts.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`totalEquity = accountBalance + Σ notionalValue`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` = accountBalance + Σ (markPrice × qty)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`totalEquity`}),` is `,_jsx(_components.strong,{children:`not`}),` `,_jsx(_components.code,{children:`accountBalance + unrealizedPnl`}),`. `,_jsx(_components.code,{children:`unrealizedPnl`}),` is measured\nagainst the `,_jsx(_components.strong,{children:`entry`}),` price, but the entry premium has already moved through\n`,_jsx(_components.code,{children:`accountBalance`}),` — adding that PnL back would count entry twice. Use `,_jsx(_components.code,{children:`totalEquity`}),`\nas published; the margin ratios are computed against it.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`unrealized-pnl`,children:`Unrealized PnL`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`unrealizedPnl`}),` measures each open position against its average entry price and sums across\npositions. It is reported on the account summary and on every position, but it is `,_jsx(_components.strong,{children:`not`}),` the\nterm added to `,_jsx(_components.code,{children:`totalEquity`}),`.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`unrealizedPnl = Σ (markPrice - entryPrice) × qty`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`available-\u0026-withdrawable-balance`,children:`Available \u0026 Withdrawable Balance`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`availableBalance`}),` is the collateral free for new orders — `,_jsx(_components.code,{children:`accountBalance`}),` less the margin\nalready locked by positions and resting orders.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`marginUsed = positionMargin + orderMargin`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`availableBalance = accountBalance - marginUsed`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`withdrawableBalance`}),` is the balance you can withdraw — a more conservative figure than\n`,_jsx(_components.code,{children:`availableBalance`}),`, since unrealized profits cannot be withdrawn.`]}),`\n`,_jsx(Heading,{level:`2`,id:`margin-ratios`,children:`Margin Ratios`}),`\n`,_jsxs(_components.p,{children:[`The margin ratios divide the margin requirement by `,_jsx(_components.code,{children:`totalEquity`}),`. Each returns `,_jsx(_components.code,{children:`1`}),` when\nequity is zero or negative.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`initialMarginRatio = marginUsed / totalEquity`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`maintenanceMarginRatio = maintenanceMargin / totalEquity`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/latest/options/formulas/margin-and-fees`,children:`Margin \u0026 Fees`}),` for how per-position initial and\nmaintenance margin are sized.`]}),`\n`,_jsx(Heading,{level:`2`,id:`usage-in-api`,children:`Usage in API`}),`\n`,_jsxs(_components.p,{children:[`These calculations back the `,_jsx(_components.a,{href:`/latest/options/rest-api/get-account-summary`,children:`Get Account Summary`}),`\nresponse and the `,_jsx(_components.a,{href:`/latest/options/websocket-api/account-summary-stream`,children:`Account Summary Stream`}),`.\n`,_jsx(_components.code,{children:`totalEquity`}),` depends on the mark price, so it moves between balance changes; the summary is a\nsnapshot at the moment it is emitted. See the stream page for how to keep it current.`]})]})}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":"Account Equity \u0026 Balances","description":null,"href":"/latest/options/formulas/account-balance"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Key Definitions","slug":"key-definitions","depth":2,"children":[]},{"title":"Account Balance","slug":"account-balance","depth":2,"children":[]},{"title":"Total Equity","slug":"total-equity","depth":2,"children":[]},{"title":"Unrealized PnL","slug":"unrealized-pnl","depth":2,"children":[]},{"title":"Available \u0026 Withdrawable Balance","slug":"available-\u0026-withdrawable-balance","depth":2,"children":[]},{"title":"Margin Ratios","slug":"margin-ratios","depth":2,"children":[]},{"title":"Usage in API","slug":"usage-in-api","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"railsxyz","siteName":"Rails Trading Developer API Documentation","title":"Account Equity \u0026 Balances - Rails Trading Developer API Documentation","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-12T21:20:51.168Z","originalFileLocation":"latest/options/formulas/account-balance.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=\"system\"}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=\"application-name\" content=\"Rails Trading Developer API Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/railsxyz/uzRYRjCG6Wh2I4zS/_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/railsxyz/uzRYRjCG6Wh2I4zS/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/railsxyz/uzRYRjCG6Wh2I4zS/_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/railsxyz/uzRYRjCG6Wh2I4zS/_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/railsxyz/uzRYRjCG6Wh2I4zS/_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/railsxyz/uzRYRjCG6Wh2I4zS/_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/railsxyz/uzRYRjCG6Wh2I4zS/_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/railsxyz/uzRYRjCG6Wh2I4zS/_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/railsxyz/uzRYRjCG6Wh2I4zS/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Account Equity \u0026amp; Balances - Rails Trading Developer API Documentation\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Rails Trading Developer API Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.rails.xyz/latest/options/formulas/account-balance\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://railsxyz.mintlify.site/_mintlify/api/og/v2?division=Formulas\u0026amp;title=Account+Equity+%26+Balances\u0026amp;theme=eb3eb219e0aa7696ceab9f04\u0026amp;signature=8061067b9f708ed3f8556ba0e222d5c2c9fa9108f1fbee1a7d0e5fb0b6dfb656\">\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=\"Account Equity \u0026amp; Balances - Rails Trading Developer API Documentation\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://railsxyz.mintlify.site/_mintlify/api/og/v2?division=Formulas\u0026amp;title=Account+Equity+%26+Balances\u0026amp;theme=eb3eb219e0aa7696ceab9f04\u0026amp;signature=8061067b9f708ed3f8556ba0e222d5c2c9fa9108f1fbee1a7d0e5fb0b6dfb656\">\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/railsxyz/uzRYRjCG6Wh2I4zS/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Rails Trading Developer API Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0D9373\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.rails.xyz/latest/options/formulas/account-balance\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/latest/options/formulas/account-balance.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.rails.xyz/#organization\",\"name\":\"Rails Trading Developer API Documentation\",\"url\":\"https://docs.rails.xyz\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/railsxyz/XTasO28fw_2bd6Tp/logo/light.svg?fit=max\u0026auto=format\u0026n=XTasO28fw_2bd6Tp\u0026q=85\u0026s=562d1517f28bb695fb280b18dd4310a4\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.rails.xyz#website\",\"name\":\"Rails Trading Developer API Documentation\",\"url\":\"https://docs.rails.xyz\",\"publisher\":{\"@id\":\"https://docs.rails.xyz/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.rails.xyz/latest/options/formulas/account-balance#webpage\",\"url\":\"https://docs.rails.xyz/latest/options/formulas/account-balance\",\"name\":\"Account Equity \u0026 Balances\",\"dateModified\":\"2026-11-12T21:20:51.168Z\",\"isPartOf\":{\"@id\":\"https://docs.rails.xyz#website\"},\"breadcrumb\":{\"@id\":\"https://docs.rails.xyz/latest/options/formulas/account-balance#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.rails.xyz/latest/options/formulas/account-balance#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Formulas\",\"item\":\"https://docs.rails.xyz/latest/options/formulas/pricing-and-greeks\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Account Equity \u0026 Balances\",\"item\":\"https://docs.rails.xyz/latest/options/formulas/account-balance\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.rails.xyz/latest/options/formulas/account-balance#article\",\"headline\":\"Account Equity \u0026 Balances\",\"name\":\"Account Equity \u0026 Balances\",\"url\":\"https://docs.rails.xyz/latest/options/formulas/account-balance\",\"mainEntityOfPage\":{\"@id\":\"https://docs.rails.xyz/latest/options/formulas/account-balance#webpage\"},\"dateModified\":\"2026-11-12T21:20:51.168Z\",\"publisher\":{\"@id\":\"https://docs.rails.xyz/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.rails.xyz#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Rails Trading Developer API Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Rails Trading Developer API Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/latest/options/formulas/account-balance.md","siteName":"Rails Trading Developer API Documentation","nav":{"global":null,"tabs":[{"tab":"Home","icon":"house","pages":[{"title":"Home","href":""}]},{"tab":"Get Started","icon":"rocket","pages":[{"title":"Get Started","href":"/latest/introduction"}]},{"tab":"Perpetuals","icon":"chart-line","pages":[{"title":"Perpetuals","href":"/latest/perps/guides/overview"}]},{"tab":"Options","icon":"layer-group","groups":[{"group":"Guides","pages":[{"title":"Overview","href":"/latest/options/guides/overview"},{"title":"Instruments \u0026 Symbols","href":"/latest/options/guides/instruments-and-symbols"},{"title":"Market Data","href":"/latest/options/guides/market-data"},{"title":"Pricing \u0026 Greeks","href":"/latest/options/guides/pricing-and-greeks"},{"title":"Order Lifecycle","href":"/latest/options/guides/order-lifecycle"},{"title":"Positions \u0026 Account","href":"/latest/options/guides/positions-and-account"},{"title":"Margin \u0026 Liquidation","href":"/latest/options/guides/margin-and-liquidation"},{"title":"Settlement \u0026 Expiry","href":"/latest/options/guides/settlement-and-expiry"},{"title":"Rate Limits","href":"/latest/options/guides/rate-limits"},{"title":"Error Codes","href":"/latest/options/guides/error-codes"},{"title":"FAQs","href":"/latest/options/guides/faqs"}]},{"group":"Formulas","pages":[{"title":"Pricing \u0026 Greeks","href":"/latest/options/formulas/pricing-and-greeks"},{"title":"Margin \u0026 Fees","href":"/latest/options/formulas/margin-and-fees"},{"title":"Position Metrics","description":null,"href":"/latest/options/formulas/position-metrics"},{"title":"Account Equity \u0026 Balances","href":"/latest/options/formulas/account-balance"},{"title":"Settlement","description":null,"href":"/latest/options/formulas/settlement"}]},{"group":"Go SDK","pages":[{"title":"Quickstart","href":"/latest/options/go-sdk/quickstart"},{"title":"Orders","href":"/latest/options/go-sdk/orders"},{"title":"Streams \u0026 Account","href":"/latest/options/go-sdk/streams-and-account"}]},{"group":"WebSocket API Reference","pages":[{"title":"Overview","href":"/latest/options/websocket-api/overview"},{"title":"Common Requests","asyncapi":"latest/options/asyncapi/options-ws.yaml commonRequests","href":"/latest/options/websocket-api/common-requests"},{"title":"Order Management Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml orderManagementStream","href":"/latest/options/websocket-api/order-management-stream"},{"title":"Contracts Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml contractsStream","href":"/latest/options/websocket-api/contracts-stream"},{"title":"Quotes Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml quotesStream","href":"/latest/options/websocket-api/quotes-stream"},{"title":"Order Book Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml publicOrderBookStream","href":"/latest/options/websocket-api/order-book-stream"},{"title":"Public Trades Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml publicTradesStream","href":"/latest/options/websocket-api/public-trades-stream"},{"title":"Positions Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml positionsStream","href":"/latest/options/websocket-api/positions-stream"},{"title":"Open Orders Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml openOrdersStream","href":"/latest/options/websocket-api/open-orders-stream"},{"title":"Recent Orders Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml recentOrdersStream","href":"/latest/options/websocket-api/recent-orders-stream"},{"title":"Account Summary Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml accountSummaryStream","href":"/latest/options/websocket-api/account-summary-stream"},{"title":"Settlements Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml settlementsStream","href":"/latest/options/websocket-api/settlements-stream"}]},{"group":"HTTP API Reference","pages":[{"group":"Market Data","pages":[{"title":"Get Expirations","openapi":"GET /v1/contracts/markets/{market}/expirations","href":"/latest/options/rest-api/get-expirations"},{"title":"Get Contracts","openapi":"GET /v1/contracts/markets/{market}/expirations/{expiry}/contracts","href":"/latest/options/rest-api/get-contracts"}]},{"group":"Orders","pages":[{"title":"Create Order","openapi":"POST /v1/matching/orders/create","href":"/latest/options/rest-api/create-order"},{"title":"Modify Order","openapi":"POST /v1/matching/orders/modify","href":"/latest/options/rest-api/modify-order"},{"title":"Cancel Order","openapi":"POST /v1/matching/orders/cancel","href":"/latest/options/rest-api/cancel-order"},{"title":"Cancel All Orders","openapi":"POST /v1/matching/orders/cancel-all","href":"/latest/options/rest-api/cancel-all-orders"},{"title":"Get Open Orders","openapi":"GET /v1/matching/orders/open","href":"/latest/options/rest-api/get-open-orders"},{"title":"Get Order Status","openapi":"GET /v1/matching/order","href":"/latest/options/rest-api/get-order-status"}]},{"group":"User Account","pages":[{"title":"Get Account Summary","openapi":"GET /v1/account/summary","href":"/latest/options/rest-api/get-account-summary"},{"title":"Get Positions","openapi":"GET /v1/account/positions","href":"/latest/options/rest-api/get-account-positions"},{"title":"Get Recent Orders","openapi":"GET /v1/account/orders","href":"/latest/options/rest-api/get-account-orders"},{"title":"Get Account Deposits","openapi":"GET /v1/account/deposits","href":"/latest/options/rest-api/get-account-deposits"},{"title":"Get Account Withdrawals","openapi":"GET /v1/account/withdrawals","href":"/latest/options/rest-api/get-account-withdrawals"}]}]}]}]},"basePath":"","title":"Account Equity \u0026 Balances - Rails Trading Developer API Documentation","deploymentId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","buildId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","dynamics":[],"chunks":[]}