I have some questions about margin trading amounts:
I have $4300 USD in my trading account, hence $4300 margin balance. With 3.3:1 leverage, I should have a tradable balance of $14190. OK.
I have an active long position on BTC. Amount: 50, base price: $210.50. So this means I've used $10525 of my tradable balance on this position.
As the maintenance margin is 15%, I need to keep 15% of $10525 -- $1578.75. This matches the required margin.
Ignoring unrealized swap. It's less than a dollar.
So:
14190 - 10525 - 1578.75 = 2086.25
This should be my remaining tradable balance, right? But it's only $1707.
Where did $380 go? And why is my tradable balance varying with every refresh? My maintenance is $1578.75, and that is static. My USD balance is $4300, and that is static. My already-borrowed amount of $10525 is static. Everything's static, how is my tradable balance fluctuating?
Maybe because you have a long position whose worth is changing. So you get in debt or get profit from it. Thus changing your further possible tradable balance. I believe the tradable balance isnt changing when you dont hold a position.
This is exactly what is going on. Your tradeable balance changes based on not only the amount in the wallet, but also based on the unrealized P&L. This applies to all the rest of the calculations, so it can get pretty complex. Every moment when the book changes (best bid or ask) your tradeable balance will also change, because if you have a position, your P&L changed.
Now, because the book and your balances are not refreshed in the same way (we use websockets for the book, more on that to come), you may see a new value pop into the book, and this will change some of the calculations. One of the issues here is actually pretty basic with web based programs. The client (your browser) is running javascript and updating some of the fields that it can calculate on its own, but it also relies on the server, which does its own calculations for other fields. So, depending on which field we are talking about, it could be relying on the server to give it the correct value, while another field may be updating based on a local calculation. So, ideally, doing things locally makes them faster for the user, but the server won't know about them until they are sent, while if you wait for the server for everything, it won't be as responsive on the "frontend" (which is the browser you are using to view bitfinex.com).
That is all to say that there is a lot of stuff going on all the time. Other people are changing the state of the book, and depending on whether a given value is being calculated by the server or the client, it can be difficult to keep track of how a certain number was arrived at. This is a general answer, to your very specific question, so it might not be exactly right, but in general, in my experience, it is usually caused by things like this.
Basically, you have to account for unrealized P&L in order to calculate correctly, because your wallet balance is not static (it changes for the purposes of those calculations based on your unrealized P&L).