Skip to content

Add T3tris Finance APY adapter#2735

Open
t3trominos wants to merge 11 commits into
DefiLlama:masterfrom
t3tris-finance:feature/t3tris-integration
Open

Add T3tris Finance APY adapter#2735
t3trominos wants to merge 11 commits into
DefiLlama:masterfrom
t3tris-finance:feature/t3tris-integration

Conversation

@t3trominos

@t3trominos t3trominos commented Jun 13, 2026

Copy link
Copy Markdown

Adds an APY adapter for T3tris Finance (https://t3tris.finance) — an ERC-4626 vault protocol with async deposit/redeem flows and silo-based strategies routing into underlying yield sources.

The protocol is deployed at a deterministic CREATE3 address (0x0000000000CC53b5Fd649b80f08b05405779cC71), identical on every EVM chain. The adapter enumerates all vaults via the protocol factory and computes each vault's APY from its on-chain oracle price-per-share. Chains where the contract is not yet deployed are skipped gracefully.

Note: Per the listing guide, a protocol must first be listed on DefiLlama's TVL page. The TVL listing is in progress here: DefiLlama/DefiLlama-Adapters#19662.

T3tris has also just launched, so TVL is still ramping up (DefiLlama only displays pools >$10k TVL). I'm opening this as a draft and will mark it ready for review once the TVL listing PR is merged and pools have grown past the display threshold.


Methodology

  • apyBase is derived from the change in each vault's oracle price-per-share (getLastSavedPricePerShare(), WAD) over a lookback window, annualized.
  • Multiple lookback windows (7d / 14d / 30d) are blended to smooth out infrequent keeper oracle updates and avoid APY spikes.
  • TVL per pool uses the vault's totalAssets valued via DefiLlama price feeds.
  • No reward/incentive APY — yield is purely vault NAV growth.

Project slug: t3tris-finance (matches the listing PR above).


Project info

t3tris_avatar_black_background

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added T3tris Finance vault support, including USD TVL and vault details.
    • Introduced oracle-based APY calculation using historical price-per-share across multiple lookback windows, with smoothing for more stable results.
    • Added automatic vault discovery from the T3tris ecosystem and enrichment with on-chain metadata, fee information, and oracle valuation timing.
    • Set the adaptor to report non-time-travel APY metrics and link to the project page.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 26942326-799f-4481-9bff-456ae40a93b6

📥 Commits

Reviewing files that changed from the base of the PR and between 9def44d and c4e7117.

📒 Files selected for processing (1)
  • src/adaptors/t3tris-finance/index.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/adaptors/t3tris-finance/index.js

📝 Walkthrough

Walkthrough

Adds a new T3tris Finance yield adaptor. It discovers curated vaults, reads oracle PPS at current and historical lookback windows, computes smoothed APY, and emits pool records with TVL, fees, and underlying token data.

Changes

T3tris Finance Adaptor

Layer / File(s) Summary
Constants, ABIs, and shared helpers
src/adaptors/t3tris-finance/index.js
Declares project constants, supported chain mapping, vault/oracle ABI entries, APY lookback windows, batch-call helpers, block lookup, and base APY calculations.
Vault discovery and metadata normalization
src/adaptors/t3tris-finance/index.js
Fetches verified, non-blacklisted vaults for the supported chain, batch-reads vault metadata and oracle addresses, and records oracle valuation timestamps alongside normalized vault fields and fees.
Current and historical oracle PPS retrieval
src/adaptors/t3tris-finance/index.js
Reads current oracle PPS values and historical PPS values anchored to each vault’s valuation timestamp, resolving historical blocks per lookback window and tolerating missing reads.
Smoothed APY blending algorithm
src/adaptors/t3tris-finance/index.js
Computes APY from PPS changes across the configured lookback windows, weights valid windows by inverse days, and returns blended apyBase plus apyBase7d with a 7-day preference.
Main orchestration and module export
src/adaptors/t3tris-finance/index.js
Iterates supported chains, loads prices, computes TVL and share price, skips low-TVL vaults, formats fee metadata, builds pool objects with URLs and APY fields, isolates per-chain failures, and exports the adaptor interface.

Sequence Diagram(s)

sequenceDiagram
  participant main
  participant T3trisAPI
  participant VaultContract
  participant OracleContract
  participant llamaBlockAPI
  participant PriceUtils

  main->>T3trisAPI: fetch curated vault list
  T3trisAPI-->>main: verified vaults
  main->>VaultContract: read metadata and oracle address
  VaultContract-->>main: vault fields
  main->>OracleContract: read current PPS
  OracleContract-->>main: current PPS map
  main->>llamaBlockAPI: resolve historical blocks
  llamaBlockAPI-->>main: block numbers
  main->>OracleContract: read historical PPS at blocks
  OracleContract-->>main: historical PPS windows
  main->>PriceUtils: get underlying token prices
  PriceUtils-->>main: USD prices
  main->>main: compute TVL, APY, and pool records
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • 0xkr3p

Poem

🐰 I hopped through vaults on Arbitrum bright,
Read oracle whispers both past and the right,
Seven-day hops and thirty-day trails,
Blended APY in a basket of scales,
T3tris vaults sparkle — yield bunny prevails!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a T3tris Finance APY adapter.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@t3trominos

Copy link
Copy Markdown
Author

Keeping this as a draft for now: per the listing guide, T3tris first needs to be listed on DefiLlama's TVL page, which is in progress via DefiLlama/DefiLlama-Adapters#19662. The protocol has also just launched, so pools are still below the $10k display threshold. I'll mark this ready for review once #19662 is merged and TVL has grown. Thanks!

@t3trominos t3trominos marked this pull request as ready for review June 21, 2026 19:58

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/adaptors/t3tris-finance/index.js`:
- Around line 59-61: The axios.get calls in the function at lines 59-61 and line
142 lack timeout configuration, which can cause the adaptor to hang indefinitely
if upstream endpoints are slow or unresponsive. Add a timeout property to the
configuration object passed to both axios.get calls to ensure requests fail
fast. For example, pass a config object as the second parameter to axios.get
with a timeout value set in milliseconds (e.g., 10000 for 10 seconds) to prevent
indefinite blocking and improve adaptor availability.
- Around line 347-359: The code converts large on-chain uint256 integers
directly to JavaScript Number type before performing arithmetic operations
(specifically at lines calculating totalAssetsNormalized and currentSharePrice),
which causes precision loss that corrupts TVL and APY calculations. Replace all
Number() conversions on vault.totalAssets, vault.totalSupply, and similar large
integer properties with BigInt conversions, perform all arithmetic operations
using BigInt arithmetic, and only convert the final result to Number at the very
end when needed for output or storage. Apply this fix at all four locations
mentioned: line 347 (totalAssetsNormalized calculation), line 358
(currentSharePrice calculation), and the other two locations at lines 273 and
308 that have the same issue.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 33f39a31-7a8d-490d-a42b-ca1d41fca079

📥 Commits

Reviewing files that changed from the base of the PR and between 7121256 and 0cc54e3.

📒 Files selected for processing (1)
  • src/adaptors/t3tris-finance/index.js

Comment thread src/adaptors/t3tris-finance/index.js
Comment thread src/adaptors/t3tris-finance/index.js Outdated
@t3trominos

Copy link
Copy Markdown
Author

Ready for review. T3tris Finance APY adapter.

Ordering: this requires the protocol to be listed first via the TVL PR DefiLlama/DefiLlama-Adapters#19662.
Until that merges and the t3tris-finance slug is live, the protocols.toContain(...) check here will be red, that's expected and resolves once the listing is in.

  • Same curation filter as the TVL adapter (verified + non-blacklisted only).
  • APY is read from each vault's oracle PPS and anchored at the last NAV update, so the rate is the one realized at the last NAV rather than decaying as flat days accumulate.
  • All CodeRabbit feedback addressed.

Thanks!

@t3trominos

Copy link
Copy Markdown
Author

Hey, the DefiLlama/DefiLlama-Adapters#19662 has been merged.

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.
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.

2 participants