Conversation
📝 WalkthroughWalkthroughAdds a new Atomiq Exchange TVL adapter that aggregates TVL for btnx, citrea, starknet, and solana using chain-specific vault/token config, helper sumTokens/sumTokens2, and Solana PDA derivation for the Atomiq program authority. Changes
Sequence Diagram(s)sequenceDiagram
participant Adapter as Atomiq Adapter
participant Core as coreAssets (ADDRESSES)
participant Helpers as sumTokens / sumTokens2
participant Chains as btnx / citrea / starknet
participant Solana as Solana Program (ATOMIQ_PROGRAM_ID)
Adapter->>Core: load token defaults and chain tokens
Adapter->>Chains: call sumTokens(vaults, tokens)
Chains-->>Helpers: return per-chain balances
Adapter->>Solana: derive authority PDA via PublicKey.findProgramAddressSync("authority")
Adapter->>Helpers: call sumTokens2(authorityPDA, tokens) for Solana
Helpers-->>Adapter: return Solana balances
Adapter-->>Adapter: aggregate and return TVL
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
The adapter at projects/atomiq-exchange exports TVL: |
|
The adapter at projects/atomiq-exchange exports TVL: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@projects/atomiq-exchange/index.js`:
- Around line 25-32: tvlSolana currently ignores the framework-provided api
param; update the tvlSolana function signature to accept an api parameter and
pass it into sumTokens2 so chain/context info is propagated. Specifically,
modify the async function tvlSolana(...) to include api and call return
sumTokens2({ owners: [authorityPda.toString()] }, api) (or the equivalent
positional/optional argument pattern required by sumTokens2) while keeping the
authorityPda computation unchanged.
|
The adapter at projects/atomiq-exchange exports TVL: |
NOTE
Please enable "Allow edits by maintainers" while putting up the PR.
package-lock.jsonfile as part of your changes, we use lockfileVersion 2, and most use v1 and using that messes up our CIName (to be shown on DefiLlama):
atomiq exchange
Twitter Link:
https://x.com/atomiqlabs
List of audit links if any:
Website Link:
https://app.atomiq.exchange/
Logo (High resolution, will be shown with rounded borders):
Current TVL:
~$250k
Treasury Addresses (if the protocol has treasury)
Chain:
solana, botanix, citrea, starknet
Coingecko ID (so your TVL can appear on Coingecko, leave empty if not listed): (https://api.coingecko.com/api/v3/coins/list)
Coinmarketcap ID (so your TVL can appear on Coinmarketcap, leave empty if not listed): (https://api.coinmarketcap.com/data-api/v3/map/all?listing_status=active,inactive,untracked&start=1&limit=10000)
Short Description (to be shown on DefiLlama):
"Fully trustless, zero slippage swaps between native Bitcoin (on-chain & lightning) & Solana + Starknet + Citrea + Botanix secured by Bitcoin's proof of work"
Token address and ticker if any:
Category (full list at https://defillama.com/categories) *Please choose only one:
dex
Oracle Provider(s): Specify the oracle(s) used (e.g., Chainlink, Band, API3, TWAP, etc.):
Implementation Details: Briefly describe how the oracle is integrated into your project:
Documentation/Proof: Provide links to documentation or any other resources that verify the oracle's usage:
https://docs.atomiq.exchange/bitcoin-backed-lending#dlcs
forkedFrom (Does your project originate from another project):
methodology (what is being counted as tvl, how is tvl being calculated):
funds locked in spvVaults, escrow managers, and the solana program's 'authority' pda
Github org/user (Optional, if your code is open source, we can track activity):
https://github.com/atomiqlabs
Does this project have a referral program?
Summary by CodeRabbit