Add T3tris Finance APY adapter#2735
Conversation
- 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
…ssets/totalSupply
…requent oracle updates
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds 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. ChangesT3tris Finance Adaptor
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
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! |
…isted) + landing URL
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
src/adaptors/t3tris-finance/index.js
|
Ready for review. T3tris Finance APY adapter. Ordering: this requires the protocol to be listed first via the TVL PR DefiLlama/DefiLlama-Adapters#19662.
Thanks! |
|
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.
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.Methodology
apyBaseis derived from the change in each vault's oracle price-per-share (getLastSavedPricePerShare(), WAD) over a lookback window, annualized.totalAssetsvalued via DefiLlama price feeds.Project slug:
t3tris-finance(matches the listing PR above).Project info
0x6055fcdcd0545297ceC5e27E00d221194B554310Summary by CodeRabbit
Summary by CodeRabbit