Providing liquidity for markets
Vega’s liquidity protocol is designed to incentivise a set of participants on each market to provide orders on the limit order book during continuous trading. Liquidity providers need to make a financial commitment and they will receive rewards for providing liquidity, and penalties for not upholding their commitment. Rewards are collected by the protocol from the market’s fees, paid by price takers, and distributed to liquidity providers of the market according to their relative contributions.
Liquidity in the market is not only desirable from a trader’s point of view, but it’s also an important consideration from a market’s risk-management standpoint. The position of a distressed trader can only be liquidated if there’s enough volume on the order book to offload it, otherwise a potentially insolvent party remains part of the market.
Since liquidity is such an important aspect of running healthy markets, Vega continuously calculates whether each market has a sufficient amount committed. When markets are deemed insufficiently liquid, they are placed into a liquidity monitoring auction.
Who can provide liquidity?
Any Vega participant with sufficient collateral can provide liquidity for a market by submitting a transaction to the network.
How to provide liquidity
The liquidity commitment transaction must include:
- Market identifier of the market, provided it is in a state that accepts liquidity provision
- Liquidity commitment amount
- Proposed liquidity fee level
- A set of liquidity buy and sell orders
The participant’s available collateral must be able to meet the size of the nominated commitment amount and the margins required to support the orders generated from that commitment.
The liquidity buy and sell orders use a special batch order type that automatically updates price/size as needed to meet the commitment, and automatically refreshes its volume after trading to ensure continuous liquidity provision.
See the API how-to guide on liquidity provision for detailed instructions on how to submit a liquidity provision transaction.
When can liquidity commitments be submitted?
Liquidity commitments may be submitted to a market as soon as the market is proposed and at any point up until the market enters a “trading terminated” state.
When markets are proposed on Vega, the proposer must include a valid liquidity commitment. The commitment amount must be no less than the
minimum_proposal_stake_amount per-asset network parameter. See the how to propose a market section for details.
How is the market’s liquidity requirement estimated?
The market’s liquidity requirement is derived from the maximum open interest observed over a rolling time window. This amount, called the target stake, is used by the protocol for calculating the market’s liquidity fee level from liquidity commitments, and triggering liquidity monitoring auctions if there’s an imbalance between target stake and total stake (sum of all liquidity commitments).
How is the market’s liquidity fee level set?
The liquidity fee is one of the components of the total taker fee that a price taker of a trade pays:
total_fee = infrastructure_fee + maker_fee + liquidity_fee
As part of the liquidity commitment transaction, the liquidity provider submits their desired level for the liquidity fee for the market. All the fees (along with the associated commitment amounts) get sorted from smallest to largest fee level. The resulting liquidity fee level is the minimum fee level that allows a market to reach its target stake. Please note that there’s a network parameter (
maximum-liquidity-fee-factor-level) governing the maximum liquidity fee factor that can be submitted.
[LP 1 stake = 120 ETH, LP 1 liquidity-fee-factor = 0.5%] [LP 2 stake = 20 ETH, LP 2 liquidity-fee-factor = 0.75%] [LP 3 stake = 60 ETH, LP 3 liquidity-fee-factor = 3.75%]
- If the
target stake = 119then the needed liquidity is given by LP 1, thus
k=1and so the market’s liquidity-fee-factor is
LP 1 fee = 0.5%.
- If the
target stake = 123then the needed liquidity is given by LP 1 and LP 2, thus
k=2and so the market’s liquidity-fee-factor is
LP 2 fee = 0.75%.
- If the
target stake = 190then putting the liquidity supplied by LP 1 and LP 2 does not meet the estimated market liquidity demand and thus we set
k=Nand so the market’s liquidity-fee-factor is
LP N fee = LP 3 fee = 3.75%.
- Initially (before market opens) the
target stakeis by definition zero (it’s not possible to have a position on a market that’s not opened yet). Hence by default the market’s initial liquidity-fee-factor is the lowest liquidity-fee-factor.
How do liquidity fees get distributed among the liquidity providers?
The liquidity fees that are accumulated get distributed periodically (driven by the
market.liquidity.providers.fee.distributionTimeStep network parameter) to all the liquidity providers active in the last period.
The accumulated sum gets split proportionally to each liquidity provider’s commitment amount and the ratio of the current value of the market and value at the time the given liquidity provider (successfully) submitted their liquidity commitment transaction.
How is liquidity obligation calculated?
The liquidity obligation is calculated from the liquidity commitment amount using the
stake_to_ccy_siskas network parameter as:
liquidity_obligation_in_ccy_siskas = stake_to_ccy_siskas ⨉ liquidity_commitment
ccy stands for ‘currency’. Liquidity measure units are ‘currency siskas’, e.g. ETH or USD siskas. This is because the calculation is basically
volume ⨉ probability of trading ⨉ price of the volume and the price of the volume is in the said currency.
Liquidity obligation is considered to be met when the
volume ⨉ probability of trading ⨉ price of orders of all liquidity providers per each order book side measured separately is at least
Liquidity providers are not required to supply any orders that offer liquidity or trade during an auction uncrossing. They must maintain their stake however and their liquidity orders will be placed back on the book when normal trading resumes.
How do liquidity orders help to maintain the liquidity obligation?
While liquidity providers can supply their liquidity by manually maintaining orders, they are also required to submit liquidity buy and sell orders as part of their liquidity commitment transaction. These orders are used to make up the remainder of the liquidity obligation if the liquidity supplied by the manually maintained orders falls short of it.
Liquidity orders are essentially sets of pegged orders grouped by order book side with a proportion of required volume specified for each order. Hence they are sometimes referred to as ‘shapes’, since the overall volume depends on the remaining liquidity obligation and the mid-price along with the risk model parameters, but the sizes of orders relative to each other can still be controlled.
What is the liquidity provider bond account?
The liquidity provider bond account is a dedicated account (one per party per market) used to store the amount committed during the liquidity provision transaction. The deposits and withdrawals for the account are governed by the protocol and cannot be manually triggered. The funds will be deposited as part of the successful liquidity commitment transaction. They will remain there for as long as the liquidity provider is active, to act as a guarantee for the liquidity obligation taken on by the provider, to assure that the commitment is firm and the protocol can rely on that liquidity in any market conditions.
How can a liquidity commitment be modified or cancelled?
An existing liquidity provider can modify a liquidity commitment by submitting another liquidity commitment transaction, which in this case acts as an amendment.
While the commitment amount can always be increased – as long as the entire transaction amending it is valid – it can only be decreased if the resulting total stake for the market meets its target stake.
A liquidity commitment can be ‘cancelled’ by submitting another transaction with a commitment of 0, but, as with decreasing a commitment, it can only be cancelled if the resulting total stake for the market meets its target stake.
What happens when a liquidity provider fails to fulfil the obligation?
As mentioned above the liquidity orders specified in the liquidity commitment transaction will get automatically deployed if other orders by the liquidity provider fail to meet the obligation.
If the liquidity provider’s margin account doesn’t have enough funds to support those orders, the protocol will search for funds in the general account for the appropriate asset. If even the general account doesn’t have sufficient amount to provide margin to support the orders, then the protocol will transfer the remaining funds from the bond account, and a penalty will be applied and transferred from the bond account to the market’s insurance pool. The liquidity obligation will remain unchanged and the protocol will periodically search the liquidity provider’s general account for the appropriate asset and attempt to top up bond account to the amount specified in liquidity commitment. Should the funds in the bond account eventually drop to 0 as a result of a collateral search, the liquidity provider will be marked for closeout and the liquidity provision will get removed from the market. If there’s an imbalance between total and target stake as a result, the market will go into liquidity auction as a consequence.