Skip to content

Blend sdk updates #1838

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

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

Conversation

Ryang-21
Copy link
Contributor

  • Update blend-sdk to v3.0.1
  • Add new pools
  • Use CoinGecko BLND price

@llamatester
Copy link

The blend-pools adapter exports pools:

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

Nb of pools: 9
 

Sample pools:
┌─────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬───────────┬───────────────┬────────┬────────────────────┬───────────────────────┬────────────────────┬────────────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────┬────────────────────┬────────────────────┬─────────────────────┬────────────────────┬──────────────────────┬────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ (index) │ pool                                                                                                                        │ chain     │ project       │ symbol │ tvlUsd             │ apyBase               │ apyReward          │ underlyingTokens                                               │ rewardTokens                                                   │ totalSupplyUsd     │ totalBorrowUsd     │ apyBaseBorrow       │ apyRewardBorrow    │ ltv                  │ poolMeta               │ url                                                                                                        │
├─────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────────┼───────────────┼────────┼────────────────────┼───────────────────────┼────────────────────┼────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────┼────────────────────┼────────────────────┼─────────────────────┼────────────────────┼──────────────────────┼────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 0       │ 'cdvqvkoy2ysxs2ic7kn6mnasshpao7un2ur2on4oi2skmfjnvamdx6dp-cas3j7gylgxmf6tdjbbyyse3hq6bbsmlnuq34t6tzmymw2evh34xowma-stellar' │ 'Stellar' │ 'blend-pools' │ 'XLM'  │ 5025631.814809118  │ 0.0008800037972545027 │ 0.9663104952944307 │ [ 'CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA' ] │ [ 'CD25MNVTZDL4Y3XBCPCJXGXATV5WUHHOWMYFF4YBEGU5FCPGMYTVG5JY' ] │ 5076881.194575549  │ 51249.379766430924 │ 0.1101604660640465  │ NaN                │ 0.010094658078898694 │ 'Fixed XLM-USDC Pool'  │ 'https://mainnet.blend.capital/dashboard/?poolId=CDVQVKOY2YSXS2IC7KN6MNASSHPAO7UN2UR2ON4OI2SKMFJNVAMDX6DP' │
│ 1       │ 'cdvqvkoy2ysxs2ic7kn6mnasshpao7un2ur2on4oi2skmfjnvamdx6dp-ccw67tszv3sss2hxmbq5jfgckjnxkzm7uquwuzputhxstzleo7sjmi75-stellar' │ 'Stellar' │ 'blend-pools' │ 'USDC' │ 930685.1601896212  │ 4.27140458905102      │ 3.5917601681758753 │ [ 'CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75' ] │ [ 'CD25MNVTZDL4Y3XBCPCJXGXATV5WUHHOWMYFF4YBEGU5FCPGMYTVG5JY' ] │ 2731730.216458494  │ 1801045.0562688727 │ 8.255564059859633   │ 5.447792517753268  │ 0.6593056098357354   │ 'Fixed XLM-USDC Pool'  │ 'https://mainnet.blend.capital/dashboard/?poolId=CDVQVKOY2YSXS2IC7KN6MNASSHPAO7UN2UR2ON4OI2SKMFJNVAMDX6DP' │
│ 2       │ 'cde65qk2roz32v2lvlbokypx47tymyo37z6asqtbrtbnk53c7c6qf4y7-cas3j7gylgxmf6tdjbbyyse3hq6bbsmlnuq34t6tzmymw2evh34xowma-stellar' │ 'Stellar' │ 'blend-pools' │ 'XLM'  │ 650501.0014663523  │ 0.009100406099471492  │ 0.233856293983463  │ [ 'CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA' ] │ [ 'CD25MNVTZDL4Y3XBCPCJXGXATV5WUHHOWMYFF4YBEGU5FCPGMYTVG5JY' ] │ 698028.508188808   │ 47527.506722455684 │ 0.1487502208961322  │ 10.568737652987627 │ 0.06808820293855403  │ 'FxDAO Pool'           │ 'https://mainnet.blend.capital/dashboard/?poolId=CDE65QK2ROZ32V2LVLBOKYPX47TYMYO37Z6ASQTBRTBNK53C7C6QF4Y7' │
│ 3       │ 'cbp7no6f7frdhsofqbt2l2uwyiz2pu76jkvryaqtg3kzsqlyaokif2wb-cas3j7gylgxmf6tdjbbyyse3hq6bbsmlnuq34t6tzmymw2evh34xowma-stellar' │ 'Stellar' │ 'blend-pools' │ 'XLM'  │ 634414.5732073495  │ 0.1204310671256259    │ 2.2769623361664078 │ [ 'CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA' ] │ [ 'CD25MNVTZDL4Y3XBCPCJXGXATV5WUHHOWMYFF4YBEGU5FCPGMYTVG5JY' ] │ 962829.2390921032  │ 328414.66588475363 │ 0.4420716009436054  │ 10.01324656460863  │ 0.3410933658334174   │ 'YieldBlox Pool'       │ 'https://mainnet.blend.capital/dashboard/?poolId=CBP7NO6F7FRDHSOFQBT2L2UWYIZ2PU76JKVRYAQTG3KZSQLYAOKIF2WB' │
│ 4       │ 'cbp7no6f7frdhsofqbt2l2uwyiz2pu76jkvryaqtg3kzsqlyaokif2wb-ccw67tszv3sss2hxmbq5jfgckjnxkzm7uquwuzputhxstzleo7sjmi75-stellar' │ 'Stellar' │ 'blend-pools' │ 'USDC' │ 376440.5974900831  │ 5.334216481554033     │ 4.033597914476057  │ [ 'CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75' ] │ [ 'CD25MNVTZDL4Y3XBCPCJXGXATV5WUHHOWMYFF4YBEGU5FCPGMYTVG5JY' ] │ 1358796.6286867175 │ 982356.0311966344  │ 9.405090171096187   │ 6.695155788048723  │ 0.7229603094806657   │ 'YieldBlox Pool'       │ 'https://mainnet.blend.capital/dashboard/?poolId=CBP7NO6F7FRDHSOFQBT2L2UWYIZ2PU76JKVRYAQTG3KZSQLYAOKIF2WB' │
│ 5       │ 'caqf5knofigri24nqrrgupd46q45mgmxzmrtqfxs25y4nzvnpt34gm6s-cas3j7gylgxmf6tdjbbyyse3hq6bbsmlnuq34t6tzmymw2evh34xowma-stellar' │ 'Stellar' │ 'blend-pools' │ 'XLM'  │ 122541.91610986346 │ 0                     │ 6.823946224888289  │ [ 'CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA' ] │ [ 'CD25MNVTZDL4Y3XBCPCJXGXATV5WUHHOWMYFF4YBEGU5FCPGMYTVG5JY' ] │ 122541.91610986346 │ 0                  │ 0                   │ NaN                │ 0                    │ 'ReflectorFusion Pool' │ 'https://mainnet.blend.capital/dashboard/?poolId=CAQF5KNOFIGRI24NQRRGUPD46Q45MGMXZMRTQFXS25Y4NZVNPT34GM6S' │
│ 6       │ 'cbp7no6f7frdhsofqbt2l2uwyiz2pu76jkvryaqtg3kzsqlyaokif2wb-cdtkpwplourqa2sgtktuqowrcbzeorb4bwbomj3d3ztqqsge5f6jbqlv-stellar' │ 'Stellar' │ 'blend-pools' │ 'EURC' │ 87092.56869849599  │ 12.143689270872859    │ 10.918408400389826 │ [ 'CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV' ] │ [ 'CD25MNVTZDL4Y3XBCPCJXGXATV5WUHHOWMYFF4YBEGU5FCPGMYTVG5JY' ] │ 200791.71186655798 │ 113699.14316806199 │ 28.813348717716636  │ 19.281815609920123 │ 0.5662541651302027   │ 'YieldBlox Pool'       │ 'https://mainnet.blend.capital/dashboard/?poolId=CBP7NO6F7FRDHSOFQBT2L2UWYIZ2PU76JKVRYAQTG3KZSQLYAOKIF2WB' │
│ 7       │ 'caqf5knofigri24nqrrgupd46q45mgmxzmrtqfxs25y4nzvnpt34gm6s-ccw67tszv3sss2hxmbq5jfgckjnxkzm7uquwuzputhxstzleo7sjmi75-stellar' │ 'Stellar' │ 'blend-pools' │ 'USDC' │ 20772.957715949902 │ 1.8252531560313479    │ 10.262395778673614 │ [ 'CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75' ] │ [ 'CD25MNVTZDL4Y3XBCPCJXGXATV5WUHHOWMYFF4YBEGU5FCPGMYTVG5JY' ] │ 81483.8429410641   │ 60710.885225114194 │ 3.0815604707868927  │ NaN                │ 0.7450665436708154   │ 'ReflectorFusion Pool' │ 'https://mainnet.blend.capital/dashboard/?poolId=CAQF5KNOFIGRI24NQRRGUPD46Q45MGMXZMRTQFXS25Y4NZVNPT34GM6S' │
│ 8       │ 'cbp7no6f7frdhsofqbt2l2uwyiz2pu76jkvryaqtg3kzsqlyaokif2wb-cauikl3iygmerdrun6ysclwvakifg5q4yjhukm4s4njzqia3bas6ojpk-stellar' │ 'Stellar' │ 'blend-pools' │ 'AQUA' │ 15121.41862247818  │ 0.004060080834378255  │ 0                  │ [ 'CAUIKL3IYGMERDRUN6YSCLWVAKIFG5Q4YJHUKM4S4NJZQIA3BAS6OJPK' ] │ []                                                             │ 15631.078568982419 │ 509.65994650423755 │ 0.15602125376570353 │ NaN                │ 0.032605552090025504 │ 'YieldBlox Pool'       │ 'https://mainnet.blend.capital/dashboard/?poolId=CBP7NO6F7FRDHSOFQBT2L2UWYIZ2PU76JKVRYAQTG3KZSQLYAOKIF2WB' │
└─────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴───────────┴───────────────┴────────┴────────────────────┴───────────────────────┴────────────────────┴────────────────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────┴────────────────────┴────────────────────┴─────────────────────┴────────────────────┴──────────────────────┴────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

tvlUsd: totalSupply - totalBorrow,
// Supply is kept as APR to prevent overestimation of APY
apyBase: reserve.supplyApr * 100,
//Estimated weekly compounding
Copy link
Collaborator

Choose a reason for hiding this comment

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

if the pool doesn't auto-compound for the user, then lets keep using the previous fields

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The pool does auto compound but it requires the reserve/asset to be interacted with by some user ie. someone borrows or supplys which then triggers the reserve state to be updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If thats still a concern I can switch to use the apr rate just let me know

Copy link
Collaborator

Choose a reason for hiding this comment

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

If thats still a concern I can switch to use the apr rate just let me know

yeah better to use switch back to the non compounding fields, ty

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