Understanding the mathematics of leverage on Binance Futures

I’m using CCXT to Futures trade on Binance

First I’m placing test trades using the WebUI to make sure I understand the mechanics first.

I enabled Hedge Mode, set margin to 10x, moved $200 in USDT into my Futures account and placed a 10x LONG using $200 of that.

As the stock moves the other way, I now set margin to 50x, move in another $100 and place a SHORT for half the amount.

But inspecting my positions, I see 50x next to both positions.

So it seems that it’s possible to change leverage on an existing open position.

Could someone elucidate the mechanics, so I can see at mathematical granularity what is happening?

e.g:
Hedge mode ENABLED.
I load $200 into Futures account.

I place $100 LONG @ 10x.
In my open positions, I should see $1000 invested.

But price moves DOWN 5%.
So I should see $950 in my open positions, right?
And if I were to cash out now, I’d lose $50 of that $100.

Suppose I now set leverage to 30x and place a short, using $50

I would expect to see $50 in my remaining balance, $950 @ 10x lev in my LONG position and $1500 @30x lev in my SHORT position.

But the act of changing the leverage to 30x has changed leverage to 30x on my LONG position.

Is that a bug/glitch?

What should be the status of my futures balance, my LONG position and my SHORT position at the moment in time?

Links to relevant information gratefully received. I’m finding this hard to get my head around.

But inspecting my positions, I see 50x next to both positions.
So it seems that it’s possible to change leverage on an existing open position.

Leverage is attributed to a symbol, not an order. Therefore, change the leverage for BTCUSDT will affect positions and orders (LONG and SHORT) for BTCUSDT.

Here’s more info regarding leverages.