Skip to content

Merging updates from defillama#3

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

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

Conversation

@iagoLD
Copy link
Copy Markdown

@iagoLD iagoLD commented Jul 18, 2022

No description provided.

0xkr3p and others added 28 commits April 30, 2026 08:30
Also removes old, unused code.
Co-authored-by: Ardor Baal <ardor.baal@gmail.com>
* Add Arche (arUSD) yield adapter

Arche is a yield-bearing stablecoin vault (protocol id 7740 on DefiLlama).
Adapter reports a single pool — the arUSD ERC-4626 vault on Ethereum —
sourcing TVL from totalAssets() on-chain and APY from the project's
public API at https://arche.money/api/apy.

* arche: address CodeRabbit feedback

- Validate Arche API returns a finite apr; throw on bad input
  instead of silently falling back to 0
- Use utils.formatAddress for both token and underlyingTokens to
  keep address normalization consistent

* arche: switch APY to on-chain 7d mark-to-market + add pricePerShare

Address review feedback from @0xkr3p:

- APY now derived from on-chain 7d delta of pricePerShare (no longer
  depends on arche.money/api/apy).
- pricePerShare added to the returned pool object.

Mark-to-market detail: arUSD is a Yearn v3 vault holding yvUSDC-1 as its
sole strategy. Yearn v3 books strategy yield only when process_report()
runs (lazy accounting), so vault.totalAssets() / vault.convertToAssets()
lag actual yield between reports. To produce an honest on-chain rate, we
mark the strategy holdings to current yvUSDC-1 share value:

  real_assets = totalIdle + yvUSDC.convertToAssets(yvUSDC.balanceOf(vault))
  real_pps    = real_assets / vault.totalSupply()

Skipped the getERC4626Info helper because (a) it computes 1d APY whereas
the request was 7d, and (b) its pricePerShare formula assumes 18-decimal
shares — arUSD is 6-decimal.
* fix pancake swap amm

* fix coderabbit issues
* fix lagoon (remove price from req)

* add isFinite filter for apy
slasher125 and others added 30 commits June 2, 2026 13:41
* ZealousSwap: Add Igra Network

* Suggested fix
* Add Gami Labs yield adapter

* Add apyBase: 0 to pass validator, rename Coinshift Leveraged USPC

* Re-trigger CI

* Use 30d apyBase as primary, fix Silo V2 via totalAssets/totalSupply ratio

* Drop apyBase30d from pool output (use internally only for apyBase fallback)

* Fix Spectra USDC Vault
* feat: add Brix wiTRY yield adapter

Adds a yield adapter for wiTRY, the yield-bearing staking wrapper for
Brix's iTRY (a TRY-pegged stablecoin backed by Turkish money market
funds).

APY is computed entirely on-chain, anchored to actual yield-distribution
events rather than fixed-window block sampling:

  1. Collect RewardsReceived events from the wiTRY vault (last 21d)
  2. end_event   = latest distribution
     start_event = latest event with ts <= end_event.ts - 7d
  3. Sample convertToAssets at (event.ts + getVestingPeriod()) so each
     anchor event's distribution is fully reflected — vesting-aware
  4. elapsedDays dynamic (typically 7-9)
  5. APY = (rateEnd / rateStart) ^ (365 / elapsedDays) - 1

This is robust to multi-day distribution gaps (Turkish public holidays,
weekends) — both anchors freeze symmetrically when no new distribution
arrives, so the displayed APY stays flat through dry periods and the
catch-up distribution at the end of a gap is absorbed without a spike.

The 10% performance fee is deducted by YieldForwarder before yield is
streamed into the wiTRY vault, so convertToAssets growth already
reflects net yield — no fee multiplier needed.

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

* address review: null apyBase fallback, add pricePerShare

- use null instead of 0 for the <2-events fallback so the empty case
  is not ingested into the time-series and doesn't skew smoothing
- add pricePerShare (current convertToAssets(1e18) at latest block)
  to the pool object

* add isIntrinsicSource field

---------

Co-authored-by: İsmail Emin Erdoğdu <ismailemin@192.168.1.101>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: ismailemin <ismail@inverter.network>
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.