-
Notifications
You must be signed in to change notification settings - Fork 212
Question #114
Comments
Yeah foreignNotional is actually the usd value.
…On Fri, Oct 30, 2020, 1:27 PM Kevin Rostagni ***@***.***> wrote:
I had no idea about that formula.
I just show what bitmex is sending through api
here is a trade :
[image: image]
<https://user-images.githubusercontent.com/5738336/97747586-7f94e300-1aec-11eb-8d30-0c23d4d9e9a5.png>
Im just taking the "price" property and "size" property sent by bitmex api
and if contract is quoted in USD which is the case I think for perps on
bitmex, I divide size by the price (because thats how I store the sizes on
all exchanges, thats the number of coins, of tokens, of "contracts", never
keep the price in the size). So I only have 2 distinct props. SIZE and PRICE
Then in the list on the UI I just print the price, and size * price (and
thats the original "size" sent by bitmex)
[image: image]
<https://user-images.githubusercontent.com/5738336/97747606-87ed1e00-1aec-11eb-8f84-12f7fed95774.png>
So given the example above, you are saying that I should instead print the
size like that :
.000001 * contracts * ethusdPrice * btcusdPrice
=== *.000001 * 20090 * 383.85 * 13500* *(..13500 beeing a rough estimate
of btc price which the app do not know when listening to ethusd trades btw)*
=== *104105.878*
which actually seems to be the "foreignNotional" value in the trade sent
by bitmex
Honestly I see this number, Ive no idea what it is or refering to lol.
And the formula is probably different depending on the exchange..
I would prefer to display the size in a way that speak to the greater
number of people.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#114 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGA2WHDK7TK5LTCDDPADZUTSNMHTDANCNFSM4TFHPMVQ>
.
|
It's weird because BitMEX XBTUSD contract is $1 = 1 contract. It's just not for ETHUSD. It gives the value of the ETHUSD contract here in the Contract Specification https://www.bitmex.com/app/contract/ETHUSD. Where it says each contract is worth 0.001 mXBT per $1 price. From the API you get the description of foreignNotional is the value of position in units of the quote currency. ETHUSD quote currency is USD. And from the Perp Guide you get the bitcoin multiplier which is where I got the formula where .000001 is the bitcoin multiplier for the ETHUSD contract. You did the math correctly in your response here. But I think for BitMEX ETHUSD at least it would be easier to just pull and display the foreignNotional value. Which currently is a lot higher than 1 contract = 1 dollar. At 0.001 mXBT per $1 price it's at 1 contract = $5.22. It increases linearly with the prices of BTC and ETH. |
https://github.com/Tucsky/SignificantTrades/blob/master/src/components/TradeList.vue#L149 Screenshot below is a comparison of bitmex trades panel on the left and this tool with no aggregation / no threshold on the right I think ive already got all the sizing right on XBT quoted contracts (by displaying size property as it is and not use foreignNotional) |
Sorry for the slow response. Yes you are correct. I'm not sure if it's just ETHUSD or all alt-USD pairs. But the foreignNotional should be correct I would think in all cases. |
With BitMEX how are you calculating the USD value for ETHUSD perpetual contracts? bc i see a lot of whale alerts denominated in USD but they take the 1 contract = 1 USD for ETH which is not true for BitMEX.
it's .000001 * contracts * ethusdPrice * btcusdPrice.
The text was updated successfully, but these errors were encountered: