Skip to content

feat(templarfi): add ADA, DOGE, LTC, XRP cross-chain assets via omnichain bridge #18666

Open
SmolinPavel wants to merge 1 commit intoDefiLlama:mainfrom
Templar-Protocol:feat/templarfi-ada-doge-ltc-xrp-chains
Open

feat(templarfi): add ADA, DOGE, LTC, XRP cross-chain assets via omnichain bridge #18666
SmolinPavel wants to merge 1 commit intoDefiLlama:mainfrom
Templar-Protocol:feat/templarfi-ada-doge-ltc-xrp-chains

Conversation

@SmolinPavel
Copy link
Copy Markdown
Contributor

@SmolinPavel SmolinPavel commented Apr 6, 2026

Summary

  • Add cross-chain asset support for ADA, DOGE, LTC, and XRP bridged via omnichain bridge (cardano.omft.near, doge.omft.near, ltc.omft.near, xrp.omft.near)
  • Register token mappings with correct decimals in projects/helper/chain/near.js (ADA: 6, DOGE: 8, LTC: 8, XRP: 6)
  • Add detectCrossChainToken mappings and chain entries in projects/templarfi/index.js, following the same pattern as the existing BTC and ZEC integrations

Summary by CodeRabbit

  • New Features
    • Added support for NEAR omnichain tokens representing Cardano, Dogecoin, Litecoin, and XRP. Users can now track wrapped versions of these major assets on the NEAR network.
    • Extended platform integration to include Cardano, Doge, Litecoin, and Ripple blockchains, enabling total value locked and borrowing metrics visibility across these newly supported networks.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

📝 Walkthrough

Walkthrough

The changes add support for four additional omnichain NEAR tokens (Cardano, Dogecoin, Litecoin, XRP). A helper chain file introduces token-to-balance mappings with decimal specifications, while the templarfi adapter extends its supported chains list and cross-chain token detection to include these assets with corresponding tvl and borrowed exports.

Changes

Cohort / File(s) Summary
NEAR Token Mapping
projects/helper/chain/near.js
Added four tokenMapping entries for Near OMFT tokens (cardano.omft.near, doge.omft.near, ltc.omft.near, xrp.omft.near) with corresponding aggregated balance keys and decimal normalization (6 or 8).
Templarfi Cross-Chain Support
projects/templarfi/index.js
Extended SUPPORTED_CHAINS from 6 to 10 chains (added: cardano, doge, litecoin, ripple); updated cross-chain token detection to map new NEAR OMFT token IDs; enables tvl and borrowed exports for four new chains.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

Hoppy news! Four tokens now grace the NEAR,
Cardano, Doge, and Litecoin appear,
Ripple flows through our mappings with care,
Cross-chains unite in the ecosystem we share! 🐰✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding cross-chain support for four assets (ADA, DOGE, LTC, XRP) via omnichain bridge in the templarfi project.
Description check ✅ Passed The PR description provides a clear summary of changes and technical details, but it does not follow the repository's template structure. However, this is an update to an existing project, not a new listing requiring all template fields.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
projects/templarfi/index.js (1)

377-377: Consider updating the methodology string to reflect all supported chains.

The methodology currently mentions only "Stellar, Ethereum, Bitcoin" but the adapter now supports Cardano, Dogecoin, Litecoin, XRP, and others.

📝 Suggested update
-  methodology: 'TVL is calculated by summing the net borrow asset liquidity (deposits minus outstanding loans) and full collateral deposits for each market deployment. Assets are attributed to their origin chain (Stellar, Ethereum, Bitcoin).',
+  methodology: 'TVL is calculated by summing the net borrow asset liquidity (deposits minus outstanding loans) and full collateral deposits for each market deployment. Assets are attributed to their origin chain (NEAR, Stellar, Ethereum, Bitcoin, Zcash, Solana, Cardano, Dogecoin, Litecoin, XRP).',
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@projects/templarfi/index.js` at line 377, The methodology string assigned to
the methodology property currently lists only "Stellar, Ethereum, Bitcoin";
update that string in projects/templarfi/index.js (the methodology property) to
reflect all supported chains (e.g., include Cardano, Dogecoin, Litecoin, XRP,
plus Stellar, Ethereum, Bitcoin) or replace the explicit list with a phrase like
"all supported chains" to keep it accurate as support expands; ensure the
revised sentence retains the original meaning about summing net borrow liquidity
and full collateral deposits per market deployment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@projects/templarfi/index.js`:
- Line 377: The methodology string assigned to the methodology property
currently lists only "Stellar, Ethereum, Bitcoin"; update that string in
projects/templarfi/index.js (the methodology property) to reflect all supported
chains (e.g., include Cardano, Dogecoin, Litecoin, XRP, plus Stellar, Ethereum,
Bitcoin) or replace the explicit list with a phrase like "all supported chains"
to keep it accurate as support expands; ensure the revised sentence retains the
original meaning about summing net borrow liquidity and full collateral deposits
per market deployment.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 26da14d8-27f5-4142-8ecb-76a8b2a59db4

📥 Commits

Reviewing files that changed from the base of the PR and between 765107d and 20e9f8c.

📒 Files selected for processing (2)
  • projects/helper/chain/near.js
  • projects/templarfi/index.js

@SmolinPavel
Copy link
Copy Markdown
Contributor Author

Hi @RohanNero,

Could you please review this PR?
That should be a pretty straightforward and safe update.

Let me know if you need anything from me please.

@RohanNero RohanNero self-assigned this Apr 10, 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