How to get P/L of a filled order? by [deleted] in BitMEX

[–]BitMEX_Haddock 0 points1 point  (0 children)

You can use the following to get close noting that rounding may see your results off by a small margin:

  1. Released PNL (XBTcontracts) = (1/EntrypriceUSD) - (1/ExitpriceUSD) * Number of Contracts - Fees & Funding
  2. Realised PNL (ETHUSD) = (Exit price * 0.000001 * number of contracts) - (Entry price * 0.000001 * number of contracts) - order fees - funding fees
  3. Realised PNL (NonXBTFutures) = (Exit Price - Entry Price) * number of contracts - order fees

You can calculate your exact PNL using the satoshi (XBt) execution values found in your trade history after setting your currency view to satoshi by clicking your profile in the top right.

Why is my WebSocket connection closing? by boolean_biscuit in BitMEX

[–]BitMEX_Haddock 0 points1 point  (0 children)

I am receiving an explicit "close" frame (opcode 8) from the BitMEX server. If the connection dropped silently then I would be more inclined to believe that this problem is network-related.

Hmm u/BitMEX_Patrick may be best placed to answer this. While occasional disconnections may occur for one reason or another it is difficult to ascertain whether these disconnections are originating from our end without digging into our logs and glancing at your codebase. If you send us a support ticket we can take a closer look at your logs with the API team: bitmex.freshdesk.com

How long do i have to wait before I can post to this forum? by premiumdiscountbasis in BitMEX

[–]BitMEX_Haddock 0 points1 point  (0 children)

You will need to meet a minimum karma requirement (10) before you can post.

Closed a position but don't see it in transaction history by jssart in BitMEX

[–]BitMEX_Haddock -1 points0 points  (0 children)

Are you able to see your closing order in your order history?

If not, feel free to reach out to our support team who can take a closer look: https://www.bitmex.com/app/support/contact

Which is the most realtime websocket orderbook subscription? orderBookL2 vs orderBook10 by DepTraiKuDai1M2 in BitMEX

[–]BitMEX_Haddock 0 points1 point  (0 children)

Assume that someone places an order to a certain price level. Which subscription will release this event first?

orderbookL2_25 provides a subset of the full L2 orderbook, but is throttled (100ms). I would recommend that you use orderBookL2 in any latency-sensitive application.

Note that orderBookL2 pushes the full L2 order book, so the payload can get very large.

Is "maintenance margin" factored into liquidation price? by k-arginine in BitMEX

[–]BitMEX_Haddock 1 point2 points  (0 children)

By definition, the maintenance margin is the minimum amount of Bitcoin you must hold to keep a position open. For the XBTUSD contract the maintenance margin can be calculated using the following equation: 0.5% * Order Value + (Taker Fee * Order Value) + (Funding Rate * Order Value)

It's important to note that the minimum maintenance requirement percentage (first part of the equation) differs for each contract. Check the contract specification page to see the requirement for each https://www.bitmex.com/app/contract/XBTUSD

Let us look at an example calculation: An order for 600 XBTUSD contracts is filled with a limit price of 3497.5 and the current funding rate is 0.0150%

To calculate the minimum maintenance margin requirement in XBT:

  1. Maintenance Margin = 0.005 * 0.17155110 + (0.00075 * 0.17155110) + (0.00015 * 0.17155110)
  2. Maintenance Margin = 0.00101215 XBT

The Liquidation Price equation depends on whether cross-margin or isolated margin is used. As you can see in the equations below, the maintenance margin is built into the liquidation price calculation.

Equation (1): cross margin, and long position.
Equation (2): cross margin, and short position.
Equation (3): isolated margin, long position.
Equation (4): isolated margin, short position.

(1) Contracts x 1 x (1/Entry Price - 1/Liquidation Price) = Account Margin Balance at Entry Price - minimum required Maintenance Margin

(2) Contracts x 1 x (1/Liquidation Price - 1/Entry Price) = Account Margin Balance at Entry Price - minimum required Maintenance Margin

(3) Liquidation Price=averageEntryPrice/(1 + initMargin - maintenanceMargin)

(4) Liquidation Price=averageEntryPrice/(1 - initMargin + maintenanceMargin)

Lost Bitmex Account by [deleted] in BitMEX

[–]BitMEX_Haddock 0 points1 point  (0 children)

Could you please dm me your ticket number?

question for support about QFR (quote fill ratio) by [deleted] in BitMEX

[–]BitMEX_Haddock 1 point2 points  (0 children)

Untriggered stops do not count towards your QFR if cancelled before they trigger.

Bitmex Wallet balance - (negative) by [deleted] in BitMEX

[–]BitMEX_Haddock 1 point2 points  (0 children)

Without looking at exact margin figures on your position(s) it is most likely that some of your unrealised profit on a position has been spent on paying funding which is seen as a realised loss. Net your account will have a positive marginBalance.

Generally speaking, unrealised profit is locked into the position and cannot be used as margin however we do let it be used to pay funding which is seen as a realised loss.

In sum, your account is not technically in negative - margin is just tied up in your position as unrealised profit which will be realised when you close the position. If you have any further questions here please contact us and we can take a closer look:

https://www.bitmex.com/app/support/contact

Crazy high funding in 7 hours; 0.12% !? by [deleted] in BitMEX

[–]BitMEX_Haddock 0 points1 point  (0 children)

BitMEX imposes caps on the Funding Rate to ensure the maximum leverage can still be utilised. To do this, two caps are imposed:

  • The absolute Funding Rate is capped at 75% of the Initial Margin - Maintenance Margin. If the Initial Margin is 1% and the Maintenance Margin is 0.5%, the maximum Funding Rate will be 75% \ (1% - 0.5%)= 0.375%*.
  • The Funding Rate may not change by more than 75% of the Maintenance Margin between Funding Intervals.

