add basalt-vault yield adapter#2841
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds an Arbitrum Basalt Vault adapter that discovers vaults, values Dolomite positions, derives GM fee APR from GMX data, calculates aggregate TVL and net APY, and exports adapter metadata. ChangesBasalt Vault APY Adapter
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant apy
participant BasaltFactory
participant Dolomite
participant GMXSubgraph
apy->>BasaltFactory: Enumerate GM token vaults
apy->>Dolomite: Read positions, prices, and borrow rate
apy->>GMXSubgraph: Query trailing seven-day GM fee data
apy-->>apy: Calculate TVL and net APY
🚥 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 |
|
updated: apyBase is now net of the protocol's 20% performance fee on profit — sample right now ~8.6% (10.8% strategy net x 0.8). tests still 11/11. |
|
The basalt-vault adapter exports pools: Test Suites: 1 passed, 1 total |
a1042a2 to
5649cca
Compare
|
The basalt-vault adapter exports pools: Test Suites: 1 passed, 1 total |
|
The basalt-vault adapter exports pools: Test Suites: 1 passed, 1 total |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/basalt-vault/index.js`:
- Line 88: Update the annualization calculation in the fee computation to use
the full 365/7 factor instead of Math.floor(365 / 7), preserving the documented
math and parity with gmx-v2-perps.
🪄 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: 696ca88f-3349-47eb-9893-7ad13d1159c8
📒 Files selected for processing (1)
src/adaptors/basalt-vault/index.js
5649cca to
e2e8ef8
Compare
|
The basalt-vault adapter exports pools: Test Suites: 1 passed, 1 total |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/basalt-vault/index.js`:
- Line 16: Update the graphql-request import used by the Basalt vault adapter to
avoid CommonJS loading against the pinned ESM-only v7 dependency. Either align
the dependency version with the existing CommonJS adapter pattern or replace the
import with a supported ESM boundary, while preserving the adapter’s GraphQL
request behavior.
🪄 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 Plus
Run ID: 8ebbf8a8-278d-4aef-a147-138ae3d4c179
📒 Files selected for processing (1)
src/adaptors/basalt-vault/index.js
e2e8ef8 to
d74de3b
Compare
|
The basalt-vault adapter exports pools: Test Suites: 1 passed, 1 total |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/basalt-vault/index.js`:
- Around line 85-86: Update the fee-APR calculation around the start and recent
cumulative fee values to detect missing query rows before converting them to
numbers. If either res.start or res.recent is empty, skip or short-circuit the
APR calculation instead of defaulting the missing value to 0; preserve normal
delta calculation when both series are present.
🪄 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 Plus
Run ID: 45f7e46b-7ddc-4eab-88a5-f7b97565f8aa
📒 Files selected for processing (1)
src/adaptors/basalt-vault/index.js
d74de3b to
145973f
Compare
|
The basalt-vault adapter exports pools: Test Suites: 1 passed, 1 total |
145973f to
af6aff3
Compare
|
The basalt-vault adapter exports pools: Test Suites: 1 passed, 1 total |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/basalt-vault/index.js`:
- Line 16: Update the graphql-request import destructuring to bind request from
its named request export while retaining gql, so the request invocation in apy()
uses the actual function exposed by graphql-request v7.
🪄 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 Plus
Run ID: 8da9cf3d-ff75-4988-abcd-2bb20632f00e
📒 Files selected for processing (1)
src/adaptors/basalt-vault/index.js
af6aff3 to
ce7758c
Compare
|
The basalt-vault adapter exports pools: Test Suites: 1 passed, 1 total |
Basalt Vault — delta-neutral GMX v2 GM (BTC/USD) vaults on Arbitrum, hedged with a WBTC borrow on Dolomite. TVL adapter is already merged (protocol id 8191, slug basalt-vault, DefiLlama-Adapters #19907).
One aggregate pool across all user vaults:
test: 11/11 pass
sample pool right now: tvlUsd ~118k, apyBase ~8.7% net (7.5% gm fee apr x 2.05 leverage - 4.4% wbtc borrow apr x 1.05, x 0.8 after the 20% performance fee)
Summary by CodeRabbit