Skip to main content
Version: mainnet (v0.53)

Stake tokens

Topic: Staking
tip

This tutorial describes how to stake using the smart contracts and APIs. If you're looking for the easiest way to use tokens to nominate validators, visit token.vega.xyz

  • Tokenholders can stake tokens to validators on the Vega chain, also known as nominating validators.
  • A Vega Wallet is required to create a Vega key and to stake (also known as nominate) validators.
  • Vega tokens may be locked in a vesting schedule. This tutorial covers unlocked tokens, i.e. tokens that are in a user's Ethereum wallet.
  • The staking bridge used to stake assets is different to the ERC20 bridge that allows asset withdrawal.

Staking unlocked VEGA

Staking VEGA from a tokenholder's Ethereum wallet, at a high level:

  1. On Ethereum, the tokens need to be associated with a Vega key
  2. On Vega, the Vega key is used to nominate a validator (stake)
  3. At the end of each epoch, rewards are paid out to the Vega key

See the step-by-step instructions below.

Withdrawing unlocked and unassociated VEGA

Withdrawing rewards from a tokenholder's Ethereum wallet, at a high level:

  1. On Vega, rewards and unassociated tokens can be withdrawn by submitting a withdrawal transaction
  2. On Ethereum, the withdrawal confirmation is submitted to the staking bridge, and the rewards are released to the specified Ethereum address

See the step-by-step instructions below.

Staking unlocked tokens: step by step

1. Associating tokens

Tokens are associated by calling stake on the Vega staking bridge. The two parameters are:

  • vega_public_key - the Vega public key that will be used to nominate validators on Vega
  • amount - the amount of tokens being associated with the Vega key

It will take ~50 block confirmations for the balance to update (approximately 1 minute). You can see when the staking balance has been credited by using REST, GraphQL or gRPC.

2. Nominating a validator

Once the token balance is associated to a Vega key, you'll want to choose a validator or validators to nominate.

Fetch a list of validator nodes using REST, GraphQL or gRPC.

Nominate a validator by sending a command with the Vega Wallet.

The amount field in the command only accepts whole numbers, and must include 18 decimal places. To illustrate that, the example below uses 1 VEGA.

vegawallet command send --wallet "WALLET_NAME" --pubkey "VEGA_PUBKEY" --network mainnet1 '{
"delegateSubmission": {
"nodeId":"INSERT_NODE_ID_FOR_NOMINATION",
"amount":"1000000000000000000"
}
}'

3. Claiming rewards

A nomination to a validator occurs in one epoch, and takes effect in the subsequent epoch.

That means that during the first epoch in which you nominate, no rewards will be received. For each subsequent epoch, rewards will be deposited to the Vega key, in the form of VEGA tokens. (Once trading is available on mainnet, rewards will be paid in a mix of VEGA tokens and settlement asset tokens.)

Specific reward payouts can be queried via the API (REST).

After VEGA rewards have been credited to the Vega key they can used to nominate validators or withdrawn.

Withdrawing involves preparing a withdrawal request, which the validators will confirm and sign in order for you to be able to request the withdrawal on Ethereum. The funds will immediately be locked on Vega, so they can be withdrawn through the Ethereum bridge.

Withdrawing unlocked tokens: step by step

1. Getting multisig bundle for withdrawal

Your withdrawal should be confirmed within a few seconds.

You can retrieve the signature bundle, which you will submit to the ERC20 bridge in the next step, by using the APIs (REST, GraphQL).

2. Submitting withdrawal to Ethereum

With the signature bundle fetched above, the final step is to submit that withdrawal to the staking bridge. This can be done via the withdraw_asset function on the Ethereum bridge.

  • amount - the amount of Vega being withdrawn
  • asset_source - the contract address of the asset being withdrawn
  • target - the Ethereum address to receive the rewards
  • nonce - the nonce from step 4
  • signatures - signature bundle from step 4

Ethereum addresses

NameAddressEthereum network
ERC20 Bridge0xCd403f722b76366f7d609842C589906ca051310f 🔍mainnet
Staking bridge0x195064D33f09e0c42cF98E665D9506e0dC17de68 🔍mainnet
Token vesting0x23d1bFE8fA50a167816fBD79D7932577c06011f4 🔍mainnet
Vega token0xcB84d72e61e383767C4DFEb2d8ff7f4FB89abc6e 🔍mainnet