[DO NOT MERGE] feat: pure-RPC on-chain position discovery (no subgraph) - #711
dglowinski wants to merge 1 commit into
Conversation
Sets accountPositionDiscovery='onchain' so the plan-time/fresh SDK instance discovers sub-accounts and positions via the SDK's deployless brute-force lens instead of the subgraph. Requires the linked euler-v2-sdk build with the AccountVaultsOnchainAdapter. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: euler-xyz/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🚅 Deployed to the euler-lite-pr-711 environment in euler-lite(dev,PR previews)
|
Summary
Adds a pure-RPC alternative to subgraph-based sub-account & position discovery. Previously the SDK's "onchain" account adapter still relied on a subgraph (
trackingActiveAccounts) to learn which sub-accounts and vaults an owner touches. This flips theonchainaccount path to discover positions entirely over RPC.This lite change is a one-line config: the
onchainadapter now setsaccountPositionDiscovery: 'onchain', so the plan-time/fresh SDK instance (which the portfolio loads through) uses the new discovery path.How it works (SDK side)
The heavy lifting lives in the SDK — branch
feat/onchain-account-discoveryineuler-xyz/euler-sdks(must be linked/published for this to run):AccountDiscoveryLens.sol) called viaeth_callwith notoanddata = creationCode ++ abi.encode(owner, subAccountIds, vaults, evc); the constructor brute-forcesvault.balanceOf(subAccount)for deposits andEVC.getControllers/debtOffor borrows, returning(address[][] deposits, address[][] borrows).subAccounts × vaultsworkload is split into chunks and fired as parallel unbatched eth_calls so the RPC provider spreads them; no single call approaches the eth_call gas ceiling.getControllersregardless of the vault set.Validation (
0x8A54C278D117854486db0F6460D901a180Fff517, mainnet, 21 active sub-accounts)trackingActiveAccountssubgraph queryNotes
feat/onchain-account-discovery); not mergeable until that lands and is versioned.vaultTypeAdapter: 'subgraph'), unchanged.🤖 Generated with Claude Code