Skip to content

Add Tristero AUSD yield adapter#2818

Open
ggarza5 wants to merge 2 commits into
DefiLlama:masterfrom
ggarza5:agent/add-tristero-ausd-yield-adapter
Open

Add Tristero AUSD yield adapter#2818
ggarza5 wants to merge 2 commits into
DefiLlama:masterfrom
ggarza5:agent/add-tristero-ausd-yield-adapter

Conversation

@ggarza5

@ggarza5 ggarza5 commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • Add the Ethereum AUSD Tristero margin-lending vault to the yields adapter set.
  • Derive APY from the vault’s on-chain ratePerSecond asset parameter using standard daily compounding.
  • Derive TVL from the vault’s getTVOL(AUSD) balance and AUSD price.

Validation

  • git diff --check passes.
  • The adapter was manually exercised against live Ethereum contract data and returned TVL and APY values.

Arbitrum and Base deployments are intentionally excluded because they use USDC and need separate confirmation of their lender-yield treatment.

Summary by CodeRabbit

  • New Features
    • Added Tristero’s AUSD margin-lending vault to yield tracking.
    • Added reporting for vault total value and estimated APY, including a share price metric.
    • Added a direct link to the Tristero app for more information.

@coderabbitai

coderabbitai Bot commented Jul 15, 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: 04238ed5-d8e2-437a-aa41-73a52e08d236

📥 Commits

Reviewing files that changed from the base of the PR and between 29a1b1e and f3bf91f.

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

📝 Walkthrough

Walkthrough

Adds an Ethereum DeFiLlama adapter for Tristero’s AUSD margin-lending vault, reading vault and token data to calculate TVL, APY, and price per share, then exporting the configured pool handler and metadata.

Changes

Tristero AUSD margin adapter

Layer / File(s) Summary
Vault state readers
src/adaptors/tristero-margin/index.js
Defines Ethereum and AUSD constants and helpers for reading vault TVOL and asset rate data.
Pool metrics and adapter wiring
src/adaptors/tristero-margin/index.js
Concurrently fetches vault and token values, calculates tvlUsd and guarded apyBase, includes pricePerShare, returns the pool record, and exports the adapter configuration.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant poolsFunction
  participant TristeroVault
  participant AUSD
  participant MarketPrice
  poolsFunction->>TristeroVault: Read TVOL, asset rate, and share value
  poolsFunction->>AUSD: Read decimals
  poolsFunction->>MarketPrice: Fetch AUSD price
  poolsFunction->>poolsFunction: Calculate TVL and APY
  poolsFunction-->>poolsFunction: Return pool record
Loading
🚥 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 Tristero AUSD yield 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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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.

@github-actions

Copy link
Copy Markdown

The tristero-margin adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 11 passed, 11 total
Snapshots: 0 total
Time: 0.229 s
Ran all test suites.

Nb of pools: 1
 

Sample pools:
┌─────────┬───────────────────────────────────────────────────────┬────────────┬───────────────────┬────────┬───────────────────┬───────────────────┬──────────────────────────────────────────────────┬─────────────────────────────┬────────────────────────────┬───────┐
│ (index) │ pool                                                  │ chain      │ project           │ symbol │ tvlUsd            │ apyBase           │ underlyingTokens                                 │ poolMeta                    │ url                        │ token │
├─────────┼───────────────────────────────────────────────────────┼────────────┼───────────────────┼────────┼───────────────────┼───────────────────┼──────────────────────────────────────────────────┼─────────────────────────────┼────────────────────────────┼───────┤
│ 0       │ '0xb49781e8c39c75f413c1178f395bf68b0bee8d00-ethereum' │ 'Ethereum' │ 'tristero-margin' │ 'AUSD' │ 35059.87830827656 │ 9.416214491141229 │ [ '0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a' ] │ 'AUSD margin lending vault' │ 'https://app.tristero.com' │ null  │
└─────────┴───────────────────────────────────────────────────────┴────────────┴───────────────────┴────────┴───────────────────┴───────────────────┴──────────────────────────────────────────────────┴─────────────────────────────┴────────────────────────────┴───────┘

underlyingTokens: [AUSD],
poolMeta: 'AUSD margin lending vault',
url: 'https://app.tristero.com',
token: null,

@0xkr3p 0xkr3p Jul 16, 2026

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.

does the user receive a receipt token for depositing? if so this should be added here rather than null

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks — I checked the dapp implementation and the verified MarginVault source. Deposits mint ERC6909 shares on the MarginVault using the asset ID uint256(uint160(AUSD)); there is no standalone ERC20 receipt-token address. I therefore kept token: null to avoid misrepresenting holder analytics. I added pricePerShare using readValue(AUSD, 1e18), which returns the current time/rate-accrued index, and removed poolMeta. Commit: f3bf91f.

apyBase,
underlyingTokens: [AUSD],
poolMeta: 'AUSD margin lending vault',
url: 'https://app.tristero.com',

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.

add pricePerShare field

Comment thread src/adaptors/tristero-margin/index.js Outdated
tvlUsd,
apyBase,
underlyingTokens: [AUSD],
poolMeta: 'AUSD margin lending vault',

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.

I don't think this pool meta adds anything valuable, can remove

@0xkr3p 0xkr3p 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.

thanks for the PR @ggarza5, a few minor tweaks before we can move forwards

@github-actions

Copy link
Copy Markdown

The tristero-margin adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 13 passed, 13 total
Snapshots: 0 total
Time: 0.176 s
Ran all test suites.

Nb of pools: 1
 

Sample pools:
┌─────────┬───────────────────────────────────────────────────────┬────────────┬───────────────────┬────────┬───────────────────┬───────────────────┬────────────────────┬──────────────────────────────────────────────────┬────────────────────────────┬───────┐
│ (index) │ pool                                                  │ chain      │ project           │ symbol │ tvlUsd            │ apyBase           │ pricePerShare      │ underlyingTokens                                 │ url                        │ token │
├─────────┼───────────────────────────────────────────────────────┼────────────┼───────────────────┼────────┼───────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────────────────┼────────────────────────────┼───────┤
│ 0       │ '0xb49781e8c39c75f413c1178f395bf68b0bee8d00-ethereum' │ 'Ethereum' │ 'tristero-margin' │ 'AUSD' │ 35081.35608637491 │ 9.416214491141229 │ 1.0054573212954137 │ [ '0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a' ] │ 'https://app.tristero.com' │ null  │
└─────────┴───────────────────────────────────────────────────────┴────────────┴───────────────────┴────────┴───────────────────┴───────────────────┴────────────────────┴──────────────────────────────────────────────────┴────────────────────────────┴───────┘

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