Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions projects/adrastea-validator/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const ADDRESSES = require('../helper/coreAssets.json')
const { getConnection } = require("../helper/solana");

// Adrastea validator accounts
const VOTE_ACCOUNT = "adraBKLNY3DL3pg6SJRDYiMA8BsznaWpUdE42X41gbP";

async function tvl(api) {
const connection = getConnection();

// Get all vote accounts from the network
const voteAccounts = await connection.getVoteAccounts();

// Find Adrastea validator in current or delinquent validators
const adrasteaValidator = voteAccounts.current.find(va => va.votePubkey === VOTE_ACCOUNT) ||
voteAccounts.delinquent.find(va => va.votePubkey === VOTE_ACCOUNT);

api.add(ADDRESSES.solana.SOL, adrasteaValidator.activatedStake)
}

module.exports = {
timetravel: false,
methodology: "Sums all SOL staked to Adrastea validator vote account: " + VOTE_ACCOUNT,
solana: {
tvl,
},
};
Loading