Skip to content
Merged
Show file tree
Hide file tree
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
46 changes: 46 additions & 0 deletions projects/allora/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const { queryV1Beta1 } = require('../helper/chain/cosmos');

async function getCosmosStaking() {
const pool = await queryV1Beta1({
chain: 'allora',
url: 'staking/v1beta1/pool'
});

return pool.pool.bonded_tokens || '0';
}

async function getReputationalStaking() {
// Reputational staking endpoint not yet available
return '0';
}

async function tvl(api) {
// Staking is tracked separately
}

async function staking() {
const validatorStaking = await getCosmosStaking();
const reputationalStaking = await getReputationalStaking();

const totalStakedUallo = BigInt(validatorStaking) + BigInt(reputationalStaking);
const totalStakedAllo = totalStakedUallo / BigInt(1e18); // 18 decimals

return {
'allora': Number(totalStakedAllo)
};
}

module.exports = {
methodology: 'Tracks validator staking on Allora Chain via Cosmos SDK staking module. Reputational staking (workers/reputers) will be added when REST endpoint becomes available.',

timetravel: false,

allora: {
tvl,
staking
},

hallmarks: [
[1731283200, "Mainnet Launch"],
],
};
1 change: 1 addition & 0 deletions projects/helper/chain/cosmos.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const endPoints = {
pryzm: "https://api.pryzm.zone",
// agoric: 'https://as-proxy.gateway.atomscan.com/agoric-lcd',
agoric: 'https://agoric-api.polkachu.com/',
allora: 'https://allora-api.polkachu.com', // TODO: Verify actual mainnet endpoint
band: 'https://laozi1.bandchain.org/api',
celestia: 'https://celestia-rest.publicnode.com',
dydx: 'https://dydx-rest.publicnode.com',
Expand Down
1 change: 1 addition & 0 deletions projects/helper/chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"aleph_zero",
"alephium",
"algorand",
"allora",
"alv",
"ancient8",
"ao",
Expand Down
Loading