NEAR Documentation
  • Concepts
  • Develop
  • Tools
  • Tutorials
  • Community
  • Tokens
  • Stake
  • Integrate
  • GitHub

›Token Basics

Token Basics

  • Token Custody
  • Lockups Explained
  • Token Delegation
Edit

Token Delegation

Overview

To learn more about what validation and delegation are, please see the Validation docs and validation FAQ. The current page will describe the mechanics of participating in delegation.

At a high level, anyone can delegate their tokens to a staking pool which is run by a validator. This is usually just called "Staking". This is possible even if your tokens are in a lockup contract (as most tokens are during the network's early release). Delegating to a staking pool allows you to receive some staking rewards (which will activate as part of the Phase II rollout and depend on the exact fees charged by the validator) and to participate in protocol governance by adding weight to the vote of the validator whose pool you have delegated to.

You can participate in delegation by using a website (GUI), using the view and call methods of the command-line interface (CLI) or via sending RPC calls directly. These are described below.

Reminder: If you haven't already, evaluate your token custody options from this documentation page.

Viewing and Choosing Validators

During early days, the staking pool contracts (code) allow validators to select what fee they will charge on rewards earned by pools they run. In the future, updated versions of the staking pool contracts may include more parameters (which is one of the nice features enabled by NEAR's contract-based delegation).

Several community-run lists of validators list who they are, how much stake they have, what their vote was for the Phase II transition and more. These can be helpful for selecting where to delegate your tokens. As always, do your own diligence.

OperatorURL (to copy and paste)
NEAR Explorerhttps://explorer.near.org/nodes/validators
Zavodilhttps://near.zavodil.ru/?pools=
DokiaCapitalhttps://staking.dokia.cloud/staking/near/validators
Stardust NEAR Poolhttps://near-staking.com/
add hereyour link

GUI-based delegation (via a website or app)

Disclaimer: the list below is community-maintained, and is not an endorsement by NEAR to use any of them. Do your own research before staking your funds with them!

ProviderURL (to copy and paste)Added on
NEAR Wallethttps://wallet.near.orgOct 11 2020
DokiaCapitalhttps://staking.dokia.cloudSept 11 2020
Moonlet Wallethttps://moonlet.io/near-staking15 Oct 2020
add hereyour linkfirst come, first serve

CLI-based delegation

Disclaimer: the documentation below refers to the Github repository Core Contracts. Always check the source of the smart contract before delegating your funds to it!

You can use near-cli with NEAR Core Contracts to delegation via:

  1. Lockup Contract
  2. Staking Pool

Before starting, make sure you are running the latest version of near-cli, you are familiar with gas fees and you are sending transactions to the correct NEAR network. By default near-cli is configured to work with TestNet. You can change the network to MainNet by issuing the command

export NODE_ENV=mainnet

1. Lockup Contracts Delegation

The Lockup Contract is common among NEAR contributors and, essentially, anyone who didn't acquire tokens through an exchange. This contract acts as an escrow that locks and holds an owner's tokens for a lockup period (such as vesting). You can learn more about lockups and their implementation in the this documentation page.

The owner may want to stake these tokens (including locked ones) to help secure the network and also earn staking rewards that are distributed to the validator. The lockup contract doesn't allow to directly stake from its account, so the owner delegates the tokens using the contract built-in functions.

heads up

The commands below are tested with build 877e2db of the Core Contracts.

Before proceeding with the tutorial below, check that you have control of your lockup contract, by issuing the command

near view <LOCKUP_ID> get_owner_account_id ''

You should expect a result like:

$ near view meerkat.stakewars.testnet get_owner_account_id ''
View call: meerkat.stakewars.testnet.get_owner_account_id()
'meerkat.testnet'

Where the <LOCKUP_ID> is meerkat.stakewars.testnet; and the result is meerkat.testnet. In the following examples, <OWNER_ID> is always the output of this command.

You can stake with Lockup contracts in three steps:

  1. Set up the staking pool
  2. Deposit and stake the tokens
  3. Measure the rewards

a. Set the staking pool

Lockup contracts can stake to one staking pool at a time, so this parameter can be changed only while no funds are staked.

You can select the staking pool by calling the method select_staking_pool from the lockup contract:

near call <LOCKUP_ID> select_staking_pool '{"staking_pool_account_id": "<POOL_ID>"}' --accountId <OWNER_ID>

You should expect a result like:

$ near call meerkat.stakewars.testnet select_staking_pool '{"staking_pool_account_id": "zpool.pool.f863973.m0"}' --accountId meerkat.testnet

Scheduling a call: meerkat.stakewars.testnet.select_staking_pool({"staking_pool_account_id": "zpool.pool.f863973.m0"})
Receipts: HEATt32tHqWdjkZoSxLhd43CYVBCUp1cFHexgWBEeKJg, EUP7tncJfKDPpKYdunx2qySZ6JmV3injBigyFBiuD96J, 99hdXWmaTQE7gR5vucxMWFNMw7ZLtzJ6WNMSVJHPGJxh
    Log [meerkat.stakewars.testnet]: Selecting staking pool @zpool.pool.f863973.m0. Going to check whitelist first.
Transaction Id 4Z2t1SeN2rdbJcPvfVGScpwyuGGKobZjT3eqvDu28sBk
To see the transaction in the transaction explorer, please open this url in your browser
https://explorer.testnet.near.org/transactions/4Z2t1SeN2rdbJcPvfVGScpwyuGGKobZjT3eqvDu28sBk
true

Where the <LOCKUP_ID> is meerkat.stakewars.testnet; <POOL_ID> is zpool.pool.f863973.m0; and <OWNER_ID> is meerkat.testnet. The true statement means that your call was successful, and the lockup contract accepted the <POOL_ID> parameter.

In case if the <OWNER_ID> account uses Ledger for signing transactions, the above calls should be accompanied with the --useLedgerKey parameter:

near call <LOCKUP_ID> select_staking_pool '{"staking_pool_account_id": "<POOL_ID>"}' --accountId <OWNER_ID> --useLedgerKey="<HD_PATH>"

Where <HD_PATH> is an HD path of the used key (by default HD_PATH=44'/397'/0'/0'/1'). Same flag should be used for all the other call-s (not view-s) below. See more info on using near-cli with Ledger here.

Heads up

Signing the transaction with the wrong Ledger key can help clustering multiple accounts of the user, since even failed transactions are recorded to the blockchain and can be subsequently analyzed.

b. Deposit and stake the tokens

Lockup contracts can stake their balance, regardless of their vesting schedule. You can proceed in two steps:

  1. check the lockup balance

  2. stake the balance

  3. To know how many tokens you can stake, use the view method get_balance:

near view <LOCKUP_ID> get_balance ''

You should expect a result like:

$ near view meerkat.stakewars.testnet get_balance ''
View call: meerkat.stakewars.testnet.get_balance()
'100000499656128234500000000'

Where the <LOCKUP_ID> is meerkat.stakewars.testnet and the resulting balance (in Yocto) is 100000499656128234500000000 or 100 $near.

heads up

You have to leave 35 $near in the lockup contract for the storage fees. If you have 100 tokens, you can stake up to 65 tokens. If you have 1000 tokens, you can stake up to 965 tokens.
  1. To stake the balance, use the call method deposit_and_stake:
near call <LOCKUP_ID> deposit_and_stake '{"amount": "<AMOUNT>"}' --accountId <OWNER_ID> --gas=200000000000000

You should expect a result like:

$ near call meerkat.stakewars.testnet deposit_and_stake '{"amount": "65000000000000000000000000"}' --accountId meerkat.testnet --gas 200000000000000
Scheduling a call: meerkat.stakewars.testnet.deposit_and_stake({"amount": "65000000000000000000000000"})
Receipts: BFJxgYMbPLpKy4jae3b5ZJfLuAmpcYCBG2oJniDgh1PA, 9sZSqdLvPXPzpRg9VLwaWjJaBUnXm42ntVCEK1UwmYTp, CMLdB4So6ZYPif8qq2s7zFvKw599HMBVcBfQg85AKNQm
    Log [meerkat.stakewars.testnet]: Depositing and staking 65000000000000000000000000 to the staking pool @zpool.pool.f863973.m0
Receipts: 3VpzWTG9Y2nbZmuJhmsub9bRLnwHCFtnW5NQqcMBWawF, 4BrEKDPmz3mAhnq5tTFYRQp8y9uRxGFwYffJFkPMdQ5P, HJPqqJDTajFfeEA8vFXTLDpxh4PYZCMJ2YLKpWVtwSMF
    Log [meerkat.stakewars.testnet]: Epoch 105: Contract received total rewards of 20383576173536987339742291104 tokens. New total staked balance is 104251712242552700026473040909. Total number of shares 77295581098329153455984430997
    Log [meerkat.stakewars.testnet]: Total rewards fee is 1511304065231935217653387665 stake shares.
    Log [meerkat.stakewars.testnet]: @meerkat.stakewars.testnet deposited 65000000000000000000000000. New unstaked balance is 65000000000000000000000000
    Log [meerkat.stakewars.testnet]: @meerkat.stakewars.testnet staking 64999999999999999999999999. Received 48193095953206307331949682 new staking shares. Total 1 unstaked balance and 48193095953206307331949682 staking shares
    Log [meerkat.stakewars.testnet]: Contract total staked balance is 104316712242552700026473040909. Total number of shares 77343774194282359763316380679
Receipt: FsJLXXEa8Jp8UNyiyG3XQhyHHSWzZ2bCjgWr8kPVjGmG
    Log [meerkat.stakewars.testnet]: The deposit and stake of 65000000000000000000000000 to @zpool.pool.f863973.m0 succeeded
Transaction Id AW9pFb5RjkCjsyu8ng56XVvckvd3drPBPtnqVo6bJhqh
To see the transaction in the transaction explorer, please open this url in your browser
https://explorer.testnet.near.org/transactions/AW9pFb5RjkCjsyu8ng56XVvckvd3drPBPtnqVo6bJhqh
true

Where <LOCKUP_ID> is meerkat.stakewars.testnet; <AMOUNT> is 65000000000000000000000000 (the total available, minus 35 $near for the minimum balance); and <OWNER_ID> is meerkat.testnet. The true statement at the end means the transaction was successful.

Heads up

In the example above the pre-paid gas parameter is set to 200000000000000 Yocto, as near-cli default allocation is too low.

c. Measure the rewards

Since NEAR automatically re-stakes every staking pool rewards, you have to update your staked balance to know the amount of tokens you earned with your validator.

Use the call method refresh_staking_pool_balance to check your new balance:

near call <LOCKUP_ID> refresh_staking_pool_balance '' --accountId <OWNER_ID>

You should expect a result like:

$ near call meerkat.stakewars.testnet refresh_staking_pool_balance '' --accountId meerkat.testnet | grep "current total balance"
    Log [meerkat.stakewars.testnet]: The current total balance on the staking pool is 65000000000000000000000000

Where <LOCKUP_ID> is meerkat.stakewars.testnet, and <OWNER_ID> is meerkat.testnet. In the example above, the result is passed to | grep "current total balance" to display only the relevant output.

Please refer to the Lockup Contract readme if you need to know how to withdraw the staking rewards to your main wallet.

Unstake and withdraw your lockup tokens

NEAR Protocol automatically re-stakes all the rewards back to the staking pools, so your staked balance increases over time, accruing rewards.

Before starting, it's highly recommended to read the Lockup contracts documentation to understand which portion of the tokens is liquid, and which one is still locked even after the three epochs.

If you want to withdraw funds, you have to issue two separate commands:

  1. Manually unstake tokens from the staking pool, and wait three epochs
  2. Manually withdraw tokens back to your main account

Both these command require the amount in yoctoNEAR, which is the smallest unit of account for NEAR tokens. You can use the table below for the conversion:

NEARYoctoNEARYoctoNEAR
11*10^241000000000000000000000000
101*10^2510000000000000000000000000
1001*10^26100000000000000000000000000
1,0001*10^271000000000000000000000000000
10,0001*10^2810000000000000000000000000000

As an example, if you want to unstake 10 NEAR tokens from the staking pool, you have to call the method unstake with 10000000000000000000000000 (1*10^24, 10 power 24, or 10 with 24 zeros) as an argument.

a. Unstake the tokens

Before unstaking any tokens, use the the view method get_account introduced above to know what is the available balance:

near view <POOL_ID> get_account '{"account_id": "<LOCKUP_ID>"}'

You should expect a result like:

$ near view zpool.pool.f863973.m0 get_account '{"account_id": "meerkat.stakewars.testnet"}'
View call: zpool.pool.f863973.m0.get_account({"account_id": "meerkat.stakewars.testnet"})
{
  account_id: 'meerkat.stakewars.testnet',
  unstaked_balance: '5',
  staked_balance: '86236099167204810592552675',
  can_withdraw: false
}

Where <POOL_ID> is zpool.pool.f863973.m0, and the <LOCKUP_ID> is meerkat.stakewars.testnet. The result of this method shows:

  • An unstaked balance of 5 yocto
  • A staked balance of 86236099167204810592552675 yocto, or 86.23 NEAR tokens
  • can_withdraw is false (see below)
Check your rewards

From the examples above, the initial stake of 65 NEAR tokens increased to 86.23 tokens, with 21.23 tokens as a reward!

You can unstake an amount of funds that is equal or lower than your staked_balance, by calling the metod unstake:

near call <LOCKUP_ID> unstake '{"amount": "<YOCTO>"}' --accountId <OWNER_ID>

You should expect a result like:

$ near call meerkat.stakewars.testnet unstake '{"amount": "42000000000000000000000000"}' --accountId meerkat.testnet --useLedgerKey="44'/397'/0'/0'/1'" --gas 300000000000000
Make sure to connect your Ledger and open NEAR app
Scheduling a call: meerkat.stakewars.testnet.unstake({"amount": "42000000000000000000000000"})
Waiting for confirmation on Ledger...
Using public key: ed25519:5JgsX9jWUTS5ttHeTjuDFgCmB5YX77f7GHxuQfaGVsyj
Waiting for confirmation on Ledger...
Ledger app version: 1.1.3
Receipts: D5fCCWa5b5N8X9VtxsbRvGhSSCQc56Jb312DEbG4YY8Z, 72rgHrMb1zkUU2RiEz2EMCAuMWFgRJTf8eovwAUkuo31, A2dvSgxpDXfNZUrDVdpewk1orVTVxCMiicjk7qyNq3dW
    Log [meerkat.stakewars.testnet]: Unstaking 42000000000000000000000000 from the staking pool @zpool.pool.f863973.m0
Receipts: 9MbLXn28nQyL6BopMEUggBD9NA1QfVio9VB3LTNJ6P5b, 5g7F6HehoGZ2DHS7w54xHAjAeHCsHaAsKpVed76MFYru, BKbtF77i1WEqpuFLtEjWerM2LVZW1md9ecQ5UcBpMNXj
    Log [meerkat.stakewars.testnet]: Epoch 162: Contract received total rewards of 9488161121527521670023204339 tokens. New total staked balance is 142388816229749953331375665038. Total number of shares 79574075700231185032355056920
    Log [meerkat.stakewars.testnet]: Total rewards fee is 530246455678218748147822292 stake shares.
    Log [meerkat.stakewars.testnet]: @meerkat.stakewars.testnet unstaking 42000000000000000000000001. Spent 23471725293488513736732361 staking shares. Total 42000000000000000000000002 unstaked balance and 24721370659717793595217321 staking shares
    Log [meerkat.stakewars.testnet]: Contract total staked balance is 142346816229749953331375665038. Total number of shares 79550603974937696518618324559
Receipt: 3DXSx8aMvhwtJUB6mhTueNbDiqz5wYu3xzzYkZrgjw1u
    Log [meerkat.stakewars.testnet]: Unstaking of 42000000000000000000000000 at @zpool.pool.f863973.m0 succeeded
Transaction Id 2rRpdN8AAoySfWsgE7BRtRfz7VFnyFzRhssfaL87rXGf
To see the transaction in the transaction explorer, please open this url in your browser
https://explorer.testnet.near.org/transactions/2rRpdN8AAoySfWsgE7BRtRfz7VFnyFzRhssfaL87rXGf
true

Where <LOCKUP_ID> is meerkat.stakewars.testnet, the <YOCTO> is 42000000000000000000000000, and the <OWNER_ID> is meerkat.testnet.

Wait three epochs, or ~36 hours before using the withdraw command

For security reasons, NEAR Protocol keeps your unstaked funds locked for three more epochs (~36 hours). Use again the view method get_account to verify if can_withdraw is true:

near view <POOL_ID> get_account '{"account_id": "<LOCKUP_ID>"}'

The result should be as follows:

$ near view zpool.pool.f863973.m0 get_account '{"account_id": "meerkat.stakewars.testnet"}'
View call: zpool.pool.f863973.m0.get_account({"account_id": "meerkat.stakewars.testnet"})
{
  account_id: 'meerkat.stakewars.testnet',
  unstaked_balance: '42000000000000000000000006',
  staked_balance: '44244760537191121230392104',
  can_withdraw: true
}

Where <POOL_ID> is zpool.pool.f863973.m0, the <LOCKUP_ID> is meerkat.stakewars.testnet and the variable can_withdraw is true. This means that your 42000000000000000000000000 Yocto (42 NEAR tokens) are now available for withdraw.

b. Withdraw the tokens

Funds can be withdrawn after three epochs (~36 hours) from the unstake command. It is highly recommended to read the Lockup contracts documentation to understand which portion of the unstaked tokens is available for transfers, and which is still vesting and unavailable (even after three epochs).

Use the call method withdraw_all_from_staking_pool:

near call <LOCKUP_ID> withdraw_all_from_staking_pool '' --accountId <OWNER_ID>

You should expect a result like this one:

$ near call meerkat.stakewars.testnet withdraw_all_from_staking_pool '' --accountId meerkat.testnet --useLedgerKey="44'/397'/0'/0'/1'" --gas 300000000000000

Make sure to connect your Ledger and open NEAR app
Scheduling a call: meerkat.stakewars.testnet.withdraw_all_from_staking_pool()
Waiting for confirmation on Ledger...
Using public key: ed25519:5JgsX9jWUTS5ttHeTjuDFgCmB5YX77f7GHxuQfaGVsyj
Waiting for confirmation on Ledger...
Ledger app version: 1.1.3
Receipts: 6dt3HNDrb7jM4F7cRtwgRSfRMWwFmE8BHeZSDghrpQtw, 7pNKTevct7Z4birAPec81LmnSpJSeJXbFq3cBdjFvsnM, A7yJXdaGcFyiBNQimFtHF479Jm6xiXHvfodTbtFf7Rww
    Log [meerkat.stakewars.testnet]: Going to query the unstaked balance at the staking pool @zpool.pool.f863973.m0
Receipts: 2ytgB57D6CJe3vkxdVTiVAytygpTteR4sDmpUNxo5Ltk, CZChcT1uDDxqojnZQq6r7zzx6FE3Z6E5fZ3F23Y1dnyM, GjrWhJgbCAAHUNyvw4QX5YKFpeUVNJ9GpuEdmUXFozeG
    Log [meerkat.stakewars.testnet]: Withdrawing 42000000000000000000000006 from the staking pool @zpool.pool.f863973.m0
Receipts: 9nHoqnQygqKYyyR5KDofkYy5KiJxbu2eymoGUUc2tSR3, 5RvBSb4BuHxRhc5U6nLgsCjAvJ88hJ2jwkr1ramk37mE, 5PDN1EYXnCJrTSU7zzJtmAuj9vvGSVurh94nvfHDHXpa, GTTGm4sXcSWD2gnohMJzD7TQcQxuSe7AFABZKqxPLgau
    Log [meerkat.stakewars.testnet]: Epoch 168: Contract received total rewards of 514182787298700000000 tokens. New total staked balance is 142377784876419564057032272059. Total number of shares 79552334320822393318832070510
    Log [meerkat.stakewars.testnet]: Total rewards fee is 28729510739826825657 stake shares.
    Log [meerkat.stakewars.testnet]: @meerkat.stakewars.testnet withdrawing 42000000000000000000000006. New unstaked balance is 0
Receipt: rS5KjvzkbaxEH7aG8VXyd9EEEfY7PygdLzSZ3W9qf3w
    Log [meerkat.stakewars.testnet]: The withdrawal of 42000000000000000000000006 from @zpool.pool.f863973.m0 succeeded
Transaction Id EjNpoU7BNfEQujckL8JiAP8kYDH1SMLw4wC32tL3uyaH
To see the transaction in the transaction explorer, please open this url in your browser
https://explorer.testnet.near.org/transactions/EjNpoU7BNfEQujckL8JiAP8kYDH1SMLw4wC32tL3uyaH
true

Where <LOCKUP_ID> is meerkat.stakewars.testnet, the <OWNER_ID> is meerkat.testnet and the true statement confirms the successful withdrawal.

By using again the view method

near view <POOL_ID> get_account '{"account_id": "<LOCKUP_ID>"}'

The result should be as follows:

$ near view zpool.pool.f863973.m0 get_account '{"account_id": "meerkat.stakewars.testnet"}'
View call: zpool.pool.f863973.m0.get_account({"account_id": "meerkat.stakewars.testnet"})
{
  account_id: 'meerkat.stakewars.testnet',
  unstaked_balance: '0',
  staked_balance: '44244760947075774431066852',
  can_withdraw: true
}

At this point the unstaked_balance is 0, and the funds are back in the lockup contract balance.

Heads up

Lockup contracts allow you to transfer only the unlocked portion of your funds. In the example above, out of the 42 NEAR unstaked, only 21.23 can be transferred to another wallet or exchange.

c. Change staking pools

To change from one staking pool to another, you must first withdraw all deposits in the currently selected staking pool. Then call unselect_staking_pool as follows (docs):

$ near call meerkat.stakewars.testnet unselect_staking_pool --accountId meerkat.testnet --useLedgerKey="44'/397'/0'/0'/1'" --gas 300000000000000

Staking Pool Delegation

Any funds that are not stored inside lockup contracts can be directly delegated to a staking pool by using the call method deposit_and_stake:

near call <POOL_ID> deposit_and_stake '' --accountId <OWNER_ID> --amount 100

You should expect a result like:

$ near call valeraverim.pool.f863973.m0 deposit_and_stake '' --accountId meerkat.testnet --amount 100

Scheduling a call: valeraverim.pool.f863973.m0.deposit_and_stake() with attached 100 NEAR
Receipts: FEfNuuCSttu7m4dKQPUSgpSFJSB86i6T2sYJWSv7PHPJ, GPYhZsyUuJgvr7gefxac4566DVQcyGs4wSFeydkmRX7D, 8hfcJuwsstnFQ1cgU5iUigvfrq1JcbaKURvKf5shaB4g
    Log [valeraverim.pool.f863973.m0]: Epoch 106: Contract received total rewards of 545371217890000000000 tokens. New total staked balance is 75030000959768421358700000000. Total number of shares 75029067713856889417103116457
    Log [valeraverim.pool.f863973.m0]: Total rewards fee is 54536443439735902364 stake shares.
    Log [valeraverim.pool.f863973.m0]: @meerkat.testnet deposited 100000000000000000000000000. New unstaked balance is 100000000000000000000000000
    Log [valeraverim.pool.f863973.m0]: @meerkat.testnet staking 99999999999999999999999999. Received 99998756169666008195607157 new staking shares. Total 1 unstaked balance and 99998756169666008195607157 staking shares
    Log [valeraverim.pool.f863973.m0]: Contract total staked balance is 75130000959768421358700000000. Total number of shares 75129066470026555425298723614
Transaction Id FDtzMmusJgFbryeVrdQyNvp6XU2xr11tecgqnnSsvyxv
To see the transaction in the transaction explorer, please open this url in your browser
https://explorer.testnet.near.org/transactions/FDtzMmusJgFbryeVrdQyNvp6XU2xr11tecgqnnSsvyxv
''

Where <POOL_ID> is valeraverim.pool.f863973.m0; and the <OWNER_ID> is meerkat.testnet.

If you want to check your staking rewards, use the view method get_account:

near view <POOL_ID> get_account '{"account_id": "<OWNER_ID>"}'

You should expect a result like:

$ near view valeraverim.pool.f863973.m0 get_account '{"account_id": "meerkat.testnet"}'
View call: valeraverim.pool.f863973.m0.get_account({"account_id": "meerkat.testnet"})
{
  account_id: 'meerkat.testnet',
  unstaked_balance: '1',
  staked_balance: '100663740438210643632989745',
  can_withdraw: true
}

Where <POOL_ID> is valeraverim.pool.f863973.m0 and <OWNER_ID> is meerkat.testnet. The staked balance is 100663740438210643632989745, or 100.66 tokens.

A pool's rewards only compound if it has been "pinged", which means either having a direct action performed on it (like someone delegating or undelegating) or if the ping method is called on it once within a particular epoch. This is important to do if you run a pool and want your delegators to see updated reward balances.

Use the call method ping to re-calculate the rewards up to the previous epoch:

near call <POOL_ID> ping '{}' --accountId <OWNER_ID>

You should expect a result like:

$ near call valeraverim.pool.f863973.m0 ping '{}' --accountId meerkat.testnet
Scheduling a call: valeraverim.pool.f863973.m0.ping({})
Transaction Id 4mTrz1hDBMTWZx251tX4M5CAo5j7LaxLiPtQrDvQgcZ9
To see the transaction in the transaction explorer, please open this url in your browser
https://explorer.testnet.near.org/transactions/4mTrz1hDBMTWZx251tX4M5CAo5j7LaxLiPtQrDvQgcZ9
''

Where <POOL_ID> is valeraverim.pool.f863973.m0; and the <OWNER_ID> is meerkat.testnet. The '' result means that your call was successful, and the get_account view method will provide updated results.

Note that you can ping any pool, not just one you own.

Additional links

  • Lockup contracts explained
  • NEAR Core Contracts on Github
  • NEAR block explorer
  • near-cli on Github

Fun Facts

  1. pinging a pool technically removes 2 epochs of future compounding but it's an extremely small amount -- without considering compounding effect of epochs with 9 hour epochs, the reward per epoch is 5% / (365 * 24 / 9) + 1 or 1.00005136986 It means this reward on top of reward is what you’re losing, so that's about 1.00000000264 or 0.000000264%... meaning for 10M stake it’s 0.02638862826 NEAR per epoch.

Got a question? Ask it on StackOverflow!

Last updated on 2/10/2021 by Josh
← Lockups Explained
  • Overview
    • Viewing and Choosing Validators
  • GUI-based delegation (via a website or app)
  • CLI-based delegation
  • 1. Lockup Contracts Delegation
    • a. Set the staking pool
    • b. Deposit and stake the tokens
    • c. Measure the rewards
  • Unstake and withdraw your lockup tokens
    • a. Unstake the tokens
    • b. Withdraw the tokens
    • c. Change staking pools
  • Staking Pool Delegation
  • Additional links
  • Fun Facts
  • Wallet
  • Explorer
  • Examples
  • Forum
  • Twitter
  • GitHub
  • Discord
  • Telegram
  • WeChat
  • YouTube

Developers

  • Overview
  • Technology
  • GitHub
  • Bounties
  • Grants

Community

  • Forum
  • Events
  • Contributor Program
  • Guild Program
  • Startup Accelerator
  • Bounties
  • Tokens

About

  • Team
  • Careers
  • Backers
  • Press Kit
  • Brand Guidelines
  • Privacy Policy

2020 NEAR Protocol|All rights reserved|hello@near.org|Privacy Policy