Git Product home page Git Product logo

Comments (2)

ruuda avatar ruuda commented on August 16, 2024 1

To get the amount of SOL managed, there is https://solana.lido.fi/api/stats, but this is an internal endpoint that is intended for the staking widget only, we don’t make any stability guarantees about the response and we might rate-limit or block it if we see it being abused. To get the amount of stSOL in existence, you can use https://solana.lido.fi/api/stsol?q=totalcoins. This endpoint is stable. Note that the exchange rate is not the current ratio of stSOL supply / SOL managed, it is fixed per epoch, see also https://docs.solana.lido.fi/internals/exchange-rate.

Of course, using that data is at your own risk. You shouldn’t trust data returned by some random endpoint from some random server, it might lie to you. The best way to get the stSOL price is to run your own Solana RPC node (or commission one from somebody you trust), read the Solido instance account, and extract the exchange rate from there. (The true exchange rate used by the program is stored on-chain in the instance.)

We are working on a Typescript library that facilitates this, you can find the code for that here, but it’s a work in progress: https://github.com/ChorusOne/solido/tree/main/js. If you want to do it manually, there are some snippets here: https://docs.solana.lido.fi/development/frontend-integration.

from solido.

Olitelkes avatar Olitelkes commented on August 16, 2024

Thank you very much for your very detailed answer, appreciate a lot.

Have a good day.

from solido.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.