-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reserved Balance (show balance reserved by open orders separately) #1584
Comments
Do you mean subtracting the quantity from all our open orders from the numbers we return/display for balance calls? |
Subtracting and showing it in a separate field or parenthesis e.g.:
|
This feature was requested from two users independently in the last days, so I am bumping prio here. Do you think it makes sense as described? @sangaman |
Bumped prio to P1 since this is needed for #1896. |
As just discussed with @raladev we have no collateralization for |
Closing here in favour of #1678 (comment) |
This exposes the amounts reserved for open orders on the `TradingLimits` call and subtracts reserved amounts from the `maxSell` and `maxBuy` values returned by the call. It also removes reserved order amounts from GetBalance - reversing #1584. The logic to calculate max sell and buys is as follows: 1. Sum up all outbound and inbound balances across all channels, as well as the maximum balances for a single channel, as we still aren't expecting to use multi-path payments. For Connext there is a single channel so we only have a single inbound & outbound value per currency. 2. Subtract reserved order amounts from the total inbound and outbound balances calculated above. E.g. if we have outbound capacity of 1.2 ETH, but we have an order to sell 0.7 ETH, our max sell would be 0.5 ETH. 3. Return the smaller of the amount calculated in step 2 or the maximum single channel balance calculated in step 1. Resolves #1678.
This exposes the amounts reserved for open orders on the `TradingLimits` call and subtracts reserved amounts from the `maxSell` and `maxBuy` values returned by the call. It also removes reserved order amounts from GetBalance - reversing #1584. The logic to calculate max sell and buys is as follows: 1. Sum up all outbound and inbound balances across all channels, as well as the maximum balances for a single channel, as we still aren't expecting to use multi-path payments. For Connext there is a single channel so we only have a single inbound & outbound value per currency. 2. Subtract reserved order amounts from the total inbound and outbound balances calculated above. E.g. if we have outbound capacity of 1.2 ETH, but we have an order to sell 0.7 ETH, our max sell would be 0.5 ETH. 3. Return the smaller of the amount calculated in step 2 or the maximum single channel balance calculated in step 1. Resolves #1678.
Exchanges usually show balance that is reserved by open orders slightly different, e.g. as "frozen", so should we. I prefer the term "reserved" since it's simply balance reserved for a certain open order.
Additionally, this reserved balance should be subtracted from
tradinglimits
to makeplaceorder
balance checks account for it.The text was updated successfully, but these errors were encountered: