Skip to content

Merging updates from defillama - #3

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

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

Conversation

@iagoLD

@iagoLD iagoLD commented Jul 18, 2022

Copy link
Copy Markdown

No description provided.

slasher125 and others added 28 commits July 20, 2026 17:00
Since Hipo's treasury upgrade, get_treasury_state returns the pool
exchange rate before/after the latest round (previous_rate/current_rate)
at stack positions 11/12, replacing last_staked/last_recovered. The rate
advances once per validation round, so the growth must be compounded per
single round duration; the old 2-round duration halved the APY (showed
~8.3% instead of the actual ~17.3%). Also adds apyBaseInception derived
from the launch exchange rate of 1.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Throw on non-finite or non-positive rates and round duration instead of
falling back to a 0% APY when treasury data is malformed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* add arcadia OP lending pools

* Coderabbit review pr fixes - handle missing price gracefully
#2842)

* gami-labs: migrate WBTC vault to T3tris/Robinhood, add Midas turtlePST

* fix: Comments DefiLlama PR

* fix: Receipt token Stellar Vaults
* Add apyee yields adapter

* fix(apyee): guard against null r.value in apy loop

* refactor(apyee): use getPrices helper for underlying USDC pricing

Replace the hardcoded $1 assumption with the DefiLlama price helper
(getPrices) so reported TVL reflects the actual on-chain USDC price,
per maintainer review.

---------

Co-authored-by: kr3p <123127490+0xkr3p@users.noreply.github.com>
* Add STRATO (Mercata) yield adapter

Surfaces STRATO/Mercata yield products on yields.llama.fi, read purely via
eth_call against the public STRATO RPC (chain `strato`, protocolId 7862):

- saveUSDST savings vault (apyBase from the per-second savings rate)
- USDST lending pool / lendUSDST (supply apyBase + borrow apy)
- STRATO staking (apyReward in STRATO)
- AMM LP pools (TVL from reserves; TVL-only for now)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Fix comment for STRATO institutional L1 description

* Address PR review feedback on STRATO adapter

- Remove STRATO_RPC env var override; strato is in the latest @defillama/sdk
- Lending: compound the supply per-second rate before annualizing (was
  overstating supply APY by scaling the annual borrow APY)
- Lending: report available cash as tvlUsd, keep gross supply/debt in
  totalSupplyUsd/totalBorrowUsd; gate the pool on totalSupplyUsd to match
  downstream lending filtering
- Staking: require periodStart <= now so future scheduled reward periods
  don't advertise APY

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Address review feedback: per-pool urls, pricePerShare, drop AMM pools

- url: point each pool at its own app page (/dashboard/earn-save,
  /dashboard/earn-lending, /dashboard/earn-staking) instead of one shared link
- drop utils.formatSymbol (only used for the removed AMM pair symbols)
- drop the local MIN_TVL_USD / totalSupplyUsd filter; the runner does this
- add pricePerShare for the two pools that have a share token: saveUSDST
  (exchangeRate) and lendUSDST/mUSDST (getExchangeRate), both 1e18-scaled.
  Staking has no receipt token in phase 1, so no pricePerShare there.
- remove the AMM LP pools: the swap-fee rate has no public getter over
  eth_call, so base APY can't be computed yet

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
slasher125 and others added 30 commits September 21, 2026 15:20
* feat: add 3F yield adapter

3F provides leveraged exposure to tokenized RWAs, looping them through
Morpho Blue markets. Each leverage tier is a separate PositionManager
ERC-20 whose totalAssets() is the tier's NAV in the debt asset.

Publishes one pool per deployed tier across the wJAAA (Janus Henderson
Anemoy AAA CLO), wUSCC (Bitwise Crypto Carry), wFalconX (Pareto AA
tranche) and wmGLO (Midas Fasanara Global Open) markets.

- tvlUsd  : PositionManager.totalAssets(), i.e. depositor equity net of
            borrowings, so it does not double-count the collateral already
            counted by the underlying Morpho Blue market.
- apyBase : realised share-price growth over a trailing 7-day window,
            annualised. Net of borrow cost and of both fees, since fee
            shares dilute. RWA NAV oracles step daily or slower, so a 24h
            window either catches a whole step or none of it; at 8-17x
            leverage that annualises into the hundreds of percent. Seven
            days spans several steps and gives a stable rate.

