Need to get Total number of NEAR staked in NEAR protocol

I need to get the Total number of NEAR staked in NEAR protocol programatically preferably through RPC API endpoint which NEAR provides. But I am not getting any such method in their RPC API Documentation(Setup | NEAR Documentation). Would be really great if someone could help me on this. Details of this ask can be found in below StackOverflow url.
nearprotocol - Total number of NEAR token staked in NEAR Blockchain - Stack Overflow

1 Like

Hi there, I’m afraid I can’t provide you to exact answer but would recommend you to raise this question in Discord ( near.chat )
There are dev support channel and validator channel there with active members. They might be able to help you.

Cheers.

1 Like

You can sum up the staked amounts of each validator: Network | NEAR Documentation

Thanks for your response. I actually tried that option by using below RPC construct.

endpoint URL: https://rpc.mainnet.near.org
Header = {“Content-Type”:“application/json”}
body = {
“jsonrpc”: “2.0”,
“id”: 1,
“method”: “validators”,
“params”: [None]
}

Summing up all individual validator’s staked quantity is not giving me the one which is shown in NEAR explorer(NEAR Explorer | Nodes).

There is a significant difference. Also that API call does not give the number of validators same as in the explorer. Hence looking for exact way of getting that value.

1 Like

What is that significant difference?
Do staked amounts of individual validators match the numbers in explorer?

attaching my findings on the difference as on timestamp I am writing this -

I have taken some sample validators to identify the difference.Even if each validators staked quantity is little more through RPC API call, compared to the NEAR explorer there is a difference of 81.8414025967919 M NEAR token in Protocol level total stake. Hope this will help.

The numbers for each validator are close enough. Maybe explorer shows staked amounts for the next epoch?
The fact that you get 106 validators via RPC API is an issue with the same root cause as Nearcore logging still showing 100 validators · Issue #8156 · near/nearcore · GitHub

Then summing up individual validator’s staked amount to get the network total staked should not be used till it’s getting fixed. Is it possible to update the ETA for this? Also it will be really helpful if you could update here the mechanism which is being used in NEAR explorer to populate the network total staked and same can be used for my use case or not.