1"use strict";(self.webpackChunkuxuy_doc_site=self.webpackChunkuxuy_doc_site||[]).push([[1094],{3905:(e,i,t)=>{t.d(i,{Zo:()=>u,kt:()=>g});var n=t(7294);function a(e,i,t){return i in e?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t,e}function r(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),t.push.apply(t,n)}return t}function o(e){for(var i=1;i<arguments.length;i++){var t=null!=arguments[i]?arguments[i]:{};i%2?r(Object(t),!0).forEach((function(i){a(e,i,t[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):r(Object(t)).forEach((function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))}))}return e}function l(e,i){if(null==e)return{};var t,n,a=function(e,i){if(null==e)return{};var t,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)t=r[n],i.indexOf(t)>=0||(a[t]=e[t]);return a}(e,i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)t=r[n],i.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var d=n.createContext({}),c=function(e){var i=n.useContext(d),t=i;return e&&(t="function"==typeof e?e(i):o(o({},i),e)),t},u=function(e){var i=c(e.components);return n.createElement(d.Provider,{value:i},e.children)},s="mdxType",p={inlineCode:"code",wrapper:function(e){var i=e.children;return n.createElement(n.Fragment,{},i)}},m=n.forwardRef((function(e,i){var t=e.components,a=e.mdxType,r=e.originalType,d=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),s=c(t),m=a,g=s["".concat(d,".").concat(m)]||s[m]||p[m]||r;return t?n.createElement(g,o(o({ref:i},u),{},{components:t})):n.createElement(g,o({ref:i},u))}));function g(e,i){var t=arguments,a=i&&i.mdxType;if("string"==typeof e||a){var r=t.length,o=new Array(r);o[0]=m;var l={};for(var d in i)hasOwnProperty.call(i,d)&&(l[d]=i[d]);l.originalType=e,l[s]="string"==typeof e?e:a,o[1]=l;for(var c=2;c<r;c++)o[c]=t[c];return n.createElement.apply(null,o)}return n.createElement.apply(null,t)}m.displayName="MDXCreateElement"},5347:(e,i,t)=>{t.r(i),t.d(i,{assets:()=>d,contentTitle:()=>o,default:()=>p,frontMatter:()=>r,metadata:()=>l,toc:()=>c});var n=t(7462),a=(t(7294),t(3905));const r={id:"margin-and-liquidation",title:"Margin, PnL and the Liquidation Mechanism",sidebar_label:"Margin and Liquidation",sidebar_position:2,description:"Margin calculations, unrealized PnL, Liquidation Price formulas and the isolated margin liquidation process for UXUY perpetual contracts.",keywords:["margin","unrealized PnL","liquidation price","isolated margin","maintenance margin rate"]},o="Margin, PnL and the Liquidation Mechanism",l={unversionedId:"perpetuals/margin-and-liquidation",id:"perpetuals/margin-and-liquidation",title:"Margin, PnL and the Liquidation Mechanism",description:"Margin calculations, unrealized PnL, Liquidation Price formulas and the isolated margin liquidation process for UXUY perpetual contracts.",source:"@site/docs/perpetuals/margin-and-liquidation.md",sourceDirName:"perpetuals",slug:"/perpetuals/margin-and-liquidation",permalink:"/perpetuals/margin-and-liquidation",draft:!1,editUrl:"https://github.com/uxuycom/uxuy-docsite/blob/main/docs/perpetuals/margin-and-liquidation.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{id:"margin-and-liquidation",title:"Margin, PnL and the Liquidation Mechanism",sidebar_label:"Margin and Liquidation",sidebar_position:2,description:"Margin calculations, unrealized PnL, Liquidation Price formulas and the isolated margin liquidation process for UXUY perpetual contracts.",keywords:["margin","unrealized PnL","liquidation price","isolated margin","maintenance margin rate"]},sidebar:"docsSidebar",previous:{title:"Overview",permalink:"/perpetuals/overview"},next:{title:"Risk Limits and Position Tiers",permalink:"/perpetuals/risk-tiers"}},d={},c=[{value:"Opening Margin and Cost",id:"opening-margin-and-cost",level:2},{value:"Estimated Opening Margin",id:"estimated-opening-margin",level:3},{value:"Actual Opening Margin",id:"actual-opening-margin",level:3},{value:"Estimated Opening Cost",id:"estimated-opening-cost",level:3},{value:"Actual Opening Cost",id:"actual-opening-cost",level:3},{value:"Actual Opening Fee",id:"actual-opening-fee",level:3},{value:"PnL Calculation",id:"pnl-calculation",level:2},{value:"Unrealized PnL",id:"unrealized-pnl",level:3},{value:"Maximum Position Size and Capital Usage",id:"maximum-position-size-and-capital-usage",level:2},{value:"Maximum Position Size That Can Be Opened",id:"maximum-position-size-that-can-be-opened",level:3},{value:"Estimated Capital Required per Unit",id:"estimated-capital-required-per-unit",level:3},{value:"Position and Margin Metrics",id:"position-and-margin-metrics",level:2},{value:"Position Notional",id:"position-notional",level:3},{value:"Maintenance Margin",id:"maintenance-margin",level:3},{value:"Position Initial Margin",id:"position-initial-margin",level:3},{value:"Account Metrics",id:"account-metrics",level:2},{value:"Wallet Balance",id:"wallet-balance",level:3},{value:"Account Equity",id:"account-equity",level:3},{value:"Liquidation-Related Calculations",id:"liquidation-related-calculations",level:2},{value:"Liquidation Fee",id:"liquidation-fee",level:3},{value:"Theoretical Liquidation PnL",id:"theoretical-liquidation-pnl",level:3},{value:"Reference Liquidation Price",id:"reference-liquidation-price",level:3},{value:"Isolated Margin Liquidation Process",id:"isolated-margin-liquidation-process",level:2}],u={toc:c},s="wrapper";
1function p(e){let{components:i,...t}=e;return(0,a.kt)(s,(0,n.Z)({},u,t,{components:i,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"margin-pnl-and-the-liquidation-mechanism"},"Margin, PnL and the Liquidation Mechanism"),(0,a.kt)("admonition",{type:"info"},(0,a.kt)("p",{parentName:"admonition"},"If the content of this document differs from what is displayed in the UXUY trading interface, the real-time data and rules shown in the product interface prevail. Actual calculations may also incorporate product-specific precision and rounding rules, fee reserves, funding costs, Risk Tiers and other parameters.")),(0,a.kt)("h2",{id:"opening-margin-and-cost"},"Opening Margin and Cost"),(0,a.kt)("h3",{id:"estimated-opening-margin"},"Estimated Opening Margin"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Estimated Opening Margin = Order Quantity \xd7 Calculation Price \xf7 Leverage\n")),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"The calculation price for a limit order is the limit price entered by the user."),(0,a.kt)("li",{parentName:"ul"},"The calculation price for a market order is the Mark Price at the time the order is submitted.")),(0,a.kt)("h3",{id:"actual-opening-margin"},"Actual Opening Margin"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Actual Opening Margin = \u03a3 (Filled Quantity per Fill \xd7 Execution Price per Fill \xf7 Leverage)\n")),(0,a.kt)("h3",{id:"estimated-opening-cost"},"Estimated Opening Cost"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Estimated Opening Cost = Estimated Opening Margin + Estimated Opening Fee\n")),(0,a.kt)("h3",{id:"actual-opening-cost"},"Actual Opening Cost"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Actual Opening Cost = Actual Opening Margin + Actual Opening Fee\n")),(0,a.kt)("h3",{id:"actual-opening-fee"},"Actual Opening Fee"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Actual Opening Fee = \u03a3 (Filled Quantity per Fill \xd7 Execution Price per Fill \xd7 Applicable Maker/Taker Fee Rate)\n")),(0,a.kt)("h2",{id:"pnl-calculation"},"PnL Calculation"),(0,a.kt)("h3",{id:"unrealized-pnl"},"Unrealized PnL"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Long position: Unrealized PnL = (Mark Price \u2212 Average Entry Price) \xd7 Position Size\nShort position: Unrealized PnL = (Average Entry Price \u2212 Mark Price) \xd7 Position Size\n")),(0,a.kt)("h2",{id:"maximum-position-size-and-capital-usage"},"Maximum Position Size and Capital Usage"),(0,a.kt)("h3",{id:"maximum-position-size-that-can-be-opened"},"Maximum Position Size That Can Be Opened"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Limit order: Maximum Position Size = Available Balance \xf7 [Limit Price \xd7 (1 \xf7 Leverage + Reserved Fee Rate)]\nMarket order: Maximum Position Size = Available Balance \xf7 [Current Mark Price \xd7 (1 \xf7 Leverage + Reserved Fee Rate)]\n")),(0,a.kt)("h3",{id:"estimated-capital-required-per-unit"},"Estimated Capital Required per Unit"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Estimated Capital Required per Unit = Calculation Price \xf7 Leverage + Calculation Price \xd7 Reserved Fee Rate\n")),(0,a.kt)("h2",{id:"position-and-margin-metrics"},"Position and Margin Metrics"),(0,a.kt)("h3",{id:"position-notional"},"Position Notional"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Position Notional = Position Size \xd7 Average Entry Price\n")),(0,a.kt)("h3",{id:"maintenance-margin"},"Maintenance Margin"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Maintenance Margin = Position Notional \xd7 Maintenance Margin Rate of the Current Risk Tier\n")),(0,a.kt)("h3",{id:"position-initial-margin"},"Position Initial Margin"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Position Initial Margin = Position Notional \xf7 Leverage\n")),(0,a.kt)("h2",{id:"account-metrics"},"Account Metrics"),(0,a.kt)("h3",{id:"wallet-balance"},"Wallet Balance"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Wallet Balance = Available Balance + Frozen Balance\n")),(0,a.kt)("h3",{id:"account-equity"},"Account Equity"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Account Equity = Wallet Balance + All Unrealized PnL\n")),(0,a.kt)("h2",{id:"liquidation-related-calculations"},"Liquidation-Related Calculations"),(0,a.kt)("h3",{id:"liquidation-fee"},"Liquidation Fee"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Liquidation Fee = Liquidated Quantity \xd7 Mark Price at Liquidation \xd7 Liquidation Fee Rate\n")),(0,a.kt)("h3",{id:"theoretical-liquidation-pnl"},"Theoretical Liquidation PnL"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Long position: Theoretical Liquidation PnL = (Mark Price at Liquidation \u2212 Average Entry Price) \xd7 Liquidated Quantity\nShort position: Theoretical Liquidation PnL = (Average Entry Price \u2212 Mark Price at Liquidation) \xd7 Liquidated Quantity\n")),(0,a.kt)("h3",{id:"reference-liquidation-price"},"Reference Liquidation Price"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Long position: Reference Liquidation Price = Average Entry Price \xd7 (1 \u2212 1 \xf7 Leverage + Maintenance Margin Rate)\nShort position: Reference Liquidation Price = Average Entry Price \xd7 (1 + 1 \xf7 Leverage \u2212 Maintenance Margin Rate)\n")),(0,a.kt)("admonition",{type:"note"},(0,a.kt)("p",{parentName:"admonition"},"The Liquidation Price actually displayed may differ from the simplified reference formulas above due to fees, funding costs, position changes, Risk Tier adjustments, rounding rules and other account factors.")),(0,a.kt)("h2",{id:"isolated-margin-liquidation-process"},"Isolated Margin Liquidation Process"),(0,a.kt)("p",null,"Under isolated margin mode, each position uses its own independent margin. When the risk of a position continues to rise and its margin becomes insufficient, only that isolated position may be liquidated, and other isolated positions are generally not directly affected."),(0,a.kt)("p",null,"Specific trigger conditions, execution methods and settlement results are subject to the real-time risk parameters dis
1played on the UXUY trading page and the actual execution results."),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Step"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"1. Risk continues to rise"),(0,a.kt)("td",{parentName:"tr",align:null},"The market price moves unfavorably and the position's unrealized loss continues to widen.")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"2. Insufficient margin"),(0,a.kt)("td",{parentName:"tr",align:null},"When position margin is no longer sufficient to meet the current Maintenance Margin requirement, the system enters the risk handling process.")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"3. Liquidation triggered"),(0,a.kt)("td",{parentName:"tr",align:null},"The system liquidates the isolated position in accordance with the applicable risk control rules.")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"4. Position filled"),(0,a.kt)("td",{parentName:"tr",align:null},"The closing order is submitted to the market for execution, and the final execution price depends on market liquidity and actual fills at that time.")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"5. PnL settlement"),(0,a.kt)("td",{parentName:"tr",align:null},"After the position is closed, the system calculates the final PnL, deducts applicable fees and updates account assets.")))))}p.isMDXComponent=!0}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.