All values read on-chain at run time; no 3F API dependency.

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

* fix: declare protocolId on the 3F adapter

CI requires protocolId as a string literal inside module.exports. 3F's
DefiLlama protocol id is 7923 (slug "3f", TVL adapter three-f/index.js).

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

---------

Co-authored-by: yieldhunting <yieldhunting@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
…ed-pools

fix: filter expired Pendle V2 yield pools
Same schema and the same raw token amounts, which are all this adapter
reads; 1.1.0 also fills the USD fields that read 0 on 1.0.0, so the old
version can be retired.
…3015)

* fix(nolus-protocol): read active pools from ETL and fix LPN decimals

Fetch the active protocol list from the Nolus ETL instead of a hardcoded
Osmosis/Neutron contract table, so newly launched pools (currently the
four Solana-Metis LPPs) appear without an adapter change.

Use the pool oracle's decimal_digits for the stable-price adjustment
rather than a ticker-wide lookup: WETH is 18 decimals on Osmosis but 8
on Solana, and the ticker-wide value inflated Solana WETH TVL by 1e10.

Add coingecko ids for CB_BTC and WETH, and drop the bare USDC -> Axelar
poolMeta override, which mislabelled native Solana USDC.

* fix(nolus-protocol): scale LPN price in both directions for decimal difference

* fix(nolus-protocol): expose cbBTC pool symbol as CBBTC
* Add PARE (pToken fixed rates, Robinhood Chain)

Project: pare (listed on DefiLlama as PARE)
Pools: one per live series (pSPY, pAAPL, pQQQ, pPFE, all DEC27), plus the pPFE-DEC27/USDG
Uniswap v3 pool.
apyBase (pToken rows): the fixed rate from buying the pToken at its Uniswap v3 price and holding
to maturity, where it redeems for one stock token. Computed from the pool's slot0 and the time to
2027-12-31. tvlUsd: stock tokens held by the series vault.
apyReward (pool row): Merkl's live USDG campaign on the pool (daily rewards from the Merkl API)
over the pool's TVL read from its balances, the pToken priced by the pool itself. rewardTokens: USDG.

* Add protocolId to module exports

* Refactor series data and update APY calculationsChanges

Updated. The series list now comes from our on-chain registry (0x44aB19D42E45CA53E380A7E6CFa95e87a4c0E4A5, vaults()), and each vault supplies its stock, pToken and maturity; pools resolve through the Uniswap v3 factory. poolMeta trimmed. New series list themselves.

* use merkl get, re-add original pool meta

---------

Co-authored-by: kr3p <123127490+0xkr3p@users.noreply.github.com>
* fix(satsuma): replace deleted subgraph with on-chain data source

The Goldsky analytics subgraph the adapter queried was deleted upstream,
so every request 404s and Satsuma has been missing from yields.

Rebuild on sources that cannot go stale the same way: TVL and 24h volume
from Satsuma's public /pool-stats endpoint (derived from Swap logs over
RPC), and token0/token1/symbol/fee read from the pools via batched
eth_call. Algebra pools use a dynamic fee, so fee() is read per pool.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Szi7Q56pDzLiweiCZKrhZV

* feat(satsuma): add gauge emission reward APY

Read weekly xSATS emissions per pool from the s33 Voter gauges (latest
distributed period) and price SUMA from the SUMA/ctUSD pool sqrtPrice,
since SUMA is not on the coins API. Exposes apyReward + rewardTokens.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Szi7Q56pDzLiweiCZKrhZV

* fix(satsuma): address review - timeouts, strict RPC results, endpoint fee totals

- Bound every axios call with a 30s timeout so apy() rejects instead of
  hanging on a stalled RPC or stats endpoint.
- Throw on JSON-RPC items that carry an error or no result rather than
  mapping them to null and publishing partial pool data.
- Use the stats endpoint's feesUSD24h (accumulated per swap at the fee in
  force at the time) instead of volume * current dynamic fee; drops the
  fee() call.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Szi7Q56pDzLiweiCZKrhZV

* fix(satsuma): publish gauge emissions on ICHI vault records, not AMM pools

xSATS emissions only reach depositors of a gauge's two ICHI vaults, so
they no longer appear on the Algebra pool record. Each live gauge now
gets its own record (poolMeta "ICHI vault") with the vaults' combined
TVL from getTotalAmounts(), valued with the same price map /pool-stats
uses for pool TVL, and apyReward against that TVL. SUMA is priced from
the same map, replacing the sqrtPrice derivation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Szi7Q56pDzLiweiCZKrhZV

