Liquidity provision

Introduction

Liquidity Provision (LP) on Vega is designed to incentivise participants to place orders on the market that maintain liquidity on the order book. To learn more about the mechanics of LP on Vega please see the section on Providing liquidity for markets.

How do I provide a liquidity commitment?

Connect to a Vega API server, and provide a liquidity commitment:

1. Log in to wallet and get public key

See the section on the Wallet service to learn how to log in, list keys and select a public key.

For a working wallet example used by this how-to guide, please visit the API Samples GitHub repo.

2. Choose a market and ensure account/asset balance

In order to provide liquidity on a target market, the account balance for the settlement asset on the related public key (party) should be positive and sufficient to cover the commitment.

For more information on how to deposit an asset into Vega, see the section on How to deposit tokens to use on Vega or the guide in the Vega Bridge GitHub repo.

3. List all liquidity provisions for the market

Connect to a Vega API server, and request all liquidity provisions for the specified market:

Gitpod ready-to-code What’s Gitpod?

See also REST API reference for further query detail.

See also REST API reference for further query detail.

See also gRPC API reference for further query detail.

If successful, the response will include:

Field Description
liquidityProvisions A collection of liquidity provision data for the specified market. See below more information on each value.

4. Compose a liquidity commitment submission message

When submitting a liquidity commitment message, the following fields must be specified:

  • market identifier,
  • commitment amount,
  • proposed liquidity fee,
  • a set of liquidity buy and sell shapes

Please see Providing liquidity for markets for details. Please note that the request will be rejected if the message is invalid. This could be because of the market state, the message is formatted incorrectly, or the requested liquidity commitment cannot be supported with your current balance in the market settlement asset.

Gitpod ready-to-code What’s Gitpod?

5. Compose a liquidity commitment amendment message

If the liquidity commitment message has already been submitted successfully, submitting an amend message will serve to amend the liquidity provision. To amend, keep liquidityCommitment positive (unchanged to leave as is) and modify any fields which should be amended.

Please note that the request will be rejected if the message is invalid, and the liquidity commitment will stay as is. This could be because of the market state, the message is formatted incorrectly, or the requested liquidity commitment cannot be supported with your current balance in the market settlement asset.

Gitpod ready-to-code What’s Gitpod?

6. Compose a liquidity commitment cancellation message

If the liquidity commitment message has already been submitted successfully, submitting a cancel message will serve to cancel the liquidity provision.

Please note that the cancellation message will be rejected if the message is invalid, and the liquidity commitment will stay as is. This could be because of the market state, the message is formatted incorrectly, or the requested liquidity commitment cannot be supported with your current balance in the market settlement asset.

Gitpod ready-to-code What’s Gitpod?

7. Sign and send the transaction

Gitpod ready-to-code What’s Gitpod?

See also Wallet API for further query detail.

See also Wallet API for further query detail.

See also Wallet API for further query detail.

If successful, the response will include:

Field Description
signature A signed transaction message containing the liquidity commitment submission data. Because propagate is set to true, the signed data will be automatically forwarded by the wallet server to a node. If you wish to manually submit the transaction you can do so with the data in signature (tx) and set propagate to false.

What’s next?