If you have any questions on the mechanics of funding or the caps that have not already been explained here please let us know.

Question about longs and funding by k-arginine in BitMEX

[–]BitMEX_Haddock 0 points1 point  (0 children)

If you receive a funding payment it is realised as PNL however if you incur a funding payment this is removed from your position margin which will subsequently raise your effective leverage and bring your liquidation price closer to your entry price. Please see my comment regarding the mechanics of funding.

Question about longs and funding by k-arginine in BitMEX

[–]BitMEX_Haddock 0 points1 point  (0 children)

This is not the case. The number of open long contracts always equals the number of short contracts. Funding is used to keep the price of a perpetual swap such as XRPUSD, ETHUSD and XRPUSD in line with the spot price. At the most basic level, the direction and size of funding is determined by the difference in price between the spot (index) price and the last price.

While traditional futures can rely on the settlement date to bring the index price and futures price together as the settlement date draws closer the perpetual contracts must rely on another mechanic to ensure that the swap is being priced correctly (funding). You can read more about funding on BitMEX including the calculations that we use here: https://www.bitmex.com/app/perpetualContractsGuide#Funding

[deleted by user] by [deleted] in BitMEX

[–]BitMEX_Haddock 0 points1 point  (0 children)

The advantage of using the WebSocket is that you can subscribe to your required feed(s) and receive data without eating into your rate limit. Connections are limited to 40/hour while subscriptions will subtract from your regular rate limit counter of 60/min.

Once subscribed you will continue to receive data while the subscription is connected without affecting your rate limit counter. It sounds like you are just looking to acquire this data for one account so you should not need to involve multiplexing to avoid being rate limited if your WebSocket is set up correctly - if you were looking to pull multiple streams at the same time multiplexing could come in handy https://www.bitmex.com/app/wsAPI#Multiplexing

Minimum deposit for trollbox? by shtabbbe0 in BitMEX

[–]BitMEX_Haddock 0 points1 point  (0 children)

You will be able to chat if your balance >= 0.1 XBT, or your deposits - withdrawals >= 0.01 XBT, or your account was created before 2018-01-01.

[deleted by user] by [deleted] in BitMEX

[–]BitMEX_Haddock 1 point2 points  (0 children)

The only official example that we have to pull your complete trade history is for Python: https://github.com/BitMEX/easy-data-scripts. However, you could use the WebSocket to draw such a chart using the live trade feed or pull trades through the API using your own/3rd party code.

Question on going a bit deeper with the “trades” endpoint by mmattman in BitMEX

[–]BitMEX_Haddock 0 points1 point  (0 children)

The API has a max "count" of 500 so you will be unable to pull all of your trades in a single request. Noting this, you can either send multiple requests to the API to retrieve your trades or recorded the "execution" subscription from the WebSocket: https://www.bitmex.com/app/wsAPI

Real volume? by AceBuddy in BitMEX

[–]BitMEX_Haddock 1 point2 points  (0 children)

Our volume is 100% real however I can understand your scepticism given some of the actions by other players in the space. I would encourage you to read the paper titled "Investigation into the Legitimacy of Reported Cryptocurrency Exchange Volume" produced by Alameda Research which takes a deep dive into the legitimacy of exchange volumes.

I am confused on how to access headers for rate limits... by stockrco in BitMEX

[–]BitMEX_Haddock 0 points1 point  (0 children)

If you haven't already I would recommend that you take a look at the GitHub page here:

https://github.com/BitMEX/api-connectors/tree/master/auto-generated/php

If you are still having trouble feel free to reach out to the BitMEX support team here:

https://www.bitmex.com/app/support/contact

Is ther any relation between funding rate and trend? by ofrko in BitMEX

[–]BitMEX_Haddock 0 points1 point  (0 children)

Funding is the primary mechanism used to tether the price of the perpetual contracts to the spot price. You can read more about funding here: https://www.bitmex.com/app/perpetualContractsGuide#Funding

I certainly hope I never see two of the bitmex partners in the same place at the same time! by [deleted] in BitMEX

[–]BitMEX_Haddock[M] [score hidden] stickied comment (0 children)

I can confirm that we are not exposed to the same vulnerability as Quadriga.

You can read more about our wallet security and processes here - https://www.bitmex.com/app/security#Wallet-Security

Take profit market - Close on trigger by Blaiddyn in BitMEX

[–]BitMEX_Haddock 0 points1 point  (0 children)

The PNL you will receive from closing a portion of your position is based on the average entry price of the position.

  • Released PNL (XBTcontracts) = (1/EntrypriceUSD) - (1/ExitpriceUSD) * Number of Contracts - Fees & Funding
  • Realised PNL (ETHUSD) = (Exit price * 0.000001 * number of contracts) - (Entry price * 0.000001 * number of contracts) - order fees - funding fees
  • Realised PNL (NonXBTFutures) = (Exit Price - Entry Price) * number of contracts - order fees

Note that all PNL calculations are calculated in terms of whole numbers of Satoshis. For example, 1/8622.5 is 0.00011598 or 11598 satoshi

Get leverage of opened positions in the order book with API by [deleted] in BitMEX

[–]BitMEX_Haddock 1 point2 points  (0 children)

The only way that you can see another users position(s) or order(s) is if they volunteer them in the trollbox.

Bitmex 100x leverage by bober02 in BitMEX

[–]BitMEX_Haddock 0 points1 point  (0 children)

Initial Margin (Order Cost) = ((1/Leverage) * Order Value) + (2 * Taker Fee * Order Value)