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

tvl and apy support for sceptre liquid sflr staking pool #1528

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hitchhooker
Copy link

this pr adds support for fetching tvl and apy data for sceptre liquid’s sflr staking pool on flare.

key points:

  • fetches total pooled sflr via sdk.api.abi.call
  • gets current flr price from price api
  • calculates tvl in usd (pooled sflr * flr price)
  • pulls staking apy from sceptre's rewards api
  • retry logic for api calls with exponential backoff
  • exposes apy function returning formatted pool data

@llamatester
Copy link

The sceptre-liquid adapter exports pools:

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

Nb of pools: 1
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬─────────┬──────────────────┬────────┬────────────────────┬───────────────────┬──────────────────────────────────────────────────┬─────────────────────┐
│ (index) │                     pool                     │  chain  │     project      │ symbol │       tvlUsd       │      apyBase      │                 underlyingTokens                 │      poolMeta       │
├─────────┼──────────────────────────────────────────────┼─────────┼──────────────────┼────────┼────────────────────┼───────────────────┼──────────────────────────────────────────────────┼─────────────────────┤
│    0    │ '0x12e605bc104e93b45e1ad99f9e555f659051c2bb' │ 'Flare' │ 'sceptre-liquid' │ 'sFLR' │ 13709999.645852847 │ 57.53714147322776 │ [ '0x1D80c49BbBCd1C0911346656B529DF9E5c2F783d' ] │ 'sFLR staking pool' │
└─────────┴──────────────────────────────────────────────┴─────────┴──────────────────┴────────┴────────────────────┴───────────────────┴──────────────────────────────────────────────────┴─────────────────────┘

@slasher125
Copy link
Collaborator

hi, ty for adding.
pls add poolMeta and set it to "14.5days unstaking cooldown"

@llamatester
Copy link

The sceptre-liquid adapter exports pools:

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

Nb of pools: 1
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬─────────┬──────────────────┬────────┬────────────────────┬───────────────────┬──────────────────────────────────────────────────┬────────────────────────────────┐
│ (index) │                     pool                     │  chain  │     project      │ symbol │       tvlUsd       │      apyBase      │                 underlyingTokens                 │            poolMeta            │
├─────────┼──────────────────────────────────────────────┼─────────┼──────────────────┼────────┼────────────────────┼───────────────────┼──────────────────────────────────────────────────┼────────────────────────────────┤
│    0    │ '0x12e605bc104e93b45e1ad99f9e555f659051c2bb' │ 'Flare' │ 'sceptre-liquid' │ 'sFLR' │ 13681121.963579247 │ 57.53714147322776 │ [ '0x1D80c49BbBCd1C0911346656B529DF9E5c2F783d' ] │ 'Unstaking Cooldown: 14.5days' │
└─────────┴──────────────────────────────────────────────┴─────────┴──────────────────┴────────┴────────────────────┴───────────────────┴──────────────────────────────────────────────────┴────────────────────────────────┘

@slasher125
Copy link
Collaborator

one other thing i overlooked, why is the api on ur ui lower (44.56)?

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