feat(yield): EVM yield aggregation — read-only layer (HCLI port 4/5) - #29
Open
JaeLeex wants to merge 1 commit into
Open
feat(yield): EVM yield aggregation — read-only layer (HCLI port 4/5)#29JaeLeex wants to merge 1 commit into
JaeLeex wants to merge 1 commit into
Conversation
`hl yield scan|aggregate|rank|optimize` — discover + rank + greedily allocate Ethereum+Base yield (DeFiLlama; net-APY = base+reward−gas−risk_haircut; ≤40%/ protocol, ≤6 positions). Pure modules ported verbatim from nunchi-cli-evm-yield (models/risk/optimizer/sources.base/sources.defillama); aggregator wraps the on-chain adapter import in try/except so it auto-enables once the EVM substrate lands. Execution layer (position/route/rebalance) deferred: agent-cli lacks common.evm (EvmClient/Multicall/TxExecutor) + trading.dex (Uniswap v3). Read-only layer is self-contained (pydantic + requests). Verified live: 3521 real pools.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part 4 of 5 of the HCLI → agent-cli port. Brings the EVM yield aggregator from
nunchi-cli-evm-yieldin ashl yield .... This is Ethereum + Base on-chain yield — fully independent of the Hyperliquid trading domain.What's new
hl yield scan/aggregate— discover yield opportunities across Ethereum + Base (DeFiLlamahttps://yields.llama.fi/pools), risk-scored.hl yield rank— rank by net APY =apy_base + apy_reward − gas_amortized − risk_haircut.hl yield optimize --budget N— greedy allocation under constraints (≤40%/protocol, ≤6 positions).--jsonfor machine-readable plans.Scope: read-only layer only (intentional)
The pure layer is ported verbatim from source (
models / risk / optimizer / sources.base / sources.defillama);aggregator.pywraps the on-chain-adapter import intry/except ImportErrorso the execution layer auto-enables once the EVM substrate lands — zero further edits.The execution layer (
position / route / rebalance) is deferred because agent-cli lacks the substrate it needs, and I will not fabricate it:common.evm(EvmClient / Multicall / TxExecutor / Erc20 / abi_loader) — absenttrading.dex(Uniswap v3 binding) — absentcommon.credentials.resolve_private_keyalready exists — not a blocker.)A follow-up PR can port
router.py+sources/onchain/*+ the bundled real address-book JSONs once that substrate is added. The read-only layer is self-contained (pydantic + requests + stdlib).Verification (live)
web3/common.evm/tradingall absent →ONCHAIN_ADAPTERS=[]).hl yield scan --chain all→ 3521 real pools (Ethereum + Base), sorted by gross APY; bluechip filter correctly ranks deep-TVL safe (maple/aave/ondo).hl yield optimize --budget 500000 --max-risk 0.3 --min-tvl 200000000→ diversified morpho-blue/lido/maple plan, caps enforced.Notes
main, independent of the other HCLI-port PRs.