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

add restaking, ssv and steth rewards #2093

Merged

Conversation

vvalecha519
Copy link
Contributor

No description provided.

@llamatester
Copy link

The ether-fi adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees ether-fi

🦙 Running ETHER-FI adapter 🦙
---------------------------------------------------
Start Date:	Wed, 13 Nov 2024 00:44:10 GMT
End Date:	Thu, 14 Nov 2024 00:44:10 GMT
---------------------------------------------------

23652884640906128290848n
Balances {
  chain: 'ethereum',
  timestamp: undefined,
  _balances: {
    'ethereum:0xec53bf9167f50cdeb3ae105f56099aaab9061f83': '5.669420855609325e+21',
    'ethereum:0x9D65fF81a3c488d585bBfb0Bfe3c7707c7917f54': '788429488030204300000',
    'ethereum:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2': 4013450174322292000,
    'ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48': 2790116610.301862,
    'ethereum:0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84': 781524274515754200
  }
}
ETHEREUM 👇
Backfill start time: 12/3/2024
Daily fees: 722.63 k
└─ Methodology: Staking/Restaking rewards earned by all staked ETH + Fees on Liquid Vaults
Daily revenue: 93.88 k
└─ Methodology: Staking/Restaking rewards + Fees on Liquid Vaults
End timestamp: 1731545049 (2024-11-14T00:44:09.000Z)

@llamatester
Copy link

The ether-fi adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees ether-fi

🦙 Running ETHER-FI adapter 🦙
---------------------------------------------------
Start Date:	Wed, 13 Nov 2024 00:50:06 GMT
End Date:	Thu, 14 Nov 2024 00:50:06 GMT
---------------------------------------------------

ETHEREUM 👇
Backfill start time: 12/3/2024
Daily fees: 720.09 k
└─ Methodology: Staking/Restaking rewards earned by all staked ETH + Fees on Liquid Vaults
Daily revenue: 93.58 k
└─ Methodology: Staking/Restaking rewards + Fees on Liquid Vaults
End timestamp: 1731545405 (2024-11-14T00:50:05.000Z)

toBlock: await options.getEndBlock(),
eventAbi: "event TokenRebased(uint256 indexed reportTimestamp,uint256 timeElapsed,uint256 preTotalShares,uint256 preTotalEther,uint256 postTotalShares,uint256 postTotalEther,uint256 sharesMintedAsFees)",
});
for (const log of stethRebaseLogs) {
Copy link
Member

Choose a reason for hiding this comment

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

why not take just the first log instead of looping?

Copy link
Contributor Author

@vvalecha519 vvalecha519 Nov 15, 2024

Choose a reason for hiding this comment

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

Nice that would be cleaner it is equivalent to what is being done right now!

Copy link
Member

Choose a reason for hiding this comment

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

can you make that change because the loop is misleading

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

const stethRebaseLogs = await options.getLogs({
target: STETH,
fromBlock: await options.getStartBlock(),
toBlock: await options.getEndBlock(),
Copy link
Member

Choose a reason for hiding this comment

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

from & toBlock can be skipped, it is automatically pulled

Copy link
Member

Choose a reason for hiding this comment

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

*can you remove line 28 & 29?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

target: SSV,
eventAbi: "event Transfer(address indexed from, address indexed to, uint256 value)",
topic: "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
fromBlock: await options.getStartBlock() - 30 * 86400 / 12, //claimed every 31 days
Copy link
Member

Choose a reason for hiding this comment

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

hmm, if it is claimed every 31 days, it is better to leave a spike on the chart every 31st day instead of trying to average it.

So, I would remove from & toBlock here as well

Copy link
Contributor Author

@vvalecha519 vvalecha519 Nov 15, 2024

Choose a reason for hiding this comment

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

Since we report daily revenue, averaging the claimed amount of SSV over 30 days accurately reflects how much SSV was earned each day. Claiming daily is not viable, so we claim monthly, but the SSV accrues daily for running the software. I believe it makes sense to keep it averaged, as this more accurately represents the daily earnings.

Copy link
Member

Choose a reason for hiding this comment

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

yes, but it is not really revenue till it is transferred, we apply the same logic for other adapters that we have listed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@vvalecha519
Copy link
Contributor Author

@g1nt0ki any update on this pr?

@g1nt0ki g1nt0ki self-assigned this Nov 21, 2024
g1nt0ki

This comment was marked as duplicate.

Copy link
Member

@g1nt0ki g1nt0ki left a comment

Choose a reason for hiding this comment

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

.

@llamatester
Copy link

The ether-fi adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees ether-fi

🦙 Running ETHER-FI adapter 🦙
---------------------------------------------------
Start Date:	Wed, 20 Nov 2024 17:42:09 GMT
End Date:	Thu, 21 Nov 2024 17:42:09 GMT
---------------------------------------------------

ETHEREUM 👇
Backfill start time: 13/3/2024
Daily fees: 761.04 k
└─ Methodology: Staking/Restaking rewards earned by all staked ETH + Fees on Liquid Vaults
Daily revenue: 84.48 k
└─ Methodology: Staking/Restaking rewards + Fees on Liquid Vaults
End timestamp: 1732210928 (2024-11-21T17:42:08.000Z)


// add ssv revenue for running ssv validators
const ssvRevenue = await getSsvRevenue(options);
dailyFees.add(SSV, ssvRevenue / BigInt(30));
Copy link
Member

Choose a reason for hiding this comment

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

think the divide by 30 should go away?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ur right

@llamatester
Copy link

The ether-fi adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees ether-fi

🦙 Running ETHER-FI adapter 🦙
---------------------------------------------------
Start Date:	Thu, 21 Nov 2024 12:38:16 GMT
End Date:	Fri, 22 Nov 2024 12:38:16 GMT
---------------------------------------------------

ETHEREUM 👇
Backfill start time: 13/3/2024
Daily fees: 661.02 k
└─ Methodology: Staking/Restaking rewards earned by all staked ETH + Fees on Liquid Vaults
Daily revenue: 74.09 k
└─ Methodology: Staking/Restaking rewards + Fees on Liquid Vaults
End timestamp: 1732279095 (2024-11-22T12:38:15.000Z)

@g1nt0ki g1nt0ki merged commit c9b074b into DefiLlama:master Nov 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants