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

[solidly-v3] adapter implementation tvl, apyBase, apyReward #1009

Merged
merged 10 commits into from
Sep 26, 2023

Conversation

copiumnicus
Copy link
Contributor

No description provided.

@copiumnicus
Copy link
Contributor Author

Hey guys automated checks are failing because of missing alchemy link in ci. Works fine locally. I think it is the same case as #694
What I'm doing is simply:

 let provider = new ethers.providers.JsonRpcProvider(
    process.env.ALCHEMY_CONNECTION_ETHEREUM,
    1
  );

which in CI fails with could not detect network because of missing link when accessing env

@slasher125
Copy link
Collaborator

ty for adding, works fine locally, putting this as reference:

Nb of pools: 6
 

Sample pools: [
  {
    pool: '0x3198eadb777b9b6c789bfc89491774644e95ed7e',
    chain: 'ethereum',
    project: 'solidly-v3',
    symbol: 'WETH-USDT',
    tvlUsd: 1930073.5551466953,
    apyBase: 102.86241227740443,
    apyReward: 23.216403906479975,
    rewardTokens: [ '0x777172d858dc1599914a1c4c6c9fc48c99a60990' ],
    url: 'https://solidly.com/liquidity/manage/0x3198eadb777b9b6c789bfc89491774644e95ed7e/',
    underlyingTokens: [
      '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
      '0xdac17f958d2ee523a2206206994597c13d831ec7'
    ]
  },
  {
    pool: '0xcf1d0dfcd86dcfa4402b838fb9c21a576320c37e',
    chain: 'ethereum',
    project: 'solidly-v3',
    symbol: 'USDC-USDT',
    tvlUsd: 293936.8050951245,
    apyBase: 0,
    apyReward: 0,
    rewardTokens: [],
    url: 'https://solidly.com/liquidity/manage/0xcf1d0dfcd86dcfa4402b838fb9c21a576320c37e/',
    underlyingTokens: [
      '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
      '0xdac17f958d2ee523a2206206994597c13d831ec7'
    ]
  },
  {
    pool: '0xafed85453681dc387ee0e87b542614722ee2cfed',
    chain: 'ethereum',
    project: 'solidly-v3',
    symbol: 'USDC-WETH',
    tvlUsd: 242715.22400497005,
    apyBase: 137.18180903536998,
    apyReward: 136.2348914130188,
    rewardTokens: [ '0x777172d858dc1599914a1c4c6c9fc48c99a60990' ],
    url: 'https://solidly.com/liquidity/manage/0xafed85453681dc387ee0e87b542614722ee2cfed/',
    underlyingTokens: [
      '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
      '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    ]
  },
  {
    pool: '0x51adfd3244c0c18d064842f99c0be3ac952725c0',
    chain: 'ethereum',
    project: 'solidly-v3',
    symbol: 'SOLID-WETH',
    tvlUsd: 115835.62778426016,
    apyBase: 0,
    apyReward: 256.56323712724827,
    rewardTokens: [ '0x777172d858dc1599914a1c4c6c9fc48c99a60990' ],
    url: 'https://solidly.com/liquidity/manage/0x51adfd3244c0c18d064842f99c0be3ac952725c0/',
    underlyingTokens: [
      '0x777172d858dc1599914a1c4c6c9fc48c99a60990',
      '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    ]
  },
  {
    pool: '0x9f5f971286b5701b5cdec94f34abbfdf92e619b7',
    chain: 'ethereum',
    project: 'solidly-v3',
    symbol: 'WBTC-WETH',
    tvlUsd: 93189.7579821806,
    apyBase: 1.8585388225613482,
    apyReward: 32.0281379023766,
    rewardTokens: [ '0x777172d858dc1599914a1c4c6c9fc48c99a60990' ],
    url: 'https://solidly.com/liquidity/manage/0x9f5f971286b5701b5cdec94f34abbfdf92e619b7/',
    underlyingTokens: [
      '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
      '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    ]
  },
  {
    pool: '0xb23c9212c7cb9c01f08e942368b890b7ae161c10',
    chain: 'ethereum',
    project: 'solidly-v3',
    symbol: 'LINK-WETH',
    tvlUsd: 4866.755702130011,
    apyBase: 0,
    apyReward: 363.2024474465056,
    rewardTokens: [ '0x777172d858dc1599914a1c4c6c9fc48c99a60990' ],
    url: 'https://solidly.com/liquidity/manage/0xb23c9212c7cb9c01f08e942368b890b7ae161c10/',
    underlyingTokens: [
      '0x514910771af9ca656af840dff83e8264ecf986ca',
      '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    ]
  }
]

does apyBase/apyReward require lockups/vesting? we only show lower bound values.
also, which values are u displaying, narrow, balanced, wide?
ty

@copiumnicus
Copy link
Contributor Author

Hey, so apyReward is non lockup it has two components SOLID emissions and custom token emissions, every lp gets them.

Apy base I just changed it to be fees / active_tvl where active tvl is approximated same as in uniswap which is the +-30% (just took their code from the adapter for that part)

@seraphx333
Copy link

seraphx333 commented Sep 23, 2023

@slasher125 After thinking on it more, we'd like to propose an updated method of displaying APRs more accurately. Currently the adapter shows what a simulated position with a +- 30% range would earn on the platform. But in my opinion DefiLama should show to users what users currently are earning on the platform. The original method can be highly inaccurate because different pools and assets have a completely different range of risk, so some assets will have average ranges of 5% (less volatile, bluechip) while other assets will have ranges of +-100% (more volatile, exotic)

The proposed mechanism would be to fetch all active positions at the current tick and aggregate their TVL, which will display the current average APR that all positions are earning on the platform at a given point in time. For reference please see the table on https://solidly.com/liquidity, the proposed value is what we show on our UI as Real APR. To keep the hypothetical / simulated APRs, we could add a second column on DefiLlama which would be called Range APRs. We we could show different settings of a given pool (similar to what you are doing now).

Please let me know what you think about this and how we should proceed.

If accepted, I suggest you also apply it to other CLAMMs such as Uniswap, as it's an accurate reflection of real yields instead of assumption-based yields which will never reflect reality.

For reference:
image

@seraphx333
Copy link

bump @slasher125

@slasher125
Copy link
Collaborator

sry for late reply.
for consistency reasons i prefer keeping the current version, but i generally agree with u @seraphx333
i'll keep this in mind for yields v2

@slasher125 slasher125 merged commit c842812 into DefiLlama:master Sep 26, 2023
1 check failed
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