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. 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, which are 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’s unique ID (Confirm it’s in a state that accepts liquidity commitments)
  • Liquidity commitment amount: How much of your collateral you are setting aside as a commitment bond
  • Proposed liquidity fee level
  • A set of liquidity buy and sell order shapes, which include:
    • Offset: How many ticks away from the reference price you want your orders to be. The tick size is the smallest decimal place the market allows for orders. There is a trade-off between larger offsets, which have higher margin cost but less position risk, versus smaller offsets, which have lower margin cost but more position risk.
    • Proportion: The proportion of your committed collateral allocated to this order
    • Reference price: The price that you want the order offset to reference. You can choose from the market’s mid price, best bid price, or the best ask price

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. Read more about margin.

Example:

A provider plans to commit the approximate equivalent of 1 million USD to a liquidity commitment: If their position risk is low (larger offsets) then about 5-10% can be reserved for the bond. If their position risk is higher (smaller offsets), and a provider manages their positions and margin carefully, the provider would need to commit more to the bond.

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).

The target stake is set in a market proposal, but if left blank it defaults to the amount in the network parameter market.liquidity.targetstake.triggering.ratio.

How is the market’s liquidity fee level set?

The liquidity fee is one of the components of the total 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.

There’s a network parameter (maximum-liquidity-fee-factor-level) governing the maximum liquidity fee factor that can be submitted.

Fee example

In the example below, there are 3 liquidity providers all bidding for their chosen fee level.

The LP orders they submit are sorted into increasing fee order so that the lowest fee bid is at the top and the highest is at the bottom. The fee level chosen for the market is derived from the liquidity commitment of the market (target stake) and the amount of stake committed from each bidder.

Vega processes the LP orders from top to bottom by adding up the commitment stake as it goes until it reaches a level greater than or equal to the target stake. When that point is reached the fee used is the fee of the last liquidity order processed.

[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%]
  1. If the target stake = 119 then the needed liquidity is given by LP 1, thus k=1 and so the market’s liquidity-fee-factor is LP 1 fee = 0.5%.
  2. If the target stake = 123 then the needed liquidity is given by LP 1 and LP 2, thus k=2 and so the market’s liquidity-fee-factor is LP 2 fee = 0.75%.
  3. If the target stake = 190 then putting the liquidity supplied by LP 1 and LP 2 does not meet the estimated market liquidity demand and thus we set k=N and so the market’s liquidity-fee-factor is LP N fee = LP 3 fee = 3.75%.
  4. Initially (before market opens) the target stake is 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 amount gets split based on the proportion of each liquidity provider’s commitment amount, as well as the ratio of the current value of the market and value at the time the liquidity provider (successfully) submitted their liquidity commitment transaction.

A liquidity provider that starts providing early in a market’s lifecycle will benefit from helping to grow the market, also known as an ‘equity-like share’. Early providers will receive a larger proportion of the fees as the market gets more liquidity and liquidity providers, than their actual commitment would imply. This is because they were a larger proportion of the commitment earlier on, and provided liquidity when the market needed it most.

How is the 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

Note here 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_obligation_in_ccy_siskas.

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 function in a similar way to pegged orders grouped by order book side with a proportion of required volume specified for each order. Hence they are 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 an amend liquidity commitment transaction.

See the how-to guide for amending a liquidity commitment.

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 a liquidity cancellation transaction.

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 allocated margin doesn’t have enough funds to support those orders, the protocol will search for funds in the liquidity provider’s general account.

If the general account also doesn’t have enough collateral to provide margin to support the orders, then the protocol will transfer the remaining funds from the liquidity provider’s bond account, and the liquidity provider will be penalised. The resulting penalty amount is 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, the liquidity provider will be marked for closeout and the liquidity provision will be removed from the market.

If there’s an imbalance between total and target stake as a result, the market will go into an auction to seek more liquidity provision.