Skip to content

Add Reflect V1 + V2 TVL adapters (Solana)#19947

Open
kubaplata wants to merge 1 commit into
DefiLlama:mainfrom
palindrome-eng:reflect-adapters
Open

Add Reflect V1 + V2 TVL adapters (Solana)#19947
kubaplata wants to merge 1 commit into
DefiLlama:mainfrom
palindrome-eng:reflect-adapters

Conversation

@kubaplata

@kubaplata kubaplata commented Jul 8, 2026

Copy link
Copy Markdown

Adds two standalone Solana adapters under projects/reflect/. TVL is read entirely from on-chain account data, deserialized manually (no new npm deps, Solana-only).

  • v2.jsReflect V2 (current), program RfLCtMS8AAqwDyK3RckKk5oarhZoNGx1rkz1BoozRq9
  • v1.jsReflect V1 (original), program rFLctqnUuxLmYsW5r9zNujfJx9hGpnP1csXr9PYwVgX; discontinued after the 2026-04-01 Drift exploit

Each file maps to its own DefiLlama dashboard (Reflect V1, Reflect V2).

  • index.js — folder default (re-exports V2) so the repo's folder-level CI can load the adapter; V1 and V2 remain separate dashboards via v1.js / v2.js.

Listing info

  • Name(s): Reflect V2, Reflect V1
  • Twitter: https://x.com/reflectmoney
  • Website: https://reflect.money
  • Audits: https://github.com/palindrome-eng/audits
  • Chain: Solana
  • Category: Yield Aggregator
  • Current TVL: V2 ≈ $0.01 (infra deploying) · V1 $0 (funds lost in Drift exploit; protocol frozen)
  • Coingecko / CMC: not listed
  • Treasury: none · forkedFrom: none · Referral program: no
  • GitHub: https://github.com/palindrome-eng
  • Short description: Reflect is a Solana yield protocol: users deposit stablecoins (USDC/USDT) and receive yield-bearing receipt tokens, with the collateral routed across on-chain lending venues (Kamino, Jupiter Lend, MarginFi, Save, Loopscale). (V1 discontinued following the April 2026 Drift exploit.)
  • Oracle: Protocol uses Pyth price feeds internally. The DefiLlama adapter itself uses no oracle — TVL is read directly from on-chain account balances / vault accounting and priced by DefiLlama.

Token addresses (receipt tokens)

  • V2: USDvv9Dst5KLrwd61AStBPzLF93MpebsuKDSzJ5xT9i, UsdaiNeTrorKL2n7VP5QJRbV2DPz3Ymonk1sP9iajfU, bondNKkoPV3axmrdfwV93NAbsWLxKkUPDtzaBFy1Lmc
  • V1: usd63SVWcKqLeyNHpmVhZGYAqfE5RHE8jwqjRA2ida2 (USDC+), uSDtYeMVYuQwhziLKMpdMz74WPFNytoWLGGiU9SDnZx (USDT+)
  • Underlying collateral counted as TVL: USDC, USDT

Methodology

  • V2: sums each strategy controller's AutoCompound.deposited_vault_value (collateral attributed to holders), valued in the strategy's underlying SPL (USDC/USDT) resolved from the Main account SPL registry.
  • V1: same live methodology; historical backfill proxies TVL by daily receipt-token supply (via Allium solana.assets.balances_daily) valued in the underlying stablecoin. deadFrom: 2026-04-02 forces TVL to 0 after the Drift loss + freeze (the on-chain field is frozen/stale). Both adapters are doublecounted (collateral sits in externally-listed venues).

Logo


"Allow edits by maintainers" is enabled.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added new Reflect TVL adapters for Solana: V1 (including historical backfill) and V2.
    • V1 reports underlying stablecoin balances derived from on-chain strategy deposits.
    • V2 computes Reflect “V2” TVL from on-chain account data.
    • Updated the Reflect entry point to default to the V2 adapter.
  • Bug Fixes
    • Prevents outdated V1 TVL reporting after the protocol cutoff date.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Error while running adapter at projects/reflect:

Error: Cannot find module '/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/reflect'
Require stack:
- /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js
Truncated error stack:

    at /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:142:14
    at Object.<anonymous> (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:290:3)
Error saving cache: Error: ENOENT: no such file or directory, open '/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/node_modules/.pnpm/@defillama+sdk@5.0.218_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10/node_modules/@defillama/sdk/build/util/local_cache/zlib-1.0/BlockCache-v1.json'

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Reflect Solana TVL adapters for V1 and V2, with V1 including an exploit-based cutoff and historical backfill. The Reflect index now defaults to V2 while documenting the two adapter variants.

Changes

Reflect V1 Adapter

Layer / File(s) Summary
Constants and account parsers
projects/reflect/v1.js
Defines program/mint constants, discriminators, byte offsets, and parsers for the Main account's strategy-to-mint mapping and StrategyController's deposited vault value.
Exploit cutoff and historical backfill
projects/reflect/v1.js
Defines exploit date and deadFrom cutoff constants with UTC day helpers, and implements tvlHistorical using Allium balances_daily queries.
Live TVL computation and adapter export
projects/reflect/v1.js
Implements the main tvl(api) routine combining deadFrom enforcement, historical routing, and live on-chain account fetching/parsing, and exports adapter metadata including timetravel, deadFrom, hallmarks, methodology, and solana.tvl.

Reflect V2 Adapter

Layer / File(s) Summary
Constants and account parsers
projects/reflect/v2.js
Defines program/discriminator IDs, byte offsets, and parsers for strategy-to-mint mapping and reading deposited vault value from the component registry.
TVL computation and adapter export
projects/reflect/v2.js
Implements tvl(api) fetching Main and StrategyController accounts, resolving mints, and summing deposited vault values; exports timetravel: false, methodology, doublecounted: true, and solana.tvl.
Default adapter export
projects/reflect/index.js
Documents the two Reflect adapter variants and exports ./v2.js as the default adapter.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested reviewers: RohanNero

Sequence Diagram(s)

sequenceDiagram
  participant api as Adapter API
  participant rpc as Solana RPC
  participant allium as Allium
  participant adaptor as Reflect V1 adapter

  api->>adaptor: tvl(api.timestamp)
  adaptor->>adaptor: check DEAD_FROM_TS
  alt timestamp before cutoff
    adaptor->>allium: query solana.assets.balances_daily
    allium-->>adaptor: daily receipt balances
    adaptor->>api: add underlying mint balances
  else timestamp at or after cutoff
    adaptor-->>api: return without TVL
  end
  adaptor->>rpc: fetch Main and StrategyController accounts
  rpc-->>adaptor: account data
  adaptor->>api: add live deposited_vault_value balances
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the main change: adding Reflect V1 and V2 Solana TVL adapters.
Description check ✅ Passed The description is mostly complete and covers the template’s listing info, methodology, and required protocol metadata.
✨ 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.

Standalone Solana adapters under projects/reflect/, TVL read from on-chain
account data and deserialized manually (no new deps):
- v2.js: Reflect V2 (program RfLCtMS8AAqwDyK3RckKk5oarhZoNGx1rkz1BoozRq9)
- v1.js: Reflect V1 (program rFLctqnUuxLmYsW5r9zNujfJx9hGpnP1csXr9PYwVgX);
  historical backfill via receipt-token supply (Allium), deadFrom 2026-04-02
  (Drift exploit + protocol freeze)
- index.js: folder default -> V2 (CI entry point; V1 listed separately from v1.js)
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

The adapter at projects/reflect exports TVL:

solana                    0.00

total                    0.01 

@RohanNero RohanNero self-assigned this Jul 13, 2026
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