Merging updates from defillama#3
Open
iagoLD wants to merge 6239 commits into
Open
Conversation
* remove burned supply * exclude burn addresses * update to fetch 13
* add ankr fallback for suspicious data * update comment * cleaner * remove == null pools * ensure project gets triggered * remove dead code
* Refactor LP price calculation and APY function * Enhance fallback APY calculation and add URL Added fallback chart URL and improved fallback APY logic. * Update index.js * Update index.js * Update index.js * Update index.js * Update index.js * Update index.js * Update index.js * Update index.js * Update index.js * Update index.js * Update index.js Switched to a stable 7d APY as the main metric and added apyBase30d for additional context. Also improved robustness with retries and block fallback for all on-chain reads. All checks are passing, ready to merge. * Update index.js Now using a stable 7d APY as the main metric with proper error handling and block fallback. All checks should pass. * fix: restore compounding APY, single 7d window, cleanup fields - Restore compound annualization (Math.pow) instead of linear - Use single 7d window for apyBase, remove redundant apy/apyBase7d - Fix rewardTokens: null -> [] - Lowercase underlyingTokens addresses Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: kr3p <123127490+0xkr3p@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add surf-liquid yield adapter
Pools:
- USDC/WETH/cbBTC vault pools with Morpho lending APY (after 10% fee)
- SURF staking pool (14% for 6M, 18% for 12M lock)
APY is sourced from Morpho GraphQL API for the underlying vaults
that Surf Liquid deposits into, with 10% performance fee deducted.
* Address reviewer feedback: on-chain APY, pool IDs, remove GraphQL dependency
- Replace Morpho GraphQL API with on-chain share price calculation
(totalAssets/totalSupply at current vs 1-day-ago blocks)
- Derive staking APR from on-chain contract (apr6Months, apr12Months,
BASIS_POINTS) instead of hardcoded value
- Change pool IDs to use contract addresses (factory/staking address + chain)
- Remove graphql-request dependency
- Get asset prices from coins.llama.fi instead of Morpho API
* Address reviewer feedback: remove hardcoded fallbacks, guard edge cases
- Remove totalSupply fallback to '1'; skip vaults with zero supply instead
of fabricating APY values
- Guard BASIS_POINTS against zero before APR division
- Use total TVL (staking + subscriptions) for visibility threshold
- Only add rewardTokens/apyReward when reward APY > 0
- Clean up BigInt comparisons to use 0n literals
* fix pool IDs to use asset address, remove inflated staking TVL, simplify poolMeta
- Pool IDs now use asset address instead of symbol for stability
- Remove CreatorBid subscription TVL from staking pool (different mechanism)
- Simplify poolMeta to '6M / 12M lock' (APR already in apyReward)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* shorten vault pool IDs to surf-{asset}-{chain}
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: kr3p <123127490+0xkr3p@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* add stakeTHENA * enable timetravel * enable timetravel --------- Co-authored-by: root <root@server1.eliteness.network>
* fix(superform): use onchain methods to calculate apy * protect if no address
* handle merkl missing apr * fix: add APR fallback chain to prevent reward dropout during Merkl recomputation Merkl API intermittently returns apr=0 for FIX_REWARD_VALUE_PER_LIQUIDITY_VALUE campaigns during recomputation windows. This caused DefiLlama to store null apyReward. Mirrors the backend's getCampaignApr 3-level fallback: campaign.apr > Opportunity.apr > params.distributionSettings.apr Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add Townsquare * Add Merkl rewards
* onchain fallback aerodrome-slipstream * fix
* Add Apyx Protocol yield adapter * fix: use Promise.all for concurrent calls and multiply by token price * fix: guard against undefined token price from price API * rename: apyx-protocol -> apyx * fix: rename adapter dir to match protocol slug apyx-protocol The CI test requires the adapter directory name to match a known DeFiLlama protocol slug. The protocol is listed as "apyx-protocol" so the directory and project field must match. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove incorrect token field The token field is extracted from the pool id, so setting it explicitly to the wrong value causes issues. Removed to let the system derive it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: kr3p <123127490+0xkr3p@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* update the adapter to use the ekubo campaigns endpoint * bigint chain ids * address comments * address comments from the bot * address finding * address another nitpick * address comments
* add fluxion network adapter * per pool url
* chore: add api.berachain.com tracking * berapaw operation name * fix nan for pools in berapaw
- Fetch pairs and volume data for both Kasplex and Igra - Uses existing backend API with ?network=igra parameter - Same 1% fee structure and APY calculation Igra DEX Factory: 0x21350BcDa9E81731CF4cDE3DbC457e3de2739c01 Co-authored-by: Marko (KaspaCom Bot) <marko@kaspacom.com>
… category (#2694) * refactor(scrubvault): publish under scrubvault slug for Basis Trading Follow-up to #2678 (merged). The pools were mapping to the "Scrub" protocol (category Algo-Stables) because the adapter used project 'scrub'. The delta-neutral vaults belong to the separately-registered "ScrubVault" protocol, which DefiLlama already categorizes as Basis Trading (chains Kava + Arbitrum). - git mv src/adaptors/scrub -> src/adaptors/scrubvault - PROJECT 'scrub' -> 'scrubvault' Satisfies test.js project==adapterName and known-slug checks. Verified live: both pools return, APR ~15%, pps 1.0381 / 1.0204. * fix(scrubvault): use PROJECT constant in error log prefix Addresses CodeRabbit review on #2694: the per-vault error log still hardcoded "[scrub]"; use `[${PROJECT}]` so the prefix tracks the slug constant and stays consistent. --------- Co-authored-by: TheG <theg@gmail.com>
* feat: 🎸 added saturn trache * fix: 🐛 fix precision error
* Add vesting APY as reward APY to selected IPOR Fusion vaults * Add fix to PR review comments
* Add Unblock Equity yield adapter — 24 vaults on Base
UnblockEquity is a tokenized junior-lien home-equity lending protocol on Base.
Depositors fund 24 segmented MetaMorpho vaults (verification × recovery × escrow tier);
borrowers (homeowners) collateralize tokenized property liens (ERC-1155).
TVL adapter for the protocol was merged in DefiLlama-Adapters#19102.
This PR adds the matching yield-server adapter so APYs surface on /yields.
- TVL: live from each vault's totalAssets() (ERC4626)
- APY: modeled equilibrium yield from each vault's published risk model
(PD × LGD → net yield). Matches the displayed APY in the protocol's
earn page and the published risk whitepaper. Live IRM rates are
intentionally NOT used because Morpho's adaptive-curve IRM drifts
toward zero on idle high-utilization markets, which would
misrepresent the long-run yield depositors actually earn.
- Verified: 24/24 vaults addressable, total TVL $11.8K (matches on-chain).
- APY range across 24 pools: 7.50%–9.26%
Adapter URL: https://app.unblockequity.com/earn
DefiLlama protocol page: https://defillama.com/protocol/unblock-equity
* unblock-equity: address maintainer review
- Switch from raw ethers to @defillama/sdk multicall pattern
- Drop hardcoded netYield; compute supply APY dynamically from on-chain
Morpho IRM (borrowRateView × utilization × (1 - fee))
- Add RPC-outage guard: throw if totalAssets() fails for all 24 vaults
- IRM call skipped when supply = 0 (avoids unnecessary calls for empty markets)
Per @0xkr3p review feedback in PR #2659.
* unblock-equity: use per-market irm address (future-proof per CodeRabbit nit)
Read each market's IRM address from the on-chain market params (p.irm)
instead of hardcoding the AdaptiveCurve IRM constant. If any market ever
switches IRM, the adapter still calls the correct contract.
* unblock-equity: add pricePerShare per @0xkr3p review
Multicalls each vault's totalSupply() alongside totalAssets(), then computes
pricePerShare = (totalAssets / 10^assetDec) / (totalSupply / 10^shareDec).
Assets are USDC (6 dec), shares are 18 dec.
Empty vaults default to pricePerShare = 1.0.
Live genesis vault currently shows pps = 1.00055278.
* unblock-equity: add IRM-outage guard (symmetric with TVL guard)
If every funded market's borrowRateView() call fails, abort instead of
publishing 24 pools with apyBase = 0 (misleading-data parity with the
existing totalAssets() guard). Per CodeRabbit review in PR #2659.
---------
Co-authored-by: Vladimir Mirzoyan <vladimirmirzoyan@gmail.com>
* Add Circuit protocol yield/APY adapter * Fix import path: use ../utils instead of ../helper/http * Add apyBase: 0 and apyReward: 0 to XCH vault pool to prevent filtering * Fix HTTP helper: use getData from ../utils instead of get * Harden numeric parsing with toNum helper to avoid NaN outputs * yield adapter: add ltv field from on-chain liquidation ratio statute * yield adapter: make statutes fetch non-fatal; guard ltv to [0,1] * yield adapter: rename pools to circuit-collateral-vault and circuit-savings-vault
* moonwell lending fix * fix underlying
* add centrifuge APY feeds * revert package-lock.json changes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * address PR review: pagination, timeouts, null APY fallback - Add cursor-based pagination to fetchVaults() for >200 vaults - Add 15s HTTP timeout to axios calls - Use null instead of 0 when APY cannot be computed Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * rename adaptor to centrifuge-protocol to match DefiLlama slug The CI test checks that the project field matches a known protocol slug from api.llama.fi/protocols, which lists it as "centrifuge-protocol". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * add GraphQL response validation and skip vaults with missing decimals Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * address review: use 7d APY, add pricePerShare, parallelize chains - Prefer apyBase7d over 1d for more stable yield representation - Add pricePerShare field (share price in underlying asset terms) - Process chains concurrently via Promise.allSettled for speed Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix pricePerShare scaling for non-18 decimal share tokens Account for share token decimals when computing pricePerShare from convertToAssets(1e18). The divisor is now 10^(assetDecimals + 18 - shareDecimals) instead of just 10^assetDecimals, which was only correct when shares had 18 decimals. Also skip vaults with missing share token decimals. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix dedust adapter * dedust fixes
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.
No description provided.