Giveth / impact-graph

MIT License
49 stars 18 forks source link

Fetch prices of SOL & Solana tokens #1175

Closed divine-comedian closed 9 months ago

divine-comedian commented 1 year ago

Tokens will be

WDYT @jainkrati ?

We should figure out if we are getting these from APIs (which could be expensive) or if we want to use a solution similar to what we have with the monoswap repo pricing @mateodaza and @mohammadranjbarz handles most of this.

Here's the repo https://github.com/Giveth/monoswap

jainkrati commented 12 months ago

Fetching latest token prices https://www.quicknode.com/guides/solana-development/3rd-party-integrations/pyth-price-feeds

divine-comedian commented 12 months ago

Fetching latest token prices https://www.quicknode.com/guides/solana-development/3rd-party-integrations/pyth-price-feeds

I see this protocol requires some development in Rust.. Is this the only option or is there easier options for our team that are available in JS?

jainkrati commented 11 months ago

Thanks @divine-comedian . Some options in Typescript APIs are https://coinmarketcap.com/api/documentation/v1/#operation/getV2CryptocurrencyQuotesLatest, https://docs.moralis.io/web3-data-api/solana/reference/get-sol-token-price?network=mainnet&address=SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt, https://docs.birdeye.so/reference/get_public-price,

mohammadranjbarz commented 11 months ago

@jainkrati @aminlatifi @MoeNick @divine-comedian We have the codebase for coingecko, if the plans are ok we can use it for Solana tokens prices https://www.coingecko.com/en/api

Screen Shot 1402-09-13 at 15 47 01
aminlatifi commented 11 months ago

@jainkrati @aminlatifi @MoeNick @divine-comedian We have the codebase for coingecko, if the plans are ok we can use it for Solana tokens prices https://www.coingecko.com/en/api

Screen Shot 1402-09-13 at 15 47 01

We only use coingecko for ETC and Solana in the future, so a free plan would be enough for us!

MoeNick commented 10 months ago

@mohammadranjbarz @aminlatifi Is there any progress here on prices and donation verification? is that the issue I should track?

aminlatifi commented 10 months ago

@mohammadranjbarz @aminlatifi Is there any progress here on prices and donation verification? is that the issue I should track?

@mohammadranjbarz Is working on donation verification and @CarlosQ96 takes care of donation saving and price fetching.

mohammadranjbarz commented 10 months ago

@divine-comedian @MoeNick

Can you give me a simple token transfer for each token we want to support ( I looked in block explorer but all of them that I checked were batch transfer not a single transfer) I need it to write test cases

MoeNick commented 10 months ago

I put this in progress.

MoeNick commented 10 months ago

@divine-comedian @MoeNick

Can you give me a simple token transfer for each token we want to support ( I looked in block explorer but all of them that I checked were batch transfer not a single transfer) I need it to write test cases

I think this is related @mohammadranjbarz https://github.com/Giveth/impact-graph/issues/1172

CarlosQ96 commented 10 months ago

I did the price fetch for Solana token and updating the price with a function. This works with a coingeckoId, we should be good now.

Not sure it requires a more robust implementation. Ill move to QA

CarlosQ96 commented 10 months ago

Should we make a migration to add the rest of the tokens or is that in another phase? @mohammadranjbarz @MoeNick

mohammadranjbarz commented 10 months ago

Should we make a migration to add the rest of the tokens or is that in another phase? @mohammadranjbarz @MoeNick

Yeah I agree with you

MoeNick commented 10 months ago

Can you provide the estimatios? @CarlosQ96

mohammadranjbarz commented 10 months ago

@CarlosQ96 You can add all the tokens in your migration, because now we can verify spl-token transfer on solana (It's almost done, but I'm refactoring to push after that)

CarlosQ96 commented 10 months ago

Half a day, I'll continue on it today.

CarlosQ96 commented 10 months ago

Added the tokens from mainnet migration to Mohammads PR as they touched similar changes. Coingecko returns all those tokens easily as they are supported in their API

aminlatifi commented 10 months ago
  • 0xaec945e04baf28b135fa7c640f624f8d90f1c3a6

@divine-comedian The address you had entered for coin98 is an evm one, we used this address instead C98A4nkJXhpVZNAZdHUA95RpTF3T4whtQubL3YobiUX9