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?
Balances:
Coin |
Balance | Available |
Available in Reference |
Mark Price | Weighting |
BTC | 1 BTC | 1 BTC | 19,000 USDC | 20,000 USDC | 0.95 |
ZAR | 0 | 0 | 0 | 20 ZAR | 1 |
Calculation: spot available balance to spend in reference + (available in reference * 2)
= 0 + (19,000 * 2)
= 38,000 USDC
Then, we convert this to the currency that will be spent at mark price:
Calculation: available in reference * mark price
= 38,000 * 20
= 760,000 ZAR
Please remember that available in reference is calculated after weighting is applied. Spot BTC is worth 20,000 USDC in this example, but as collateral, it is only worth 19,000 USDC.
Max that can be spent by borrowing BTC to sell for ZAR 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 sell order on BTCZAR?
Balances:
Coin |
Balance | Available |
Available in Reference |
Mark Price | Weighting |
BTC | 0 | 0 | 0 | 20,000 USDC | 0.95 |
ZAR | 200,000 ZAR | 200,000 ZAR | 10,000 USDC | 20 ZAR | 1 |
Calculation: spot available balance to spend in reference + (available in reference * 2)
= 0 + (10,000 * 2)
= 20,000 USDC
Then, we convert this to the currency that will be spent at mark price:
Calculation: available in reference * mark price
= 20,000 / 20,000
= 1 BTC
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 | 20,000 USDC | 0.95 |
ZAR | 300,000 ZAR | 300,000 ZAR | 15,000 USDC | 20 ZAR | 1 |
Calculation: spot available balance to spend in reference + (available in reference * 2)
= 15,000 + (15,000 * 2)
= 45,000 USDC
Then, we convert this to the currency that will be spent at mark price:
Calculation: available in reference * mark price
= 45,000 * 20
= 900,000 ZAR
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 BTC | 0.5 BTC | 9,500 USDC | 20,000 USDC | 0.95 |
ZAR | 0 | 0 | 0 | 20 ZAR | 1 |
Calculation: spot available balance in reference + (available in reference * 2)
= 9,500 + (9,500 * 2)
= 28,500 USDC
Then, we convert this to the currency that will be spent at mark price:
Calculation: available in reference * mark price
= 28,500 / 20,000
= 1.425 BTC
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 based on new balances.
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 BTC | 0.075 BTC | 1,425 USDC | 20,000 USDC | 0.95 |
ZAR | -475,000 ZAR | 0 | 0 | 20 ZAR | 1 |
Margin calculations:
collateralisedMarginFraction: |
0.50 |
initialMarginFraction: |
0.50 |
totalBorrowedInReference: |
23750.00 |
collateralisedBalancesInReference: |
35625.00 |
referenceCurrency: |
USDC |
initialRequiredInReference: |
35625.00 |
availableInReference: |
1425.00 |
maintenanceMarginFraction: |
0.1 |
autoCloseMarginFraction: |
0.03333333 |
marginFraction: |
0.56000000 |
LeverageMultiple: |
1.79 |
Calculation: spot available balance in reference + (available in reference * 2)
= 0 + (1,425 * 2)
= 2,850 USDC
Then, we convert this to the currency that will be spent at mark price:
Calculation: available in reference * mark price
= 2,850 * 20
= 57,000 ZAR
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 BTC | 0.075 BTC | 1,425 USDC | 20,000 USDC | 0.95 |
ZAR | -475,000 ZAR | 0 | 0 | 20 ZAR | 1 |
Margin calculations:
collateralisedMarginFraction: |
0.50 |
initialMarginFraction: |
0.50 |
totalBorrowedInReference: |
23750.00 |
collateralisedBalancesInReference: |
35625.00 |
referenceCurrency: |
USDC |
initialRequiredInReference: |
35625.00 |
availableInReference: |
1425.00 |
maintenanceMarginFraction: |
0.1 |
autoCloseMarginFraction: |
0.03333333 |
marginFraction: |
0.56000000 |
LeverageMultiple: |
1.79 |
Calculation: total spot balance in reference + (available in reference * 2)
= 1.95 * 20,000 + (1,425 * 2)
= 41,850 USDC
Then, we convert this to the currency that will be spent at mark price:
Calculation: available in reference * mark price
= 41,850 * 20
= 837,000 ZAR
This example illustrates that it is not possible 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.075 BTC, plus the collateralised balance of 1.875 BTC, plus applying leverage to the available in reference of 0.075 BTC at mark price of 20,000 after applying collateral weighting of 0.95 (i.e. [0.075 * 20,000] + [1.875 * 20,000] +[0.075 * 20,000 * 0.95 * 2]).
Max that can be spent by borrowing ZAR to buy BTC where the account holds BTC
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 BTC | 1 BTC | 19,000 USDC | 20,000 | 0.95 |
ZAR | 0 | 0 | 0 | 20 ZAR | 1 |
Place market buy order with leverage where the order is matched at a price of 400,000 ZAR per BTC:
"type": "PLACE_ORDER",
"data": {
"type": "MARKET",
"side": "BUY",
"quantity": "1",
"price": "0",
"pair": "BTCZAR",
"allowMargin": true
Resulting Balance:
Coin |
Balance | Available |
Available in Reference |
Mark Price | Weighting |
BTC | 2 BTC | 0.42105263 | 8,000 USDC | 20,000 | 0.95 |
ZAR | -400,000 ZAR | 0 | 0 | 20 ZAR | 1 |
Balances in reference:
Assets in reference weighted: |
38,000.00 USDC |
Debt in reference: |
20,000.00 USDC |
Equity in reference weighted: |
18,000.00 USDC |
Margin calculations:
collateralisedMarginFraction: |
0.50 |
initialMarginFraction: |
0.50 |
totalBorrowedInReference: |
20000.00 |
collateralisedBalancesInReference: |
30000.00 |
referenceCurrency: |
USDC |
initialRequiredInReference: |
30000.00 |
availableInReference: |
8000.00 |
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 | 20,000 USDC | 0.95 |
ZAR | 600,000 ZAR | 600,000 ZAR | 30,000 USDC | 20 ZAR | 1 |
Place market sell order with leverage where the order is matched at a price of 400,000 ZAR per BTC:
"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 BTC | 0 | 0 | 20,000 USDC | 0.95 |
ZAR | 1,000,000 ZAR | 400,000 ZAR | 20,000 USDC | 20 ZAR | 1 |
Balances in reference:
Assets in reference weighted: |
50,000.00 USDC |
Debt in reference: |
20,000.00 USDC |
Equity in reference weighted: |
30,000.00 USDC |
Margin calculations:
collateralisedMarginFraction: |
0.50 |
initialMarginFraction: |
0.50 |
totalBorrowedInReference: |
20000.00 |
collateralisedBalancesInReference: |
30000.00 |
referenceCurrency: |
USDC |
initialRequiredInReference: |
30000.00 |
availableInReference: |
20000.00 |
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 BTC | 1 BTC | 19,000 USDC | 20,000 USDC | 0.95 |
ZAR | 0 | 0 | 0 | 20 ZAR | 1 |
Place limit buy order with leverage where the order is placed into the book at a price of 400,000 ZAR per BTC:
"type": "PLACE_ORDER",
"data": {
"type": "LMIT",
"side": "BUY",
"quantity": "1",
"price": "400000",
"pair": "BTCZAR",
"allowMargin": true
Resulting Balances:
Coin |
Balance | Available |
Available in Reference |
Mark Price | Weighting |
BTC | 1 BTC | 0.47368421 BTC | 8,999.99 USDC | 20,000 USDC | 0.95 |
ZAR | -400,000 ZAR | 0 | 0 | 20 ZAR | 1 |
Balances in reference:
Assets in reference weighted: |
39,000.00 USDC |
Debt in reference: |
20,000.00 USDC |
Equity in reference weighted: |
19,000.00 USDC |
Margin calculations:
collateralisedMarginFraction: |
0.50 |
initialMarginFraction: |
0.50 |
totalBorrowedInReference: |
20000.00 |
collateralisedBalancesInReference: |
10000.00001 |
referenceCurrency: |
USDC |
initialRequiredInReference: |
30000.00 |
availableInReference: |
8999.99999 |
maintenanceMarginFraction: |
0.1 |
autoCloseMarginFraction: |
0.03333333 |
marginFraction: |
0.95000000 |
LeverageMultiple: |
1.06 |
In this example, 400,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 400,000 that has been borrowed along with an additional 0.47368421 BTC (= 10,000 USDC 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 | 20,000 USDC | 0.95 |
ZAR | 600,000 ZAR | 600,000 ZAR | 30,000 USDC | 20 ZAR | 1 |
Place limit 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 | 380,000 | 19,000 USDC | 1 | 1 |
Balances in reference:
Assets in reference weighted: |
49,000.00 USDC |
Debt in reference: |
20,000.00 USDC |
Equity in reference weighted: |
29,000.00 USDC |
Margin calculations:
collateralisedMarginFraction: |
0.50 |
initialMarginFraction: |
0.50 |
totalBorrowedInReference: |
20000.00 |
collateralisedBalancesInReference: |
11000.00 |
referenceCurrency: |
USDC |
initialRequiredInReference: |
30000.00 |
availableInReference: |
19000.00 |
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!