* fix(satsuma): drop hosted endpoint, net ICHI TVL, apply xSATS exit penalty

Address review on #2969:

- TVL is computed on-chain (pool token balances) and priced with
  coins.llama.fi. Tokens coins.llama.fi does not list (SUMA, ZNT) are
  valued off the Satsuma pool pairing them with a priced token, only when
  that pool's priced side holds at least $1k.
- 24h volume and fees come from the pools' Swap logs. Each swap is
  preceded by a pool event carrying the fee actually applied (ppm), so the
  dynamic fee is exact per swap rather than volume * current fee. The
  Algebra community fee (50%) is removed so apyBase reflects what LPs get.
- AMM rows net out the liquidity ICHI vaults hold in the pool, so AMM and
  vault rows partition the pool instead of double counting it.
- xSATS rewards are valued at 50% of SUMA (instant-exit slash).
- Symbols are passed raw instead of through utils.formatSymbol.
- The s33-epoch-cron workers.dev endpoint is no longer used.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Tiago Pratas <tiagotpratas@gmail.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
* add stackingdao yields + fix zest v1/v2 adapters

- stackingdao: stSTX and stSTXbtc APY from latest on-chain PoX claim batch, stBTC from trailing sbtc-per-stbtc ratio
- zest-v2: read v0-5-data, add stBTC vault, fix stSTXbtc price key, publish supply and borrow totals
- zest-v1: read pool-read-v2-1-4, cover all priced assets including sBTC, price via coins API

* retry hiro reads on rate limits in stacks yield adapters

- route zest-v1 and zest-v2 contract reads through axios so withRetry can see 429 and 5xx responses
- use the shared withRetry helper with 8s exponential backoff in all three adapters

* address review: timeouts, active supply, stbtc exchange rate

- set a 30s timeout on every axios request so stalled connections fail fast and retries can run
- stackingdao: subtract live escrow and pending shares from stSTX and stBTC supply, propagate hiro errors from the burn-block scan instead of treating them as missing history
- zest-v2: price the stBTC vault through get-sbtc-per-stbtc instead of assuming 1:1 with sBTC

* address review: reward projection, stbtc apy, egroup ltvs

- stackingdao: include bond manager claims in the reward pot and project the
  batch by pox-5 distributions covered instead of reward-phase progress
- stackingdao: derive stbtc apy from growth of the effective sbtc-per-stbtc
  ratio since the reward stream start, add isIntrinsicSource and pricePerShare
- zest-v2: publish ltv per market, resolved live from the active efficiency group

* stackingdao: cycle fallback and active-share ratio denominator

- select the newest claim cycle with a usable reward batch instead of the
  highest cycleId, so a zero-sat or pre-distribution batch cannot suppress
  both LST pools
- divide the accrued-but-unreleased stBTC rewards by active shares (supply
  minus pending) to match the get-sbtc-per-stbtc denominator
Co-authored-by: pawel-accountable <282215858+pawel-accountable@users.noreply.github.com>
#3019)

* optimized enriched pool lookup with map instead of array, O(n) -> O(1)

* remove test

---------

Co-authored-by: kr3p <123127490+0xkr3p@users.noreply.github.com>
* feat: add Elara Finance yield adapter

* fix: keep Node checks out of Jest discovery

* test: assert Elara RPC call targets

* fix: align Elara yield with DefiLlama methodology

* fix: add elUSD price fallback and remove readme
* Add Motoswap adapter

* Set project slug motoswap-farm and protocolId 8653

The DefiLlama-Adapters listing (PR 21035) went live as slug motoswap-farm, id 8653.
The adapter directory, the project field and the protocolId now match it, which is
what the yield-server test checks. Local run: 38 passed.

* motoswap-farm: track the Motoswap farms, add LP fee APY

Launch farming (VampChef) ended on 2026-09-28 when the Motoswap DEX opened.
The adapter now reads the MasterChef farms on Motoswap pairs: apyBase is
the pair LP fee over the last 24 hours from the pair Swap events, apyReward
is the liquid half of the MasterChef MOTO emission. MOTO is priced from the
DefiLlama coins API, falling back to the Motoswap MOTO/WETH pair while the
coins API has no MOTO price.
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.