Skip to content

Merging updates from defillama - #3

Open
iagoLD wants to merge 6777 commits into
Window-Finance:masterfrom
DefiLlama:master
Open

Merging updates from defillama#3
iagoLD wants to merge 6777 commits into
Window-Finance:masterfrom
DefiLlama:master

Conversation

@iagoLD

@iagoLD iagoLD commented Jul 18, 2022

Copy link
Copy Markdown

No description provided.

DenSmolonski and others added 28 commits July 8, 2026 11:36
* add shapeswap v3 yields

* Update index.js

* Update index.js

* chore: retrigger CI

* address review: fix prior-volume fallback, raw symbol, add protocolId
* feat: add T3tris Finance APY adapter

- Calculates 1d and 7d APY from share price growth (convertToAssets)
- Fetches historical blocks via coins.llama.fi/block API
- Reports vault metadata: fees, symbol, underlying asset
- Pool URL: https://app.t3tris.finance/vault/\{address\}
- Supports 15 chains

* fix: add xdai (Gnosis) chain to APY adapter

* fix: use oracle getLastSavedPricePerShare() for PPS instead of totalAssets/totalSupply

* fix: smooth APY with multi-window blending (7d/14d/30d) to handle infrequent oracle updates

* feat: T3tris integration

* fix(t3tris): update to protocol v1 proxy address + WAD-based fee getters

* feat(t3tris): source vaults from ecosystem API (verified & non-blacklisted) + landing URL

* fix(t3tris): BigInt-safe decimal math + axios timeouts (CodeRabbit)

* feat(t3tris-apy): match TVL curation filter + anchor APY at last NAV (extrapolate, no decay)

* fix(t3tris-apy): exclude public:false vaults from APY listing

Add a public !== false gate to the ecosystem-API vault discovery, on top of the existing verified + non-blacklisted curation filter, so vaults explicitly marked public:false are not surfaced in the yield listing.

* feat(t3tris-finance): replace APY blend with TVL+time-weighted linear formula

The previous inverse-day-weighted blend included 1d/3d windows with very
high weights (1/1 and 1/3), causing the blended apyBase to spike to 70%+
right after each oracle NAV update — far above the ~18-25% the app displays.

Fix:
- Replace computeSmoothedApy with computeTvlWeightedApy implementing
  YEAR × Σ(TVLᵢ·rᵢ) / Σ(TVLᵢ·Δtᵢ) — the exact formula used by the app
  (performance.service.ts in the indexer).
- Use non-overlapping intervals [LVT-30d→LVT-14d, LVT-14d→LVT-7d, LVT-7d→LVT]
  to avoid double-counting across overlapping lookback windows.
- Weight each interval by average totalAssets (fetched on-chain at each
  historical block alongside the oracle PPS read).
- Reserve 1d/3d windows as fallback only for vaults < 7 days old.

Result for 'First - USDC' (0x98e4…d01f, Arbitrum):
  before: apyBase ≈ 28–70% (oscillating with oracle update cadence)
  after:  apyBase ≈ 18.95%  (indexer M window = 18.33%, W window = 20.82%)

* fix(t3tris-finance): report oracle pricePerShare to avoid false negative fees

T3tris vaults have a settlement cycle: when deposits land, totalSupply
increases (shares are minted) BEFORE totalAssets is updated by the oracle.
This makes naive totalAssets/totalSupply drop (e.g. from 1.004 to 0.514),
triggering the DefiLlama fee test's negative-fee detection.

Fix: report the oracle's getLastSavedPricePerShare as the pool's
pricePerShare field. The oracle PPS only moves on valuation updates and
is immune to the deposit-settlement cycle.

* fix(t3tris-finance): address review feedback

- add protocolId (8068) matching the t3tris-finance slug
- report raw vault.symbol instead of utils.formatSymbol
- use a single fixed 7d APY window instead of the dynamic 7d/14d/30d blend for consistency across vaults
- remove the now-unused computeTvlWeightedApy helper and multi-window historical fetch

* fix(t3tris-finance): correct vault deep-link URL and simplify poolMeta

- URL: use /vaults/{chainId}/{address} (was /vault/{address}, which 404s)
- poolMeta: reduce to 'perf x%, mgmt x%' when mgmt > 0, else 'perf x%' (drop entry/exit fees)

Addresses review follow-up on #2735.

---------

Co-authored-by: blablalf <contact@alfred-gaillard.fr>
* Add vesting APY as reward APY to selected IPOR Fusion vaults

* Add fix to PR review comments

* Add HyperEVM and Robinhood chains support in Fusion by IPOR
* rename: stable-jack-v1 to stablejack-v1

* add migration file
* sky-lending: add SKY staking engine pool + savings deep links

