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

How does the chain get the token price? #1217

Open
lance-web3 opened this issue Aug 22, 2024 · 4 comments
Open

How does the chain get the token price? #1217

lance-web3 opened this issue Aug 22, 2024 · 4 comments

Comments

@lance-web3
Copy link

What should I configure?

cgw logs

{"build_number":"234a559","level":"error","message":"Error getting native coin price: Error ","request_id":"052850c3-0ba6-402e-b422-9aada3087714","timestamp":"2024-08-22T08:51:01.820Z","version":"v1.53.0"}

{"build_number":"234a559","level":"error","message":"Error getting token prices: Error: Error getting 0x5fd55a1b9fc24967c4db09c513c3ba0dfa7ff687 price from provider ","request_id":"7e46512c-42ef-4daf-90e7-35794b0c8b09","timestamp":"2024-08-22T08:51:32.146Z","version":"v1.53.0"}

ui screen capture
image

cfg admin config
image

@fmrsabino @hectorgomezv @iamacook

@hectorgomezv
Copy link
Member

Hello @lance-web3,

We currently use Coingecko to get the fiat prices, so you would need to take those configuration values from the Coingecko API: https://api.coingecko.com/api/v3/asset_platforms

I understand you are trying to get prices on fxCore Mainnet, so:

    {
        "id": "function-x",
        "chain_identifier": 530,
        "name": "Function X",
        "shortname": "",
        "native_coin_id": "fx-coin"
    },

So:

Prices provider native coin: fx-coin
Prices provider chain name: function-x

You can left "Balances provider" configuration keys empty.

@lance-web3
Copy link
Author

Hello @lance-web3,

We currently use Coingecko to get the fiat prices, so you would need to take those configuration values from the Coingecko API: https://api.coingecko.com/api/v3/asset_platforms

I understand you are trying to get prices on fxCore Mainnet, so:

    {
        "id": "function-x",
        "chain_identifier": 530,
        "name": "Function X",
        "shortname": "",
        "native_coin_id": "fx-coin"
    },

So:

Prices provider native coin: fx-coin
Prices provider chain name: function-x

You can left "Balances provider" configuration keys empty.

ok it works, how about for all other tokens? I am wondering.. @hectorgomezv

@hectorgomezv
Copy link
Member

You'd need to configure the native_coin_id (in the Coingecko response) as Prices provider native coin (in the Config Service Chain configuration). And also id (in the Coingecko response) as Prices provider chain name (in the Config Service Chain configuration).

@lance-web3
Copy link
Author

lance-web3 commented Sep 2, 2024

You'd need to configure the native_coin_id (in the Coingecko response) as Prices provider native coin (in the Config Service Chain configuration). And also id (in the Coingecko response) as Prices provider chain name (in the Config Service Chain configuration).

@hectorgomezv

Say we have more than 1 tokens, You mean it can configure multiple in those field? e.g.

Prices provider native coin: fx-coin,coin2,coin3
Prices provider chain name: function-x

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

No branches or pull requests

2 participants