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

Update Inception Yield #1454

Closed
wants to merge 15 commits into from
Closed

Update Inception Yield #1454

wants to merge 15 commits into from

Conversation

Sk1mer12
Copy link

@Sk1mer12 Sk1mer12 commented Aug 7, 2024

No description provided.

@slasher125
Copy link
Collaborator

@Sk1mer12 there is no getRate function on 0x46199cAa0e453971cedf97f926368d9E5415831a

@llamatester
Copy link

Error while running inception adapter:

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

Nb of pools: 1
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬────────────┬──────────────────┬─────────┬───────────────────┬────────────────────┬─────────────────────┬──────────────────────────────────────────────────┐
│ (index) │                     pool                     │   chain    │     project      │ symbol  │      tvlUsd       │      apyBase       │      apyBase7d      │                 underlyingTokens                 │
├─────────┼──────────────────────────────────────────────┼────────────┼──────────────────┼─────────┼───────────────────┼────────────────────┼─────────────────────┼──────────────────────────────────────────────────┤
│    0    │ '0xf073bAC22DAb7FaF4a3Dd6c6189a70D54110525C' │ 'ethereum' │ 'ether.fi-stake' │ 'inETH' │ 792772.9815178711 │ -1.921641488121472 │ -2.8538567857870354 │ [ '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' ] │
└─────────┴──────────────────────────────────────────────┴────────────┴──────────────────┴─────────┴───────────────────┴────────────────────┴─────────────────────┴──────────────────────────────────────────────────┘
}

@llamatester
Copy link

Error while running inception adapter:

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

Nb of pools: 1
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬────────────┬─────────────┬─────────┬───────────────────┬────────────────────┬─────────────────────┬──────────────────────────────────────────────────┐
│ (index) │                     pool                     │   chain    │   project   │ symbol  │      tvlUsd       │      apyBase       │      apyBase7d      │                 underlyingTokens                 │
├─────────┼──────────────────────────────────────────────┼────────────┼─────────────┼─────────┼───────────────────┼────────────────────┼─────────────────────┼──────────────────────────────────────────────────┤
│    0    │ '0xf073bAC22DAb7FaF4a3Dd6c6189a70D54110525C' │ 'ethereum' │ 'Inception' │ 'inETH' │ 792772.9815178711 │ -1.921641488121472 │ -2.8538567857870354 │ [ '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' ] │
└─────────┴──────────────────────────────────────────────┴────────────┴─────────────┴─────────┴───────────────────┴────────────────────┴─────────────────────┴──────────────────────────────────────────────────┘
}

@llamatester
Copy link

Error while running inception adapter:

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

Nb of pools: 1
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬────────────┬─────────────┬─────────┬───────────────────┬───────────────────────┬─────────────────────────┬──────────────────────────────────────────────────┐
│ (index) │                     pool                     │   chain    │   project   │ symbol  │      tvlUsd       │        apyBase        │        apyBase7d        │                 underlyingTokens                 │
├─────────┼──────────────────────────────────────────────┼────────────┼─────────────┼─────────┼───────────────────┼───────────────────────┼─────────────────────────┼──────────────────────────────────────────────────┤
│    0    │ '0xf073bAC22DAb7FaF4a3Dd6c6189a70D54110525C' │ 'ethereum' │ 'Inception' │ 'inETH' │ 792772.9815178711 │ -0.000052647712003328 │ -0.00007818785714485028 │ [ '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' ] │
└─────────┴──────────────────────────────────────────────┴────────────┴─────────────┴─────────┴───────────────────┴───────────────────────┴─────────────────────────┴──────────────────────────────────────────────────┘
}

@llamatester
Copy link

Error while running inception adapter:

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

Nb of pools: 1
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬────────────┬─────────────┬─────────┬───────────────────┬────────────────────┬─────────────────────┬──────────────────────────────────────────────────┐
│ (index) │                     pool                     │   chain    │   project   │ symbol  │      tvlUsd       │      apyBase       │      apyBase7d      │                 underlyingTokens                 │
├─────────┼──────────────────────────────────────────────┼────────────┼─────────────┼─────────┼───────────────────┼────────────────────┼─────────────────────┼──────────────────────────────────────────────────┤
│    0    │ '0xf073bAC22DAb7FaF4a3Dd6c6189a70D54110525C' │ 'ethereum' │ 'Inception' │ 'inETH' │ 792772.9815178711 │ -1.921641488121472 │ -2.8538567857870354 │ [ '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' ] │
└─────────┴──────────────────────────────────────────────┴────────────┴─────────────┴─────────┴───────────────────┴────────────────────┴─────────────────────┴──────────────────────────────────────────────────┘
}

@Sk1mer12
Copy link
Author

Sk1mer12 commented Aug 8, 2024

Hey @slasher125 Can you give me a little help here?

@slasher125
Copy link
Collaborator

hey, there are so many issues here, from trying to change the value of a constant variable to using the wrong abis...
can u send me a link to where i can actually deposit eth to receive inETH?

@Sk1mer12
Copy link
Author

hey, there are so many issues here, from trying to change the value of a constant variable to using the wrong abis... can u send me a link to where i can actually deposit eth to receive inETH?

For sure!
This one allows you to get rates -> https://etherscan.io/address/0x122ee24Cb3Cc1b6B987800D3B54A68FC16910Dbf#readProxyContract

This is the token address ->
https://etherscan.io/token/0xf073bac22dab7faf4a3dd6c6189a70d54110525c

This is the vault where eth gets deposited ->
https://etherscan.io/address/0x46199caa0e453971cedf97f926368d9e5415831a

@Sk1mer12
Copy link
Author

@slasher125 Bumping this up sir

@slasher125
Copy link
Collaborator

i'm looking into this

@slasher125
Copy link
Collaborator

how do u guys calculate the APR: 0.54% on ur ui?

@Sk1mer12
Copy link
Author

@slasher125 we use Ratio today / Ratio 7d

@slasher125
Copy link
Collaborator

what is ratio? averagePercentageRate?

@Sk1mer12
Copy link
Author

Sk1mer12 commented Aug 15, 2024

@slasher125 yes exactly sir

@slasher125
Copy link
Collaborator

doing that, i'm not getting anywhere close to what you guys report on your ui

@Sk1mer12
Copy link
Author

@slasher125 what values are you getting?

on the function averagePercentageRate you need to call inEth contract ([0xf073bac22dab7faf4a3dd6c6189a70d54110525c]
)

@slasher125
Copy link
Collaborator

yes i'm doing that and getting completely different values

@Sk1mer12
Copy link
Author

Can you share the values you are getting? @slasher125
Also can you share the code you are using please?

@slasher125
Copy link
Collaborator

const axios = require('axios');

const abi = require('./abi');
const abiVault = require('./abiVault');

const inETH = '0xf073bAC22DAb7FaF4a3Dd6c6189a70D54110525C';
const vault = '0x122ee24cb3cc1b6b987800d3b54a68fc16910dbf';
const weth = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2';

const apy = async () => {
  const totalSupply =
    (
      await sdk.api.abi.call({
        target: inETH,
        abi: 'erc20:totalSupply',
      })
    ).output / 1e18;

  const apr1d =
    (
      await sdk.api.abi.call({
        target: vault,
        abi: abiVault.find((m) => m.name === 'averagePercentageRate'),
        params: [inETH, 1],
      })
    ).output / 1e18;

  const apr7d =
    (
      await sdk.api.abi.call({
        target: vault,
        abi: abiVault.find((m) => m.name === 'averagePercentageRate'),
        params: [inETH, 7],
      })
    ).output / 1e18;

  const priceKey = `ethereum:${inETH}`;
  const price = (
    await axios.get(`https://coins.llama.fi/prices/current/${priceKey}`)
  ).data.coins[priceKey]?.price;

  return [
    {
      pool: inETH,
      chain: 'ethereum',
      project: 'genesislrt-(native-restaking)',
      symbol: 'inETH',
      tvlUsd: totalSupply * price,
      apyBase: apr1d,
      apyBase7d: apr7d,
      underlyingTokens: [weth],
    },
  ];
};

module.exports = {
  apy,
  url: 'https://www.inceptionlrt.com/app/restaking/restake/?token=ETH',
};

@Sk1mer12
Copy link
Author

@slasher125 What is going wrong exactly with the code?
I believe everyhting is going properly

@slasher125
Copy link
Collaborator

merged 588552b

@slasher125 slasher125 closed this Aug 20, 2024
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