We’ve built a leveraged trading engine that allows one party to lend assets and another to borrow for the purposes of spot trading on our order books. This is a fully collateralised system that does not employ derivatives trading, but rather the lending and borrowing of real balances. Depending on the borrowing and lending entity, this may be regulated by the National Credit Regulator of South Africa (NCR).
For a set of practical margin trade examples, please refer here: Margin trading Examples
Summary
Leveraged trading on VALR is available to all customers in qualifying jurisdictions. The only limitation relates to the ability to borrow ZAR currency, which is currently only available to business accounts that meet certain criteria related to annual revenue and/or size of balance sheet.
A specific sub-account with leveraged trading enabled is cross-collateralised (Cross margin), meaning that all assets within that sub-account with a collateral weighting greater than zero can be called upon to settle debts in the event of liquidation (more on this below). Leverage trading enabled accounts will be able to trade to max 5x leverage (for the avoidance of doubt this max means 5x debt for 1x equity). Interest is charged on debt balances hourly and interest rates are visible on the VALR exchange screen.
Margin requirements are as follows:
- Initial - 20%
- Maintenance - 10%
- Auto-close - 3%
Should an account fall below maintenance margin, stage 1 liquidation is triggered. Our liquidation engine is designed to bring an account below maintenance margin back to a healthy state, measured as recovering to above maintenance margin. The liquidation engine aims to carefully close down positions in the market while minimizing market impact and keeping markets orderly. To achieve this goal, debt balances are sold piecemeal until the account is back above maintenance margin.
Stage 2 liquidation is triggered if an account falls below auto-close margin. In stage 2, an accounts debt and assets are transferred to an insurance fund in full, with the immediate effect of a customer losing their entire equity on their leveraged position.
Glossary of terms
- Account assets (positive balances) - the total balance of assets held in a VALR sub-account, including any assets that have been purchased using borrowed funds
- Account debt (negative balances) - the total balance of borrowed funds in a VALR sub-account
- Account equity - the net balance in a VALR sub-account once debt is deducted from assets
- Account margin fraction - account equity in reference (weighted) divided by account debt in reference
- Auto-close margin fraction - account margin fraction below which an account’s debt and assets are transferred to the insurance fund, leaving the account with no further assets, debt or equity
- Balance in reference - the value of a balance converted to an equivalent reference value based on the mark price and collateral weighting
- Collateral - the sum of account equity that can be reserved to borrow funds and the total value of funds borrowed for open orders / received for completed leveraged orders
- Collateral weighting - a haircut applied to the value of an asset
- Cross margin - a margin system where all the assets in an account that have a collateral weighting greater than 0 count towards collateral and are ultimately at risk of liquidation as the account debt approaches the same value as the account assets
- Free collateral - the value of account balances in reference that are not currently reserved to collateralise existing debt
- Initial margin - percentage of the order total that is required and will be reserved in account equity to take on a debt position
- Insurance fund - a fund set up by VALR which can take on the debt and assets to close a margin position without impacting the order book and which can cover any losses incurred by positions that may have otherwise gone into a negative equity position
- Isolated margin - a margin system where only the initial margin for a leveraged trade is at risk of liquidation
- Leverage - a multiplier that can be used to calculate the maximum amount that can be borrowed against account equity
- Leverage multiple - account debt in reference / account equity in reference (weighted)
- Liquidation - the act of selling off account assets to repay account debt
- Maintenance margin - account margin fraction below which an account will enter liquidation
- Margin - a fraction that can be applied to an amount borrowed to calculate the amount of account equity required to collateralise that debt
- Margin fraction - account equity in reference (weighted) / account debt in reference
- Mark price – a market price used to calculate the balance in the reference currency (currently USDC), calculated using an index of prices from liquid exchanges. Mark price is updated every 5 seconds.
- Max leverage – the maximum multiplier on weighted account equity that can be borrowed in another asset
We note that the glossary above may differ from the definitions contained in the Margin Terms of Service due to the simplified nature of the glossary. In the event of any discrepancies, please rely on the definitions contained in the Margin Terms of Service.
Introduction
What is leveraged trading?
Leveraged trading involves borrowing money against account equity that you hold and using the borrowed money to trade. Using leveraged trading allows traders to trade beyond their account balance to go long or short on an asset while also creating the risk that the customer may be liquidated if their position moves against them.
How does leveraged trading work on VALR?
When you collateralize account equity and borrow funds against it, you can use borrowed funds for trading on VALR.
Example: Let's consider the price of bitcoin is USDC 20,000, and USDCZAR is trading at ZAR 20 to USDC 1. Let’s say that your VALR account looks like this:
Balances:
Coin |
Balance | Available |
Balance in Reference |
Mark Price |
BTC | 1 BTC | 1 BTC | 20,000 USDC | 20,000 USDC |
ZAR | 0 | 0 | 0 | 20 ZAR |
I will borrow R800,000 and use that ZAR to buy more bitcoin on the BTCZAR pair. The logical steps in this process are:
- Borrow 800,000 ZAR against my bitcoin as Collateral; and
- Use the 800,000 ZAR borrowed to buy bitcoin; let’s assume this happens at a price of 400,000 ZAR per BTC, and fees are 0.
On VALR, we combine steps 1 and 2 automatically. Customers will simply be able to spend beyond their account balance to either buy or sell within certain parameters.
Your account will look as follow after the trade is executed
Coin |
Balance | Available |
Balance in Reference |
Mark Price |
BTC | 3 BTC | 0 BTC | 60,000 USDC | 20,000 USDC |
ZAR | -800,000 ZAR | 0 | -40,000 USDC | 20 ZAR |
A few questions come to mind given this example:
- Why can I borrow 800,000 ZAR when my assets are only worth 20,000 USDC?
- Why has the available balance in BTC gone from 1 to 0?
- What will happen if the bitcoin price drops significantly and my BTC is worth less than the 800,000 ZAR debt?
Q1 - Why can I borrow 800,000 ZAR?
You can borrow an amount larger than your account equity for trading purposes because we collateralise the full debt and account equity equal to the initial margin requirement.
On VALR, account equity can be used as collateral. You can borrow some value in another currency against the equity held in a VALR account that is not otherwise reserved (for trade or existing debt).
Which assets can be used as collateral? Only certain assets are allowed as collateral, and every asset held in an account has some collateral weighting which defines precisely how much it contributes to collateral. For example, ZAR will have a collateral weighting of 1, such that if an account has 100,000 ZAR, there is 100,000 * 1 / 20 = 5,000 USDC in available collateral.
To extend the example, BTC has a collateral weighting of 0.95. This means that if an account has a balance in BTC equal to 5,000 USDC, that will be weighted to 4,750 USDC and has a lower value as collateral than its spot value in your portfolio. Balances that do not count towards collateral have a weighting of zero. These balances will not be called upon in the event of liquidation; it is as if they do not exist when liquidation is in effect.
The value of equity, assets and debt is converted to a reference currency to calculate how much is available to borrow and to calculate account leverage.
Tying this back to our examples above, if I have a balance of 100,000 ZAR in my VALR account, I can borrow a maximum of 25,000 USDC (100,000 * 5 * 1 / 20) worth of an asset to trade.
Q2 - Why does my available balance decrease after borrowing?
This is how we limit the funds that an account can borrow. If you borrow the maximum for trade purposes, your available balance will be zero, and you won’t be able to trade further if the trade would lead to further debt. Importantly, you can still trade, but only if the trade reduces debt rather than increases debt. In the example above, you could place an order (either limit or market) to sell bitcoin for ZAR because that trade would reduce the ZAR debt.
Q3 - Closing down positions that get into trouble.
If the price of bitcoin drops in this example, there is an increasing risk that the value of assets collateralized in the account will not be able to cover the debt. Below a specific price, it will become necessary to sell BTC back into ZAR to cover all or part of the 800,000 ZAR debt. More on this below under the liquidation section.
Leverage, Collateral, Liquidation and Interest
How we define leverage.
On VALR, leverage is measured based on the total amount that can be borrowed. To illustrate with an example, say you have an account with a balance of 1 BTC and nothing else.
With maximum Leverage of 5x, an account can borrow a maximum to buy a further 5 BTC against collateral for a total exposure of 6 BTC (ignoring collateral weightings). Here you have an equity balance of 1 BTC and debt equal to 5x your collateralised equity balance.
Put another way; an account can borrow funds equal to 5x the equity balance held in a VALR account.
Applying collateral weightings.
To calculate the collateral in a sub-account, all currencies are converted at a mark price and multiplied by collateral weighting.
The list of assets that can be used for margin, along with their collateral weightings, can be found here.
These weightings can also be queried via the currencies endpoint on our API: https://api.valr.com/v1/public/currencies.
Isolating margin to a sub-account.
Margin is limited to the particular sub-account that is being used for trading with leverage. The equity in a different sub-account or the main account cannot be applied to cover a debt in the sub-account that has a debt. This allows for flexibility in deciding when to isolate your borrowing activity to a specific amount of capital.
Measuring leverage.
The leverage multiple or margin fraction of an account with debt is dynamic and will change based on movements in the mark price of collateral assets and the debt. So how do we keep track of an account's current leverage, max leverage and funds reserved for leverage?
- Collateral assets in reference = the weighted balances in USDC of all assets held in a VALR account that count as collateral. Assets with a 0 collateral weighting will have a 0 contribution to collateral assets in reference. Assets with a weighting of 0 will not be sold to cover debt nor liquidated in the event of auto-close.
- Total borrowed in reference = the balance of all debt converted to USDC in a VALR account. This is not weighted and represents the current value of all debt in USDC currency so that the balance can be compared easily with collateralised balance in reference.
- Collateralised margin fraction = (#1 - #2) / #2. This represents risk for the account and is a measure for cases where account assets might need to be sold to cover debt. The margin fraction can also be considered your equity-to-debt ratio as a percentage.
When thinking about the above measures of leverage it is important to keep in mind some important thresholds:
- Initial margin fraction = the initial amount of equity required to place an order divided by the total size of the debt if that order will borrow funds. This equals 20% for an account with a max of 5x leverage because you require 1 part equity to 5 parts of debt.
- Maintenance margin fraction = the % margin fraction below which your account is at risk of liquidation. This is set to 10%.
- Auto-close margin fraction = the % margin fraction below which your account will be closed out through our insurance fund. The entire position will be liquidated, leading to a loss of any excess equity for that particular account. This is set to 3%.
We use the above measures to keep track of an account’s leverage over time and to initiate liquidation when necessary.
VALR’s margin engine measures balances based on assets actually held.
VALR’s margin engine constantly evaluates the amount that can be borrowed based on the assets actually held in an account.
Our margin engine makes no assumptions regarding what assets will be held in an account after an order has been matched. This means that when placing orders, please keep in mind that the value of the collateral is based on assets actually held and that when orders match and the mix of assets in the account changes, the value of collateral in a new currency will be re-evaluated.
The implication is that collateral weighting might change depending on order matching.
Placing orders with leverage.
Both market and limit orders (matched or open) are available with leverage.
To place orders with leverage via the API, please add "allowMargin": true to your orders. For users of our website and app, there is a tick box to allow leverage on the exchange screen that must be selected for orders to allow funds to be borrowed.
When an open order is placed which would require borrowed funds (i.e., debt) if fulfilled, the borrowed funds are deemed to have been borrowed when the open order is placed. When customers place open orders into the order book, they’ll be charged interest on the value of funds borrowed to place that order when the interest engine is live, regardless of whether the order is filled.
Debt limits
Limits are placed on the total amount that can be borrowed for an account, as well as limits per currency. The full list of limits can be found here.
Repayment of debt
Where an account has a debt position, measured as a negative balance in a currency, there are two options for repayment of that debt:
- Transfer funds in that same currency into the account, which will automatically offset the negative balance and repay the debt; and/or
- Place an order that would repay debt. Any order that results in receiving the same currency in which a negative balance is held will automatically repay debt.
Our leverage engine will allow orders to repay a debt even where an account is above max leverage and where total balances are collateralised to secure the debt position. Both market and limit orders will be allowed if they repay a debt, whether matching or placed into the order book.
Placing orders that repay debt and borrow in the opposite direction.
Orders that would repay debt and borrow funds in the opposite direction in a single order are possible only to the extent of the free collateral in the account. If an account has a margin fraction below initial margin fraction, it will not be possible to repay debt and borrow in a single transaction.
Leverage information via API
Additional fields have been added to the VALR API, which measures information for leverage-enabled accounts, accessed at https://api.valr.com/v1/margin/status.
These fields include the following:
- initialMarginFraction - the initial margin fraction required to place an order;
- totalBorrowedInReference - the total value of funds borrowed converted to reference currency;
- collateralisedBalancesInReference - the total value of balances reserved as collateral, converted to reference currency and weighted according to collateral weighting;
- referenceCurrency - a single currency into which all balances are converted;
- initialRequiredInReference - the value of initial margin required in reference;
- availableInReference - the value of free collateral in reference weighted;
- maintenanceMarginFraction - the maintenance margin fraction below which stage 1 liquidation is triggered;
- autoCloseMarginFraction - the auto-close margin fraction below which stage 2 liquidation is triggered;
- leverageMultiple - the inverse of margin fraction (which can also be thought of as the debt-to-equity ratio);
- availableToBorrowInReference - the maximum value available to borrow in reference currency after weighting collateral balances;
- marginFraction - the current margin fraction of the account
- collateralisedMarginFraction - the current margin fraction of the account, considering reserved balances only (i.e. excluding available balances)
Below is an example of an account with no leverage positions:
{
"initialMarginFraction":"0.5",
"totalBorrowedInReference":"0",
"collateralisedBalancesInReference":"0",
"referenceCurrency":"USDC",
"initialRequiredInReference":"0",
"availableInReference":"500"
}
And here’s an example of an account with a leverage position:
{
"collateralisedMarginFraction":"0.41549511",
"initialMarginFraction":"0.5",
"totalBorrowedInReference":"339.984006869",
"collateralisedBalancesInReference":"481.2456962620125",
"referenceCurrency":"USDC",
"initialRequiredInReference":"509.9760103035",
"availableInReference":"0",
"maintenanceMarginFraction":"0.1",
"autoCloseMarginFraction":"0.033333333",
"leverageMultiple":2.41
"marginFraction":"0.41549511",
}
Liquidation
When an account falls below its maintenance margin, the value of its equity has dropped far enough that the risk that assets in the account won’t cover all of the debt is beyond acceptable limits.
VALR aims to liquidate accounts well before there is a risk of permanent loss. We achieve this by gradually selling off assets when the account falls below maintenance margin.
The Liquidation process is set up in distinct stages that aim to keep an account above maintenance margin for as long as possible, reducing the impact of liquidation orders on order books and allowing customers the opportunity to take action to repay debt.
All liquidation orders placed during the first stage (i.e. below maintenance but above auto-close, and whether matched or not) will be visible as orders of the type "liquidation limit order" on the particular account in question.
Similarly, for auto-close, the transfer of debt and assets out of the account will be visible on transaction history records as "liquidation takeover debt transfer" and "liquidation takeover asset transfer" respectively.
We don't currently push any notification for margin levels when at risk of liquidation. This is something that we will consider in the future.
Up-to-date margin information is available in real-time from both the UI and the VALR API. This is the source of truth for how healthy your account is when using leverage. VALR sends margin call notifications via email and push notification when margin fraction is within 10% of liquidation.
Stage 1: Account falls below maintenance margin
If an account falls below maintenance margin, the account is now in liquidation. During liquidation, the account holder cannot place or cancel orders and VALR’s liquidation engine is now in control of the account. The following process is followed in this situation:
- All open orders for the account are cancelled in full;
Check whether the account is now above maintenance margin;
If no, proceed to (b)
- Calculate 10% of the value of open perp positions and 10% of total spot debt.
- Place an immediate or cancel (IOC) order on each perp positions for 10% of exposure, 3% deep into the book.
- Place an IOC order for 10% of the total spot debt value between the largest debt and highest liquidation priority collateral asset (see below for priority list), 3% deep from the same side of the order book. In the event that there are multiple debt currencies and multiple collateral assets, the liquidation engine will prioritize placing orders by size of debt currency against the highest priority collateral asset. If the collateral currency balance is less than the 10% amount, the engine will move onto the next eligible collateral currency against the largest debt again. The process of moving down the list of collateral currencies against the debt continues until orders are placed for the total 10% of account spot debt. In the event that there is no direct pair between the debt and collateral currencies, collateral will be converted into USDT and then from USDT into the debt currency.
- All order sizes are bound in USDC to min 0.3 on perps and to pair minimum base/quote values on spot. Maximum order size is 15000.
Check whether the account is now above maintenance margin;
If not, repeat step (b) until the account is above maintenance margin.
Collateral currency liquidation priority | |
1 | USDT |
2 | ZAR |
3 | BTC |
4 | USDC |
5 | ETH |
6 | XRP |
7 | SOL |
8 | AVAX |
9 | BNB |
10 | DOGE |
11 | SHIB |
12 | TRX |
13 | WIF |
14 | TRUMP |
Stage 2: Account falls below auto-close margin
If the value of assets in an account falls even further, to the point that the risk of assets not covering debt is significantly increased, then stage 2 liquidation takes over to fully close the account's debt.
- Debts of the account are transferred to the insurance fund, which settles the debt against assets held in the fund;
-
Assets of the account with a collateral weighting > 0 are transferred to the insurance fund.
Fees and Interest
No change is made to the fee structure for trading assets using leverage.
Every hour, lenders are paid, and borrowers are charged interest. Interest rates are determined as follows:
- All lenders specify a minimum borrowing rate they must receive for that hour.
- At the beginning of the hour, we calculate the total borrow demand for each coin between all users.
- We have an auction: we sort the lending offers by minimum rate and take the cheapest set that satisfies the borrowing demand. The borrowing rate is set to the minimum of the required marginal (most expensive) loan.
- Alice: wants to borrow 2 BTC
- Bob: wants to borrow 3 BTC
- Charlie: lending 1 BTC, min 0.01%
- Denise: lending 10 BTC, min 0.03%
- Total borrow demand is 5 BTC.
- This borrows all of Charlie’s BTC and 4 BTC from Denise
- The marginal loan is Denise's 4 BTC loaned out at 0.03% minimum
- So all 5 BTC of debt -- including the one against Charlie -- use an interest rate of 0.03%
So this means the following:
- All borrow rates only last for one hour; each hour, they’re re-determined.
- Every borrower pays the same rate for an hour/coin; every lender whose funds are actually locked for a loan receives the same interest rate for an hour/coin. Important to note that if funds are not locked for an actual debt on the other side, then no interest is paid.
- When you open up a borrow mid-hour, you end up paying for that hour’s interest rate at the end of the hour during the next auction.
Interest Rate Information
Interest rates for margin-enabled currencies can be viewed by querying a REST endpoint via the VALR API:
https://api.valr.com/v1/loans/rates (authentication is required)
For each currency, the API returns the following:
- previousFundingRate - The rate paid to lenders at the last interest auction
- estimatedNextRate - the expected rate that is to be paid to lenders at the next interest auction, which is dynamic and based on the level of demand to borrow a particular currency as well as the supply of loans to the loan book
- estimatedNextBorrowRate - the expected rate that is to be charged to borrowers at the next interest auction
It is important to note that the purpose of this document is to explain in simple terms how VALR’s leveraged trading services work operationally. This document does not create any obligations between yourself and VALR and is not to be relied on from a legal standpoint. VALR’s Terms of Service govern your use of VALR’s leveraged trading, the Margin Terms of Service, your Credit Agreement (if applicable and as defined in the Margin Terms of Service) and any other policy and agreement between yourself and VALR. Please refer to the above-mentioned documents for your legal obligations regarding these services.