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

fix: main page price xtz/usdt #43

Merged
merged 2 commits into from
Dec 11, 2024
Merged

Conversation

iiAku
Copy link
Collaborator

@iiAku iiAku commented Dec 5, 2024

This is a quick fix for showing the proper price on the main page of Kolibri from the Youves oracle smart contract.
Contract: https://tzkt.io/KT1ExbCyFbsvPQTUitHAK7HSfYkJgiCtBGpM

We are fetching the price directly from the storage contract using that endpoint:
https://api.tzkt.io/v1/bigmaps/597699/keys/XTZUSDT

image

Perhaps for kolibri long term view and avoiding spamming tzkt api publicly. It might be great if we are deploying a service expose (essentially an API). That expose the same data through with cached responses as long as the price is not updated.

@iiAku iiAku force-pushed the fix/main-page-price branch from 801e199 to 7be081d Compare December 5, 2024 21:01
@xtzchad
Copy link

xtzchad commented Dec 6, 2024

we can access same values using mainnet rpc btw:

https://rpc.tzbeta.net/chains/main/blocks/head/context/big_maps/597699
To get the exact xtzusdt key:
https://rpc.tzbeta.net/chains/main/blocks/head/context/big_maps/597699/exprtbVCZ3qh45pH3wZpx1TN2pAJ94pss44kpbHodsxuQ8E7ntVw4M

it may be abit quicker than tzkt api which have few seconds lag updating data when new blocks are pushed
plus, several backup rpcs can be added if one goes offline

@iiAku
Copy link
Collaborator Author

iiAku commented Dec 6, 2024

we can access same values using mainnet rpc btw:

https://rpc.tzbeta.net/chains/main/blocks/head/context/big_maps/597699 To get the exact xtzusdt key: https://rpc.tzbeta.net/chains/main/blocks/head/context/big_maps/597699/exprtbVCZ3qh45pH3wZpx1TN2pAJ94pss44kpbHodsxuQ8E7ntVw4M

it may be abit quicker than tzkt api which have few seconds lag updating data when new blocks are pushed plus, several backup rpcs can be added if one goes offline

Thanks for this point, addressed :)

Copy link
Member

@Fitblip Fitblip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane to me, thank you!

@Fitblip Fitblip merged commit b05b321 into Hover-Labs:master Dec 11, 2024
3 of 4 checks passed
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