Examples
These examples assume no fees and will differ slightly from the reality of trading on the VALR exchange. For fully accurate figures, please incorporate fees into your calculations.
Max that can be spent by borrowing ZAR to buy BTC where there is no existing debt
For an account holding BTC with no pre-existing debt, how can a customer calculate the maximum total, including leverage, that could be placed as a buy order on BTCZAR?
Coin |
Balance | Available | Available in Reference |
Mark Price | Weighting |
BTC | 1 | 1 | 475,000 |
500,000 |
0.95 |
ZAR | 0 | 0 | 0 |
1 |
1 |
Calculation: spot available balance + (availableInReference * 2)
= 0 + (475,000 * 2)
= 950,000
Please remember that available in reference is calculated after weighting is applied. Spot BTC is worth R500,000 in this example, but as collateral, it is only worth R475,000
Max that can be spent by borrowing BTC to sell for ZAR where there is no existing debt
Balances |
|||||
Coin |
Balance |
Available |
Available in Reference |
Mark Price |
Weighting |
BTC |
0 |
0 |
0 |
500,000 |
0.95 |
ZAR |
200,000 |
200,000 |
200,000 |
1 |
1 |
Calculation: spot available balance + (availableInReference * 2)
= 0 + (200,000 * 2)
= 400,000
Max that can be spent by borrowing ZAR to buy BTC where there is no existing debt
For an account holding ZAR with no pre-existing debt, how can a customer calculate the maximum total, including leverage, that could be placed as a buy order on BTCZAR?
Balances |
|||||
Coin |
Balance |
Available |
Available in Reference |
Mark Price |
Weighting |
BTC |
0 |
0 |
0 |
500,000 |
0.95 |
ZAR |
300,000 |
300,000 |
300,000 |
1 |
1 |
Calculation: spot available balance + (availableInReference * 2)
= 300,000 + (300,000 * 2)
= 900,000
In this example, a spot balance in ZAR would first be used to purchase spot BTC. Then that spot BTC balance would be collateralised to cover a debt in ZAR that is obtained to buy more BTC.
Max that can be spent by borrowing BTC to sell for ZAR where there is no existing debt
For an account holding BTC with no pre-existing debt, how can a customer calculate the maximum total, including leverage, that could be placed as a sell order on BTCZAR?
Balances |
|||||
Coin |
Balance |
Available |
Available in Reference |
Mark Price |
Weighting |
BTC |
0.5 |
0.5 |
237,500 |
500,000 |
0.95 |
ZAR |
0 |
0 |
0 |
1 |
1 |
Calculation: spot available balance + (availableInReference * 2)
= 237,500 + (237,500 * 2)
= 950,000
In this example, a spot balance in BTC would first be used to sell spot BTC. Then that spot ZAR balance would be collateralised to cover a BTC debt obtained to sell more BTC for ZAR. Weighting is applied based on spot account balances; if weightings change after a debt is obtained, then margin information is recalculated to accurate figures.
Max that can be spent by borrowing ZAR to buy BTC where there is existing ZAR debt
For an account holding BTC with an existing ZAR debt below max leverage, how can a customer calculate the maximum total, including leverage, that could be placed as a buy order on BTCZAR?
Balances |
|||||
Coin |
Balance |
Available |
Available in Reference |
Mark Price |
Weighting |
BTC |
1.95 |
0.45 |
213,750 |
500,000 |
0.95 |
ZAR |
-475,000 |
0 |
0 |
1 |
1 |
Margin calculations:
collateralisedMarginFraction: |
0.50000000 |
initialMarginFraction: |
0.50000000 |
totalBorrowedInReference: |
475000.00000000 |
collateralisedBalancesInReference: |
712500.00000000 |
referenceCurrency: |
ZAR |
initialRequiredInReference: |
712500.00000000 |
availableInReference: |
213750.000000000 |
maintenanceMarginFraction: |
0.1 |
autoCloseMarginFraction: |
0.03333333 |
availableToBorrowInReference: |
427500.00000000 |
marginFraction: |
0.95000000 |
LeverageMultiple: |
1.06 |
Calculation: spot available balance + (availableInReference * 2)
= 0 + (213,750 * 2)
= 427,500
Max that can be spent by borrowing BTC to sell for ZAR where there is existing ZAR debt
For an account holding BTC with an existing debt in ZAR, how can a customer calculate the maximum total, including leverage, that could be placed as a sell order on BTCZAR?
Balances |
|||||
Coin |
Balance |
Available |
Available in Reference |
Mark Price |
Weighting |
BTC |
1.95 |
0.45 |
213,750 |
500,000 |
0.95 |
ZAR |
-475,000 |
0 |
0 |
1 |
1 |
Margin calculations:
collateralisedMarginFraction: |
0.50000000 |
initialMarginFraction: |
0.50000000 |
totalBorrowedInReference: |
475000.00000000 |
collateralisedBalancesInReference: |
712500.00000000 |
referenceCurrency: |
ZAR |
initialRequiredInReference: |
712500.00000000 |
availableInReference: |
213750.000000000 |
maintenanceMarginFraction: |
0.1 |
autoCloseMarginFraction: |
0.03333333 |
marginFraction: |
0.95000000 |
LeverageMultiple: |
1.06 |
Calculation: total spot balance + (availableInReference * 2)
= 975,000 + (213,750 * 2)
= 1,402,500
This example illustrates that it is impossible to apply leverage on collateralised balances, even where a trade would repay debt. The maximum sell order that is possible on BTCZAR, in this case, is selling the available spot balance of 0.45 BTC, plus the collateralised balance of 1.5 BTC, plus applying leverage to the availableInReference of 0.45 BTC at mark price of 500,000 after applying collateral weighting of 0.95 (i.e. [0.45 * 500,000] + [1.5 * 500,000] +[0.45 * 500,000 * 0.95 * 2]).
Max that can be spent by borrowing BTC to sell for ZAR where there is existing ZAR debt
For an account holding BTC with no pre-existing debt, the account places a market order to buy bitcoin beyond its ZAR balance and therefore borrows ZAR.
Balances |
|||||
---|---|---|---|---|---|
Coin |
Balance |
Available |
Available in Reference |
Mark Price |
Weighting |
BTC |
1 |
1 |
475,000 |
500,000 |
0.95 |
ZAR |
0 |
0 |
0 |
1 |
1 |
Place market sell order with leverage:
"type": "PLACE_ORDER",
"data": {
"type": "MARKET",
"side": "BUY",
"quantity": "1",
"price": "0",
"pair": "BTCZAR",
"allowMargin": true
Resulting Balances |
|||||
---|---|---|---|---|---|
Coin |
Balance |
Available |
Available in Reference |
Mark Price |
Weighting |
BTC |
2 |
0.42105263 |
213,750 |
500,000 |
0.95 |
ZAR |
-500,000 |
0 |
0 |
1 |
1 |
Balances in reference:
Assets in reference weighted: |
950,000.00 |
Debt in reference: |
500,000.00 |
Equity in reference weighted: |
450,000.00 |
Margin calculations:
collateralisedMarginFraction: |
0.50000001 |
initialMarginFraction: |
0.50000000 |
totalBorrowedInReference: |
500000.00000000 |
collateralisedBalancesInReference: |
750000.00075000 |
referenceCurrency: |
ZAR |
initialRequiredInReference: |
750000.00000000 |
availableInReference: |
199999.99925000 |
maintenanceMarginFraction: |
0.1 |
autoCloseMarginFraction: |
0.03333333 |
marginFraction: |
0.90000000 |
LeverageMultiple: |
1.12 |
Placing a market sell order, including leverage where an account holds ZAR
For an account holding ZAR with no pre-existing debt, the account places a market order to sell bitcoin beyond its BTC balance and therefore borrows BTC.
Balances |
|||||
---|---|---|---|---|---|
Coin |
Balance |
Available |
Available in Reference |
Mark Price |
Weighting |
BTC |
0 |
0 |
0 |
400,000 |
0.95 |
ZAR |
600,000 |
600,000 |
600,000 |
1 |
1 |
Place market sell order with leverage:
"type": "PLACE_ORDER",
"data": {
"type": "MARKET",
"side": "SELL",
"quantity": "1",
"price": "0",
"pair": "BTCZAR",
"allowMargin": true
Resulting Balances |
|||||
---|---|---|---|---|---|
Coin |
Balance |
Available |
Available in Reference |
Mark Price |
Weighting |
BTC |
-1 |
0 |
0 |
400,000 |
0.95 |
ZAR |
1,000,000 |
0 |
0 |
1 |
1 |
Balances in reference:
Assets in reference weighted: |
1,000,000.00 |
Debt in reference: |
400,000.00 |
Equity in reference weighted: |
600,000.00 |
Margin calculations:
collateralisedMarginFraction: |
0.50000000 |
initialMarginFraction: |
0.50000000 |
totalBorrowedInReference: |
400000.00000000 |
collateralisedBalancesInReference: |
600000.00000000 |
referenceCurrency: |
ZAR |
initialRequiredInReference: |
600000.00000000 |
availableInReference: |
400000.00000000 |
maintenanceMarginFraction: |
0.1 |
autoCloseMarginFraction: |
0.03333333 |
marginFraction: |
1.50000000 |
LeverageMultiple: |
0.67 |
Placing a limit buy order, including leverage into the order book where an account holds BTC
For an account holding BTC with no pre-existing debt, the account places a limit order to buy bitcoin beyond its ZAR balance and therefore borrows ZAR. The order is added to the order book as it does not match any existing sell orders.
Balances |
|||||
---|---|---|---|---|---|
Coin |
Balance |
Available |
Available in Reference |
Mark Price |
Weighting |
BTC |
1 |
1 |
475,000 |
500,000 |
0.95 |
ZAR |
0 |
0 |
0 |
1 |
1 |
Place market sell order with leverage:
"type": "PLACE_ORDER",
"data": {
"type": "LMIT",
"side": "BUY",
"quantity": "1",
"price": "450000",
"pair": "BTCZAR",
"allowMargin": true
Resulting Balances |
|||||
---|---|---|---|---|---|
Coin |
Balance |
Available |
Available in Reference |
Mark Price |
Weighting |
BTC |
1 |
0.52631578 |
249999.9955 |
500,000 |
0.95 |
ZAR |
-450,000 |
0 |
0 |
1 |
1 |
Balances in reference:
Assets in reference weighted: |
925,000.00 |
Debt in reference: |
450,000.00 |
Equity in reference weighted: |
475,000.00 |
Margin calculations:
collateralisedMarginFraction: |
0.50000001 |
initialMarginFraction: |
0.50000000 |
totalBorrowedInReference: |
450000.00000000 |
collateralisedBalancesInReference: |
225000.00450000 |
referenceCurrency: |
ZAR |
initialRequiredInReference: |
675000.00000000 |
availableInReference: |
249999.99550000 |
maintenanceMarginFraction: |
0.1 |
autoCloseMarginFraction: |
0.03333333 |
marginFraction: |
1.05555556 |
LeverageMultiple: |
0.95 |
In this example, 450,000 has been borrowed in ZAR and is locked in an open order while the order remains in the order book. The collateralised balance includes the ZAR amount of 450,000 that has been borrowed along with an additional 0.47368422 BTC (= 225,000.0045 in equivalent ZAR after weighting).
Placing a limit sell order, including leverage into the order book where an account holds ZAR
For an account holding ZAR with no pre-existing debt, the account places a limit order to sell bitcoin beyond its BTC balance and therefore borrows BTC. The order is added to the order book as it does not match any existing buy orders.
Balances |
|||||
---|---|---|---|---|---|
Coin |
Balance |
Available |
Available in Reference |
Mark Price |
Weighting |
BTC |
0 |
0 |
0 |
400,000 |
0.95 |
ZAR |
600,000 |
600,000 |
600,000 |
1 |
1 |
Place market sell order with leverage:
"type": "PLACE_ORDER",
"data": {
"type": "LIMIT",
"side": "SELL",
"quantity": "1",
"price": "600000",
"pair": "BTCZAR",
"allowMargin": true
Resulting Balances |
|||||
---|---|---|---|---|---|
Coin |
Balance |
Available |
Available in Reference |
Mark Price |
Weighting |
BTC |
-1 |
0 |
0 |
400,000 |
0.95 |
ZAR |
600,000 |
220,000 |
220,000 |
1 |
1 |
Balances in reference:
Assets in reference weighted: |
980,000.00 |
Debt in reference: |
400,000.00 |
Equity in reference weighted: |
580,000.00 |
Margin calculations:
collateralisedMarginFraction: |
0.50000000 |
initialMarginFraction: |
0.50000000 |
totalBorrowedInReference: |
400000.00000000 |
collateralisedBalancesInReference: |
220000.00000000 |
referenceCurrency: |
ZAR |
initialRequiredInReference: |
600000.00000000 |
availableInReference: |
380000.00000000 |
maintenanceMarginFraction: |
0.1 |
autoCloseMarginFraction: |
0.03333333 |
marginFraction: |
1.45000000 |
LeverageMultiple: |
0.69 |
This list of examples is intended to serve as an illustrative FAQ. These examples will be updated and modified as needed based on customer feedback.
Thank you to all who contribute!