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

Add SCALE adapter #1126

Merged
merged 4 commits into from
Dec 23, 2023
Merged

Add SCALE adapter #1126

merged 4 commits into from
Dec 23, 2023

Conversation

ftm1337
Copy link
Contributor

@ftm1337 ftm1337 commented Dec 22, 2023

No description provided.

@ftm1337 ftm1337 changed the title add SCALE adapter [NEEDS HELP] add SCALE adapter Dec 22, 2023
@slasher125
Copy link
Collaborator

gm, ty for adding. change import to const sdk = require('@defillama/sdk4');
just ran this offline, there is a bug in:

  const rewardRate = (
    await sdk.api.abi.multiCall({
      calls: gauges.map((i) => ({
        target: i,
        params: [SCALE],
      })),
      abi: abiGauge.find((m) => m.name === 'rewardRate'),
      chain: 'base',
    })
  ).output.map((o) => o.output);

where gauges includes entries with null address

@ftm1337 ftm1337 changed the title [NEEDS HELP] add SCALE adapter Add SCALE adapter Dec 22, 2023
@llamatester
Copy link

The scale adapter exports pools:

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

Nb of pools: 40
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬────────┬─────────┬───────────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────┐
│ (index) │                     pool                     │ chain  │ project │    symbol     │       tvlUsd       │     apyReward      │                   rewardTokens                   │                                        underlyingTokens                                        │
├─────────┼──────────────────────────────────────────────┼────────┼─────────┼───────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────┤
│    0    │ '0xF3F1F5760a614B8146eec5D1c94658720c2425b9' │ 'Base' │ 'scale' │ 'WETH-USDBC'  │ 952515.1427613939  │ 50.56292577909591  │ [ '0x54016a4848a38f257B6E96331F7404073Fd9c32C' ] │ [ '0x4200000000000000000000000000000000000006', '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA' ] │
│    1    │ '0x83240b049Fa89b65be714aeD68e5B074df6aAc84' │ 'Base' │ 'scale' │  'WETH-USDC'  │ 787324.7391914302  │ 50.63357330799688  │ [ '0x54016a4848a38f257B6E96331F7404073Fd9c32C' ] │ [ '0x4200000000000000000000000000000000000006', '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' ] │
│    2    │ '0xc825c67cA3a80D487C339A6C16bB84f7DCA16012' │ 'Base' │ 'scale' │ 'WETH-SCALE'  │ 292836.7268437035  │ 122.51514770687957 │ [ '0x54016a4848a38f257B6E96331F7404073Fd9c32C' ] │ [ '0x4200000000000000000000000000000000000006', '0x54016a4848a38f257B6E96331F7404073Fd9c32C' ] │
│    3    │ '0xf7CBeF201dc2BE7489D7fD434E9D3c17af92C7c0' │ 'Base' │ 'scale' │  'DAI-USDBC'  │ 59625.39563021032  │ 32.02549837320606  │ [ '0x54016a4848a38f257B6E96331F7404073Fd9c32C' ] │ [ '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb', '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA' ] │
│    4    │ '0xa7802Bbd9a6e38E0E209AA6f43A8ddD4d35c1111' │ 'Base' │ 'scale' │ 'SCALE-FBOMB' │ 56033.291558806624 │ 465.71506156278673 │ [ '0x54016a4848a38f257B6E96331F7404073Fd9c32C' ] │ [ '0x54016a4848a38f257B6E96331F7404073Fd9c32C', '0x74ccbe53F77b08632ce0CB91D3A545bF6B8E0979' ] │
│    5    │ '0xCd42a2C43b09e28e295a72A59a48D77d5e1ADa30' │ 'Base' │ 'scale' │ 'WETH-PUBLX'  │ 51878.449248452576 │ 887.5166323670951  │ [ '0x54016a4848a38f257B6E96331F7404073Fd9c32C' ] │ [ '0x4200000000000000000000000000000000000006', '0xD1f398d6B3E5e2387E413831e206CFEB5fc1dcEe' ] │
│    6    │ '0xDa5A39B10FCFCD012c0686f35f49388F88E785ED' │ 'Base' │ 'scale' │  'WETH-NFI'   │ 45545.57125506233  │ 893.9570953737821  │ [ '0x54016a4848a38f257B6E96331F7404073Fd9c32C' ] │ [ '0x4200000000000000000000000000000000000006', '0x60359A0DD148B18d5cF1Ddf8Aa1916221ED0cbCd' ] │
│    7    │ '0x94Fe2DC68a1ABD3053F380E51799E0f52700DB0F' │ 'Base' │ 'scale' │ 'WETH-TOSHI'  │ 44505.57761407973  │ 4.003747120489372  │ [ '0x54016a4848a38f257B6E96331F7404073Fd9c32C' ] │ [ '0x4200000000000000000000000000000000000006', '0x8544FE9D190fD7EC52860abBf45088E81Ee24a8c' ] │
│    8    │ '0x1D8F2b55785359636f9b8245B394B3a4C5e24397' │ 'Base' │ 'scale' │  'WETH-DIP'   │ 36179.606399098804 │  8.04330072863709  │ [ '0x54016a4848a38f257B6E96331F7404073Fd9c32C' ] │ [ '0x4200000000000000000000000000000000000006', '0xAdBa4694F5deAF3251d06dec38C86946F8952EFB' ] │
│    9    │ '0xe9a5452aC188079cE00707C2b1076A1a58e80b18' │ 'Base' │ 'scale' │ 'USD+-USDBC'  │ 35995.492965075864 │ 57.547102508138806 │ [ '0x54016a4848a38f257B6E96331F7404073Fd9c32C' ] │ [ '0xB79DD08EA68A908A97220C76d19A6aA9cBDE4376', '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA' ] │
└─────────┴──────────────────────────────────────────────┴────────┴─────────┴───────────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

@ftm1337
Copy link
Contributor Author

ftm1337 commented Dec 22, 2023

thanks @slasher125, using sdk4 was the magic word!

@slasher125 slasher125 merged commit ba0e29a into DefiLlama:master Dec 23, 2023
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