- New pool: SKY staking engine rewards farm
  0xB44c2Fb4181D7cb06BdFf34a46FdFE4A259b40Fc (StakingRewards; staked
  token lsSKY is the engine's 1:1 SKY wrapper, priced via SKY).
- farmsAPY generalized: per-farm stake token/symbol/poolMeta/url instead
  of hardcoded USDS.
- sUSDS pools get per-pool urls to the savings widget (ethereum /
  arbitrumone), replacing the project-level homepage fallback.

* sky-lending: guard apyReward against zero-TVL farms

An active farm with zero staked balance would divide by zero and emit
apyReward Infinity; return 0 instead.

---------

Co-authored-by: techsqrt <techsqrt@users.noreply.github.com>
* superform: add Flare (chain id 14) to CHAIN_MAPPING

Routes chain_id 14 vaults from the /supervaults API through the
flare chain slug for on-chain calls.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix decimals for share price

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: kr3p <123127490+0xkr3p@users.noreply.github.com>
* fix(yieldfi): apy always 0 since gw.yield.fi vault metrics went empty, read apyHistory again

* coerce apy to number before rounding, api could return a string
* fix: d2-finance adapter, replace dead subgraph with onchain data across 5 chains

* d2-finance: single 30d apy window, add pricePerShare, drop poolMeta

* d2-finance: isolate per-chain failures, don't report unreadable history as 0% apy

* d2-finance: add per-pool url to the vault strategy page
* add pareto-credit adapter

* pareto-credit: drop formatSymbol, add pricePerShare and per-vault url

* pareto-credit: strip token symbol without regex to avoid metachar crashes

* pareto-credit: fix vault url to hash format, drop comments

* pareto-credit: url fragment should be the AA tranche address, not the vault
Co-authored-by: techsqrt <techsqrt@users.noreply.github.com>
* fix stake link liquid

* refactor to use new subgraph
…ult address) (#2811)

* pareto-credit: set token to AATranche address

token was never set on the returned pool object, so the yield-server
fallback regex grabbed the first 0x address in the pool id (the CDO
vault contract) instead of the actual depositor receipt token.
tranches[i] (the AATranche address) is already fetched and used for
getApr/virtualPrice/name in this same function - just wasn't wired
into the pool object.

Verified locally: npm run test --adapter=pareto-credit passes
(131/131), same 14 pools, same TVL/APY/pricePerShare numbers - only
the token field is new. Also separately verified the pricePerShare
scaling is correct (underlying is USDC, 6 decimals, virtualPrice
scales against it correctly) - not a bug, unrelated to this fix.

* pareto-credit: guard against nullish tranches[i]

multiCall runs with permitFailure: true, so tranches[i] can come back
nullish if that specific on-chain call fails for a given vault. The
existing guard checked token/price/contractValues[i] but not
tranches[i] - harmless before this PR since it was only interpolated
into a URL string, but now that .toLowerCase() is called on it
directly for the token field, a nullish value would throw and crash
the whole adapter (all 14 pools) instead of just skipping the one
bad vault.

Addresses CodeRabbit review comment on #2811.
* Add Uniswap v3 and v4 on Monad

* Use cursor instead of skip

* reduce chunk to 50 & dedupe pools

---------

Co-authored-by: kr3p <123127490+0xkr3p@users.noreply.github.com>
0xkr3p and others added 30 commits August 26, 2026 09:16
* add fallback

* fix vol
Monetrix mxHYPE was listed as its own protocol (id 8519, slug
monetrix-mxhype) under parent#monetrix, alongside Monetrix USDM (id 8019).
This adds the matching yield adapter for its staking vault.

smxHYPE is an ERC4626 vault over mxHYPE (24-decimal shares, 18-decimal
asset). APY comes from share-price growth over a trailing 7-day window,
clamped to the first production stake (2026-08-17 10:12:20 UTC). Both sides
of that ratio are denominated in mxHYPE, so apyBase is a HYPE-denominated
return and carries no HYPE price move; the WHYPE price is used only for
tvlUsd.

src/adaptors/monetrix-usdm is left unchanged.
Keep Neverland pool coverage aligned with on-chain configuration and
avoid publishing incomplete market or reward data.

- discovered providers and market metadata through the registry
- isolated bad providers and rejected empty lending output
- derived pool metadata, URLs, and route groups per registered market
- kept reward APYs unresolved when prices or decimals were missing
* Add XOXNO lending yield adapter

* fix(xoxno-lending): correct protocolId + add hub/spoke routing pools

- protocolId 8049 -> 8109 (the registered xoxno-lending DefiLlama protocol);
  fixes the 'protocolId matching its protocol slug' test.
- Read the export's hubMarkets (per hub/asset, with APY) and spokeMarkets
  (per spoke/hub/asset). Hub pools carry the yield with poolMeta = hub name
  (Core/RWA). Spoke reserves emit as poolKind 'routing_reserve' with
  poolMeta 'hub / spoke', LTV, borrowability and per-spoke debt but no APY,
  mirroring Aave V4's Core / <spoke> layer.
- Deep-link each pool to its XOXNO page (hub + spoke/hub/asset).

* chore(xoxno-lending): drop fromAsset query from spoke URL fallback

* fix(xoxno-lending): allowlist routing rows so spoke reserves persist

Mirror the aave-v4/euler-v2/exactly treatment: routing_collateral and
routing_reserve pools carry no APY, so without an allowlist entry they are
dropped by the all-APY-null filter and never reach the pools table. Add
xoxno-lending so its Aave-V4-style spoke reserves survive ingestion.

* xoxno-lending: correct the User-Agent

Left over from the Dune prototype this adapter was derived from; it is not a
Dune client. Also re-runs CI against the current API, whose token metadata now
resolves mainnet contract ids — the previous run predates that cutover and
reported testnet markets with testnet symbols.

* xoxno-lending: restore the required User-Agent

Reverts the previous rename. api.xoxno.com expects this specific User-Agent
for API access; it is not a descriptive label. Commented so it is not changed
again.

* xoxno-lending: add MultiversX pools, and bound availableBorrowUsd by liquidity

MultiversX is a flat market model: rates and risk params share a row, so
there is no routing layer and each market is an ordinary yield pool. It is
listed under CHAIN 'Elrond', the name in api.llama.fi/chains; 'MultiversX'
is not a valid chain name and fails the adapter test.

Two fixes to the existing Stellar pools:

- Spoke availableBorrowUsd was borrow-cap headroom, which routinely exceeds
  the liquidity actually present: the XLM spoke advertised $5.25M against
  $1.5K of hub cash. It is now min(cap headroom, hub cash), as Aave does.
- token is set to null explicitly on hub pools. Positions are NFTs rather
  than per-market receipt tokens, so no 1:1 pool token exists, and the
  handler's fallback only recognises 0x addresses.

Also drops an API base-URL env override that nothing sets.

* ci: restore the pool table in adapter PR comments

The comment builder slices from "Test Suites:" onward, on the assumption that
afterTests.js output follows the jest summary. afterTests.js is a jest
globalTeardown writing to stdout, while jest buffers its reporter output and
writes it to stderr, so the order is not guaranteed. Since CI was pinned to
Node 24 (8e1fecb) the pool block is flushed first and the slice drops it:
every adapter PR comment since has shown the test counts with an empty pool
list.

Anchoring on "Nb of pools:" instead is not enough. Between that line and the
summary sits jest's per-test output -- 685 lines and 97KB on this adapter --
which pushes the comment past GitHub's 65536-character limit, so it fails to
post at all. The pool block is therefore cut at the first reporter marker and
stitched onto the summary, and capped like the failure detail already is.

Verified against a real CI log and a local run, i.e. both orderings:

  Node 24 order   10216 chars, table + summary
  local order      6791 chars, table + summary

both within the limit, against 3644 chars with no table today. The failure
path is unchanged.

* xoxno-lending: isolate chain failures, fix EGLD pricing, link spokes to hubs

Addresses the review on #2753.

getExport throws on any non-2xx, and the chains were fetched in one
sequential loop, so a Stellar blip dropped the MultiversX pools too.
Each chain now builds independently under Promise.allSettled and a
rejection is logged rather than swallowed. Verified by stubbing a 503 on
the Stellar export: all 17 MultiversX pools still come through.

DefiLlama prices native EGLD under the null address, so `elrond:EGLD`
resolved to nothing and the EGLD market carried no price. Map it the way
the TVL adapter does.

Spoke rows carried no link back to the hub that holds the asset's state,
and routeGroupKey was a bare spoke id ("1", "2") that would collide the
moment a second chain gets a hub/spoke model. Spokes now set
underlyingStateKey to the hub/token pair, hub rows expose the same key,
and routeGroupKey is namespaced by chain. All 57 spoke rows resolve to a
hub row; none are orphaned.

Symbols were also flagged. Those are fixed upstream in the API export
rather than patched here, so the adapter keeps passing `symbol` through
and picks up the corrected values on deploy.

npm test --adapter=xoxno-lending: 1277 passed, 99 pools.

* Revert "ci: restore the pool table in adapter PR comments"

This reverts commit cb71089.
Arcadia's lending markets are live on Robinhood Chain (4663): wETH and USDG. The
chain has no USDC, so USDG is its dollar market and the assets map lists it under
that name — the map only feeds getMaxCollFactor, which reads the highest
collateral factor across a chain's assets.

Two values read zero today and both are correct rather than missing. apyBase is
zero because nothing has been borrowed yet, so there is no interest to share with
suppliers; getRiskFactors returns 0/0 because the margin risk parameters are not
set on chain yet, so ltv is 0. Both start reporting on their own once those land,
with no change here.

Pool ids follow the existing rule: the wETH pool has the same address on every
chain, so the suffix keeps `-robinhood` distinct from Base's bare address.

Verified with `npm run test --adapter=arcadia-v2`: 69 assertions pass and seven
pools are returned, the two new ones at 12 and 13 USD TVL with 6% and 8% borrow
APY, matching the pools' interestRate on chain.
* feat(vetro): add yield adapter for sVUSD and svetBTC

* refactor(vetro): dynamic yield calculations and live price fetching

* fix(vetro): set official protocolId to 8528

* refactor(vetro): use utils.getPrices and add pool URLs

* fix(vetro): preserve APY precision in reward rate calculation

* refactor(vetro): clean up APY denominator scaling

* refactor(vetro): dynamic VUSD pricing via utils.getPrices and fix APY scaling

* remove toFixed(2) from apy

---------

Co-authored-by: kr3p <123127490+0xkr3p@users.noreply.github.com>
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.