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: create the DefiLlama Adapter for the Capy Finance project #10630

Merged
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
7 changes: 5 additions & 2 deletions projects/bunicorn/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
const sdk = require("@defillama/sdk");
const { v1Tvl } = require("../helper/balancer");
const { uniTvlExport } = require('../helper/unknownTokens')
const { uniTvlExport } = require("../helper/unknownTokens");
const BUNI_CONTRACT_ADDRESS = "0x0e7beec376099429b85639eb3abe7cf22694ed49";
const MASTERCHEF_CONTRACT_ADDRESS = "0xA12c974fE40ea825E66615bA0Dc4Fd19be4D7d24";

async function staking(api) {
return api.sumTokens({ owner: MASTERCHEF_CONTRACT_ADDRESS, tokens: [BUNI_CONTRACT_ADDRESS] });
return api.sumTokens({
owner: MASTERCHEF_CONTRACT_ADDRESS,
tokens: [BUNI_CONTRACT_ADDRESS],
});
}

module.exports = {
Expand Down
17 changes: 17 additions & 0 deletions projects/capy-finance/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const CAPY_STAKING_CONTRACT = '0x67D171A673FfDBd5BBce01dE1489f9E57F3d911b';
const CAPY_RESTAKING_CONTRACT = '0x12178d2B86031dD293274A0E25c8908521F3d27C';

async function tvl(api) {
const contracts = [CAPY_STAKING_CONTRACT, CAPY_RESTAKING_CONTRACT]
const tokens = await api.multiCall({ abi: 'address[]:getSupportedTokens', calls: contracts })
const ownerTokens = contracts.map((contract, i) => [tokens[i], contract])
return api.sumTokens({ ownerTokens })
}

module.exports = {
methodology: 'The TVL of the Capy Finance project in USD.',
start: 1000235,
bsquared: {
tvl,
},
}
Loading