Skip to content

Conversation

@June-native
Copy link

Add Native Credit Pool adapter

Adds a new adapter for Native Credit Pool, a new form of DEX LP, offering single-sided, no-loss LP positions via rebasing tokens.

More info: https://docs.native.org/native-dev/solution/native-credit-pool

Summary

  • Fetches APY data from Native's API for all supported chains. (Native Credit Pool LPs are Lido-style LST rebasing yield tokens; yield is distributed weekly/daily and reflected in exchange rate changes. To avoid failing to fetch exchange rate retrospectively due to rpc issue, we opted for relying on Native side's API, following Lido's template)
  • Calculates TVL on-chain using totalUnderlying() on LP token contracts
  • Batched RPC calls

Supported Chains

  • Ethereum
  • BSC
  • Arbitrum
  • Base

Implementation Details

  • multiCall for on-chain data fetching
  • Fetches token prices from DefiLlama API
  • Includes individual pool URLs linking to Native's app for direct deposits

@llamatester
Copy link

The native-credit-pool adapter exports pools:

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

Nb of pools: 29
 

Sample pools:
┌─────────┬───────────────────────────────────────────────────────┬────────────┬──────────────────────┬──────────┬────────────────────┬─────────┬──────────────────────────────────────────────────┬───────────────────────────┬─────────────────────────────────────────────────────────────────────────────────┐
│ (index) │ pool                                                  │ chain      │ project              │ symbol   │ tvlUsd             │ apyBase │ underlyingTokens                                 │ poolMeta                  │ url                                                                             │
├─────────┼───────────────────────────────────────────────────────┼────────────┼──────────────────────┼──────────┼────────────────────┼─────────┼──────────────────────────────────────────────────┼───────────────────────────┼─────────────────────────────────────────────────────────────────────────────────┤
│ 0       │ '0x5994258ec80cc6853e2b6f047ec6d213fe89b24b-bsc'      │ 'Binance'  │ 'native-credit-pool' │ 'nUSDT'  │ 4990182.338799053  │ 0       │ [ '0x55d398326f99059ff775485246999027b3197955' ] │ 'single-side, no-loss LP' │ 'https://native.org/app/credit-pool/?chainId=56&action=deposit&token0=USDT'     │
│ 1       │ '0xf2ab5792bd09444c89e0142cfbffd9b192ad049c-ethereum' │ 'Ethereum' │ 'native-credit-pool' │ 'nWBTC'  │ 2421104.505103021  │ 3.13    │ [ '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599' ] │ 'single-side, no-loss LP' │ 'https://native.org/app/credit-pool/?chainId=1&action=deposit&token0=WBTC'      │
│ 2       │ '0x4e041b2e9a366cd80b8fa01bb7bebb8eb4c1243d-ethereum' │ 'Ethereum' │ 'native-credit-pool' │ 'nUSDT'  │ 2018235.998429228  │ 4.35    │ [ '0xdac17f958d2ee523a2206206994597c13d831ec7' ] │ 'single-side, no-loss LP' │ 'https://native.org/app/credit-pool/?chainId=1&action=deposit&token0=USDT'      │
│ 3       │ '0x91f70f89915f8e5fc9fdd8078685067a49cc6c28-ethereum' │ 'Ethereum' │ 'native-credit-pool' │ 'nUSDC'  │ 1926697.3187966128 │ 4.71    │ [ '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' ] │ 'single-side, no-loss LP' │ 'https://native.org/app/credit-pool/?chainId=1&action=deposit&token0=USDC'      │
│ 4       │ '0xc9452fa182b0f8201f2e15700671570699aa10b5-arbitrum' │ 'Arbitrum' │ 'native-credit-pool' │ 'nUSD₮0' │ 1218325.7622138886 │ 0       │ [ '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9' ] │ 'single-side, no-loss LP' │ 'https://native.org/app/credit-pool/?chainId=42161&action=deposit&token0=USD₮0' │
│ 5       │ '0x6833e3e3f2a048df8d5dfdef466b73936b2224e6-base'     │ 'Base'     │ 'native-credit-pool' │ 'nUSDC'  │ 1209655.2025959156 │ 0       │ [ '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913' ] │ 'single-side, no-loss LP' │ 'https://native.org/app/credit-pool/?chainId=8453&action=deposit&token0=USDC'   │
│ 6       │ '0x5994258ec80cc6853e2b6f047ec6d213fe89b24b-ethereum' │ 'Ethereum' │ 'native-credit-pool' │ 'nWETH'  │ 606106.8934610299  │ 4.24    │ [ '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' ] │ 'single-side, no-loss LP' │ 'https://native.org/app/credit-pool/?chainId=1&action=deposit&token0=WETH'      │
│ 7       │ '0xea91132e79559be0fcd6b1237ded28a31a226644-bsc'      │ 'Binance'  │ 'native-credit-pool' │ 'nWBNB'  │ 115995.27105487125 │ 0       │ [ '0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c' ] │ 'single-side, no-loss LP' │ 'https://native.org/app/credit-pool/?chainId=56&action=deposit&token0=WBNB'     │
│ 8       │ '0x8a5fca5429f5d572f71959bfec41495420528ce2-arbitrum' │ 'Arbitrum' │ 'native-credit-pool' │ 'nWETH'  │ 90963.68662893023  │ 0       │ [ '0x82af49447d8a07e3bd95bd0d56f35241523fbab1' ] │ 'single-side, no-loss LP' │ 'https://native.org/app/credit-pool/?chainId=42161&action=deposit&token0=WETH'  │
│ 9       │ '0x66550d6453dbb70103b96fac81052f106d4fffeb-ethereum' │ 'Ethereum' │ 'native-credit-pool' │ 'nSTO'   │ 80999.54289188227  │ 0       │ [ '0x1d88713b483a8e45cff0e5cd7c2e15e5fab4534d' ] │ 'single-side, no-loss LP' │ 'https://native.org/app/credit-pool/?chainId=1&action=deposit&token0=STO'       │
└─────────┴───────────────────────────────────────────────────────┴────────────┴──────────────────────┴──────────┴────────────────────┴─────────┴──────────────────────────────────────────────────┴───────────────────────────┴─────────────────────────────────────────────────────────────────────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

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