Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add Usual USD0++ in defillama yield server #1627

Merged
merged 3 commits into from
Dec 3, 2024

Conversation

Magicking
Copy link
Contributor

This pull request introduces a new feature to fetch and calculate the APY for the USD0++ token on the Ethereum blockchain. The changes involve integrating several libraries, defining constants, and implementing the apy function to return the APY data.

Key changes include:

  • Library Integrations:

    • Added @defillama/sdk and axios libraries for API calls and data fetching.
  • Constants Definition:

    • Defined constants for token addresses (usd0PP, usd0, usual), symbol (USD0++), API endpoints (baseURLRewardRate, baseURLLlamaPrice), and a scalar value (scalarOne).
  • APY Calculation:

    • Implemented the apy function to fetch total supply, price, TVL (Total Value Locked), and reward rate, and calculate the APY based on these values.
  • Export Module:

    • Exported the apy function and a URL for staking actions.

@llamatester
Copy link

Error while running usual adapter:

Test Suites: 1 failed, 1 total
Tests: 1 failed, 10 passed, 11 total
Snapshots: 0 total
Time: 0.288 s
Ran all test suites.

Nb of pools: 1
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬────────────┬─────────┬──────────┬────────────────────┬─────────────────────┬──────────────────────────────────────────────────┬──────────────────────────────────────────────────┐
│ (index) │                     pool                     │   chain    │ project │  symbol  │       tvlUsd       │       apyBase       │                   rewardTokens                   │                 underlyingTokens                 │
├─────────┼──────────────────────────────────────────────┼────────────┼─────────┼──────────┼────────────────────┼─────────────────────┼──────────────────────────────────────────────────┼──────────────────────────────────────────────────┤
│    0    │ '0x35D8949372D46B7a3D5A56006AE77B215fc69bC0' │ 'Ethereum' │ 'Usual' │ 'USD0++' │ 451284256.90918624 │ 0.48128180098163664 │ [ '0xC4441c2BE5d8fA8126822B9929CA0b81Ea0DE38E' ] │ [ '0x73A15FeD60Bf67631dC6cd7Bc5B6e8da8190aCF5' ] │
└─────────┴──────────────────────────────────────────────┴────────────┴─────────┴──────────┴────────────────────┴─────────────────────┴──────────────────────────────────────────────────┴──────────────────────────────────────────────────┘
}

@Magicking Magicking changed the title chore: initial commit for Usual in defillama yield server chore: Add Usual in defillama yield server Dec 2, 2024
@llamatester
Copy link

Error while running usual adapter:

Test Suites: 1 failed, 1 total
Tests: 1 failed, 10 passed, 11 total
Snapshots: 0 total
Time: 0.308 s
Ran all test suites.

Nb of pools: 1
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬────────────┬─────────┬──────────┬───────────────────┬───────────────────┬──────────────────────────────────────────────────┬──────────────────────────────────────────────────┐
│ (index) │                     pool                     │   chain    │ project │  symbol  │      tvlUsd       │      apyBase      │                   rewardTokens                   │                 underlyingTokens                 │
├─────────┼──────────────────────────────────────────────┼────────────┼─────────┼──────────┼───────────────────┼───────────────────┼──────────────────────────────────────────────────┼──────────────────────────────────────────────────┤
│    0    │ '0x35D8949372D46B7a3D5A56006AE77B215fc69bC0' │ 'Ethereum' │ 'Usual' │ 'USD0++' │ 451294446.7367412 │ 47.94759584713981 │ [ '0xC4441c2BE5d8fA8126822B9929CA0b81Ea0DE38E' ] │ [ '0x73A15FeD60Bf67631dC6cd7Bc5B6e8da8190aCF5' ] │
└─────────┴──────────────────────────────────────────────┴────────────┴─────────┴──────────┴───────────────────┴───────────────────┴──────────────────────────────────────────────────┴──────────────────────────────────────────────────┘
}

@llamatester
Copy link

The usual-money adapter exports pools:

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

Nb of pools: 1
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬────────────┬───────────────┬──────────┬───────────────────┬───────────────────┬──────────────────────────────────────────────────┬──────────────────────────────────────────────────┐
│ (index) │                     pool                     │   chain    │    project    │  symbol  │      tvlUsd       │      apyBase      │                   rewardTokens                   │                 underlyingTokens                 │
├─────────┼──────────────────────────────────────────────┼────────────┼───────────────┼──────────┼───────────────────┼───────────────────┼──────────────────────────────────────────────────┼──────────────────────────────────────────────────┤
│    0    │ '0x35D8949372D46B7a3D5A56006AE77B215fc69bC0' │ 'Ethereum' │ 'usual-money' │ 'USD0++' │ 451922304.4025224 │ 48.17693505053677 │ [ '0xC4441c2BE5d8fA8126822B9929CA0b81Ea0DE38E' ] │ [ '0x73A15FeD60Bf67631dC6cd7Bc5B6e8da8190aCF5' ] │
└─────────┴──────────────────────────────────────────────┴────────────┴───────────────┴──────────┴───────────────────┴───────────────────┴──────────────────────────────────────────────────┴──────────────────────────────────────────────────┘

@Magicking Magicking changed the title chore: Add Usual in defillama yield server chore: Add Usual USD0++ in defillama yield server Dec 2, 2024
@slasher125 slasher125 merged commit 5bae0f6 into DefiLlama:master Dec 3, 2024
1 check passed
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.

3 participants