-
Notifications
You must be signed in to change notification settings - Fork 2k
Add 0xEquity rental income (fees/revenue, Base) #8039
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
Open
asimashfaq
wants to merge
2
commits into
DefiLlama:master
Choose a base branch
from
asimashfaq:add-0xequity-fees
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+73
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| import { FetchOptions, SimpleAdapter } from "../../adapters/types"; | ||
| import { CHAIN } from "../../helpers/chains"; | ||
|
|
||
| /* | ||
| * 0xEquity — rental income (Fees & Revenue) on Base. | ||
| * | ||
| * 0xEquity tokenizes real estate; each property's off-chain rental income is | ||
| * proven on-chain, trust-minimized, in the IncomeAttestationRegistry. A period | ||
| * (calendar month, periodId = YYYYMM) is "fully proven" only when two independent | ||
| * paths agree: a threshold-signed attestation (Path A) AND a Reclaim zkTLS proof | ||
| * of the same bank statement (Path B). On finalize the registry emits | ||
| * `FullyProven(token, periodId, totalMinor)` where totalMinor is the gross rental | ||
| * income for that property/month in USD minor units (cents). | ||
| * | ||
| * We treat that proven rental income as protocol Fees, and — since it accrues to | ||
| * the property-token holders (the suppliers of capital) — as supply-side revenue. | ||
| * The protocol's own management-fee cut is not yet counted here (see methodology). | ||
| */ | ||
|
|
||
| // IncomeAttestationRegistry (Base mainnet, source-verified). Holds every property's | ||
| // proven monthly rental income; emits FullyProven on finalize. | ||
| const REGISTRY = "0xa67edcec210147b85b589313b05e04c680fdef02"; | ||
|
|
||
| const FULLY_PROVEN_EVENT = "event FullyProven(address indexed token, uint256 indexed periodId, uint256 totalMinor)"; | ||
|
|
||
| const fetch = async (options: FetchOptions) => { | ||
| const dailyFees = options.createBalances(); | ||
| const dailySupplySideRevenue = options.createBalances(); | ||
|
|
||
| // Each FullyProven log = one property/month of proven gross rental income. | ||
| const logs = await options.getLogs({ | ||
| target: REGISTRY, | ||
| eventAbi: FULLY_PROVEN_EVENT, | ||
| }); | ||
|
|
||
| for (const log of logs) { | ||
| // totalMinor is USD cents -> USD | ||
| dailyFees.addUSDValue(Number(log.totalMinor) / 100, "Rental Yield"); | ||
| dailySupplySideRevenue.addUSDValue(Number(log.totalMinor) / 100, "Rental Yield to Property Holders"); | ||
| } | ||
|
|
||
| // Protocol-retained cut (management fee) not yet quantified on-chain -> 0. | ||
| const dailyRevenue = options.createBalances(); | ||
|
|
||
| return { dailyFees, dailyRevenue, dailySupplySideRevenue }; | ||
| }; | ||
|
|
||
| const methodology = { | ||
| Fees: "Gross rental income earned by 0xEquity's tokenized real-estate properties, as proven on-chain in the IncomeAttestationRegistry. A month is counted only when it is fully proven by two independent paths (a threshold-signed attestation and a Reclaim zkTLS proof of the same bank statement) that agree on the amount.", | ||
| SupplySideRevenue: "All proven rental income, which is distributed to the property-token holders (the suppliers of capital) as yield.", | ||
| Revenue: "Protocol-retained management fee. Not yet quantified on-chain; reported as 0 until confirmed.", | ||
| }; | ||
|
|
||
| const breakdownMethodology = { | ||
| Fees: { | ||
| "Rental Yield": "Gross rental income earned by 0xEquity's tokenized real-estate properties, as proven on-chain in the IncomeAttestationRegistry. A month is counted only when it is fully proven by two independent paths (a threshold-signed attestation and a Reclaim zkTLS proof of the same bank statement) that agree on the amount.", | ||
| }, | ||
| SupplySideRevenue: { | ||
| "Rental Yield to Property Holders": "All proven rental income, which is distributed to the property-token holders (the suppliers of capital) as yield.", | ||
| }, | ||
| } | ||
|
|
||
| const adapter: SimpleAdapter = { | ||
| version: 2, | ||
| pullHourly: true, | ||
| fetch, | ||
| chains: [CHAIN.BASE], | ||
| start: "2026-06-18", | ||
| methodology, | ||
| breakdownMethodology, | ||
| }; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| export default adapter; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
Consider adding
Revenue: {}tobreakdownMethodologyfor completeness.No labels are added to
dailyRevenueso it's not strictly required, but including an emptyRevenueentry makes it explicit that revenue is intentionally zero and prevents confusion for future maintainers adding revenue labels.♻️ Suggested addition
const breakdownMethodology = { Fees: { "Rental Yield": "Gross rental income earned by 0xEquity's tokenized real-estate properties, as proven on-chain in the IncomeAttestationRegistry. A month is counted only when it is fully proven by two independent paths (a threshold-signed attestation and a Reclaim zkTLS proof of the same bank statement) that agree on the amount.", }, SupplySideRevenue: { "Rental Yield to Property Holders": "All proven rental income, which is distributed to the property-token holders (the suppliers of capital) as yield.", }, + Revenue: {}, }📝 Committable suggestion
🤖 Prompt for AI Agents