Skip to content

feat: add arm history user tracking for earned and roi values#77

Open
toniocodo wants to merge 4 commits intomainfrom
feat/arm-roi
Open

feat: add arm history user tracking for earned and roi values#77
toniocodo wants to merge 4 commits intomainfrom
feat/arm-roi

Conversation

@toniocodo
Copy link
Copy Markdown
Collaborator

No description provided.

@toniocodo toniocodo requested a review from apexearth May 1, 2026 08:12
Comment thread src/templates/origin-arm/origin-arm.ts Outdated
state.assetsPerShare,
)
const armDayApy = calculateArmDailyApy({ block, state, previousDailyStat })
await updateDailyAddressEarnings(block, state)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

My main concern is pulling and updating all addresses on every processing interval here. My move to improve it would be to hold the addresses in memory and avoid pulling from db when possible. Probably not a big deal here yet as I'd guess unique arm address count is low.

timestamp: DateTime!
blockNumber: Int! @index
txHash: String! @index
type: HistoryType!
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see the use of the Yield field here but the Sent/Received I feel unsure about since we can take advantage of the ERC20 processing we already have. (createERC20EventTracker(...) added at the bottom of origin-arm.ts)

Perhaps better would be ArmAddressYield to track yield earnings over time.

tldr the point of the erc20 tables is so we don't have to recreate erc20 logic repeatedly.

@apexearth
Copy link
Copy Markdown
Collaborator

I'll make some changes and ask for your input on them @toniocodo

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.

2 participants