COINGECKO icon indicating copy to clipboard operation
COINGECKO copied to clipboard

Wrong price is delivered when using GECKOPRICE("THOR";"USD")

Open bastians opened this issue 3 years ago • 4 comments

Wrong price is delivered when using =GECKOPRICE("THOR";"USD")

The price for https://www.coingecko.com/en/coins/thorswap is delivered instead of https://www.coingecko.com/en/coins/thor

When I do this API request I get the right price: https://api.coingecko.com/api/v3/simple/price?ids=thor&vs_currencies=usd

{
	"thor": {
		"usd": 117.67
	}
}

bastians avatar Jan 18 '22 09:01 bastians

It's a special case because the id thor is also a ticker which confuses the script. The solution is to use: =geckopricebyname("thor", "usd")

Eloise1988 avatar Jan 18 '22 14:01 Eloise1988

Thanks! But with this formula it's not possible to add multiple values (array), right?

Is it possible to add a formula that uses the tokens API ids from Coingecko? Because they seem to be unique.

bastians avatar Jan 18 '22 15:01 bastians

The geckoprice function takes both id and ticker. Thor is the only coin I have been signaled that is in conflict because thor is both an id and a ticker, plus it has a duplicate. This is why the only function that will work is geckopricebyname for this one.

Unfortunately geckopricebyname doesn't take arrays.

Eloise1988 avatar Jan 18 '22 16:01 Eloise1988

Ok, got it, your function takes both. So last suggestion :) Maybe you can add a parameter to the function that users can decide of id and ticker, id only or ticker only should be used ;)

bastians avatar Jan 18 '22 16:01 bastians