Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds Taraxa staking and tvl adapter #12651

Closed
wants to merge 1 commit into from
Closed
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
33 changes: 33 additions & 0 deletions projects/taraxa/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const TARAXA_STAKING_CONTRACT = "0x00000000000000000000000000000000000000fe";
const TARAXA_ECOSYSTEM_FUND_ADDRESS =
"0x723304d1357a2334fcf902aa3d232f5139080a1b";
const TARAXA_FOUNDATION_ADDRESS = "0x723304d1357a2334fcf902aa3d232f5139080a1b";

async function staking(api) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, we are not tracking chain staking atm

const balance = await api.provider.getBalance(
TARAXA_STAKING_CONTRACT,
api.block
);
api.addGasToken(Number(balance) / 10 ** 18);
}

async function tvl(api) {
const balanceEcosystem = await api.provider.getBalance(
TARAXA_ECOSYSTEM_FUND_ADDRESS,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this your treasury address?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Foundation" address is the treasury. This is a community fund.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually both of them count as the project treasury. The foundation tokens are never circulated and the ecosystem fund is for grants (this changes from month to month)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, we can track this under treasury but not as tvl. making the change now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cant count foundation tokens as it is not circulating

api.block
);

const balanceFoundation = await api.provider.getBalance(
TARAXA_FOUNDATION_ADDRESS,
api.block
);

api.addGasToken((Number(balanceEcosystem) + Number(balanceFoundation)) / 10 ** 18);
}

module.exports = {
tara: {
tvl,
staking,
},
};
Loading