All About Pyth I Nidhi Singh
ETHGlobal·Sun, Nov 9, 2025, 12:00 AM
Nidhi Singh presents a detailed workshop on Pyth, explaining everything developers and hackathon participants need to know about integrating Pyth’s price feeds and entropy into their Web3 applications. She begins by comparing push-based vs. pull-based oracle models, describing how Pyth’s on-demand (pull) price feeds give developers control, ensuring accurate and up-to-date pricing while reducing gas inefficiency common in legacy oracle systems. She walks through the Solidity SDK, showing how to fetch price feed IDs, obtain contract addresses, and use Hermes, Pyth’s off-chain service, to retrieve and update prices on-chain. Nidhi emphasizes that for hackathon eligibility, developers must update prices on-chain using the pull mechanism rather than relying on cached or unsafe methods. In the second part, she introduces Pyth Entropy, a secure on-chain randomness protocol based on a commit-and-reveal cryptographic scheme. Developers learn how to request random numbers, handle callbacks in smart contracts, and debug using the Entropy Explorer. The session concludes with a look at Entropy v2, customizable gas limits, and developer resources including documentation, error codes, and community forums. 00:10 Introduction & disclaimer 00:37 Overview of Pyth tracks: Price Feeds & Entropy 01:06 How Pyth’s price feed architecture differs from other oracles 02:16 Push-based vs. Pull-based models explained 04:05 Pull-based on-demand pricing and Hermes integration 05:13 How to integrate Pyth price feeds 06:27 Getting price feed IDs and contract addresses 07:56 Supported chains and asset classes 09:03 Using Hermes via REST, SDK, or WebSockets 10:30 Updating vs. getting prices; avoiding stale data 11:44 Smart contract example: updatePrice → getPriceNoOlderThan 12:52 Unsafe methods and bounty disqualification warnings 13:45 Developer Q&A: integration types, off-chain eligibility, latency 17:12 Intro to Entropy — secure randomness for smart contracts 17:57 How commit-and-reveal randomness works 20:10 Advantages over VRF and permissionless access 21:21 Implementing Entropy in EVM contracts (request + callback) 23:15 Using the Entropy Explorer for debugging 24:23 Gas limits, Entropy v2, and requestV2 upgrades 25:42 Handling callback failures and retrying 26:37 Dev forum for support & Q&A 27:20 Workshop close and resource sharing _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 💻 ETHOnline 2025 This workshop is specifically for ETHOnline 2025, a 21-day hackathon held October 10 - 31, 2025, bringing together the most skilled web3 developers, designers and product builders from all around the globe for a weekend-long adventure to advance the Ethereum ecosystem! _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ✅ Follow Pyth Network X: https://x.com/PythNetwork ✅ Follow ETHGlobal X: https://x.com/ETHGlobal Warpcast: https://warpcast.com/ethglobal Website: https://ethglobal.com YouTube: https://www.youtube.com/c/ETHGlobal _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _Are you interested in Ethereum development and entrepreneurship?_ 👉 Sign up for the next ETHGlobal event: https://ethglobal.com/events 🎁 Get exclusive access and perks with ETHGlobal Plus! https://ethglobal.com/plus 📣 Want us to throw an event in your city? Tell us where! https://ethglobal.com/city
Transcript
[Music] Hi everyone, welcome to PIT's workshop. So today we will talk everything about PIT that you need to know as a hacker. So before starting I'll give you a quick disclaimer. So this workshop is for educational purpose only and it does not constitute any financial advice. So with that let's start the workshop.
Okay. Yeah. So there are two tracks that we have for this hackathon. The first one is the price feeds and the second is entropy. So I'll first start with a price feeds walk through.
So essentially how price feed works in PT is little different from other Oracle providers. So by default we have this mechanism of pullbased prices and then we also have a pushbased model. I'll get into the details in some time but to begin with it's like at a very high level we have all these publishers that publish their data to us and then pit aggregates the data and it gives you an aggregated price that you can use for your application. So currently we have onboarded more than 125 publishers with PIT and we have close to 1,500 price feeds that are live. We are active on 100 plus chains.
And so this is how the stats look like. And then now I want to take a moment to walk you guys through the architecture of the Oracle. So the traditional Oracle or the legacy Oracle that we have most of them nowadays use pushbased model and we support both of these. So for you as a hacker it's important to note the differences between differences between these two models so you understand how pit works. So let's start with the pushbased model.
So in pushbased model what happens is we have a oracle network and it continuously keeps on updating the prices on chain and the prices are updated at a certain frequency. It could be 10 minutes or 1 hour. It depends on the operators that are running the network. And you as a user you need to get the data from the smart contracts of the oracle. So this was the traditional approach but it's not very efficient and there are couple of reasons behind it.
So the first is when the network is updating the prices on chain every update requires gas to be paid. So it is not gas efficient. It doesn't matter if people are using it or not. It will still keep on updating the prices. So that's the first aspect.
And then the second aspect is there could be scenarios where the rale could be out of price. What I mean by that is let's say there's some congestion in the network. So it could be there could be a scenario where the smart contract can have prices which are not up to date due to some network issues or congestion in the blockchain network. So that's another scenario. So these two things can like they it works but it's not very efficient to put in that way.
So to overcome some of these limitations we have this architecture of pullbased Oracle. So what happens here is you as a user have full control and flexibility when you want to get the price feeds and it's like a ondemand oracle. So you pay for the prices that you want to use. So it's you, it's your smart contract that will update the prices on chain and then use it. And all of this could be done in one single transaction.
And this is made possible by Hermes which is like an off-chain service that we have built. So Hermes essentially gives you the like it aggregates the prices across the fitnet and the wormhole network and it gives you prices and then you can get the prices and update it onchain and use wherever you want to use. So this ensures that the prices are never stale. If they are the system is designed to give you errors. So if you if you will be building on pit using the pullbased mechanism you will notice errors like sale prices or price not found and that is happening because of this architecture.
It's based on the pull architecture. So this is how the differences are between the models. I hope it is clear and now we will talk about how you can integrate the price feeds. So for that let's check out the docs. So we have this whole section for price feeds and for this hackathon specifically we require you to use the pullbased mechanism which is you will update the prices whenever you want to use it.
So this is the guide and this is your go-to reference material for getting the real time price data and for this hackathon since it's ETH global this is the page that you should be interested in it's it talks all about how you can integrate the price feeds in your EVM contracts and we have built a solidity SDK that you can use so you can use any of the smart contract contract development framework out there and we have also given like a example contract which is pretty straightforward to understand. So if you are interested in this there are a couple of things that you need to keep in mind. So the first thing is uh let's say if you want to get the prices for certain asset so you need to get the price feed ID for those assets. What I mean is let's say if you want to get the price of ETH in US dollars so you need to get the price feed ID and the set second thing that we need is the pith contract address. So how it works is it again goes back to the working.
So we have like a pithnet which is application specific blockchain that we have and then we have a contract on the target chains that uh it is supported on. So you need to get the address for the chain that you are interested in. In case of EVM let's say it could be abstract or it could be base or any of the chains. I'll show you how you can get these two details first. So for getting the contract address you can just click here and then it shows you the addresses that you need to use and it will vary depending on the chain.
So let's say if you are on blast this is the address on base we have a different address right this is one thing that you need to take note of and then the other thing is the price feed ID that we were talking about. So this is the page that will guide you to the all the price feed ids and at the bottom you can see a list you can see okay what all symbols do we we support because we don't just provide crypto we provide equities forex commodities so it's up to you what use case you want to build so your use case shouldn't be like it doesn't have to be necessarily limited to crypto. It can be expanded to any asset class that we support. So from here you should copy the ID from this column the stable price feed ID and this was the second prerequisite that we need for getting the price feeds. And then the third point is like I talked about this Hermes API right.
So you need to first get the prices from Hermes and how we can do that is we will go to fetch price updates. So this is like a service that we have built and there are like three methods through which you can get the price updates from Hermes. The first one is the rest API like a basic curl command. The second one is like we have a TypeScript SDK that you can use and the third one is if your application requires like a high frequency data then you can get the datas through websockets in Hermes. So the three ways are possible.
It's up to you which one you want to pick depending on your project and your use case. So first you get the data from Heromies and then this data is something that needs to be passed into your smart contract function. So like if you see in this example it's like a curl call and this is the data that we are getting and this is specifically for two asset classes that we have. So uh so this data is something that we need to pass to this method. So this could be your custom logic but you need to ensure that you take in the parameters as the price update and the data that you get from Hermes is what you will pass in here.
And of course this method is payable because you need to pay for the gas fees to do the update. And once you do the update then you can get the price. So if you are trying to get the price directly without updating it will give you error. And uh for the error we have a separate error code pages. So we have this error code pages for EVM.
If you if your smart contract function rewards with the hexadimal error code, it's it could be one of these. So make sure that you access this page and understand why it's happening. So if you just try to directly do the get call you will get this error this hexa decimal which is for sale stale price. So what you need to do is you need to update the price first and then get it and everything is being documented in the guide. So just need to follow this one guide to interact in your solidity smart contract.
So yes and uh yeah you need to find the price feed ID that we talked about and also the contract address that we just saw earlier is something that will go in the constructor of the smart contract. So this is a very simple smart contract and this is what you need to follow. It's just hardly five lines of code. But this is the most important piece of uh this is the most important thing to keep in mind that you need to first update the price and then you need to get so you need to use this method called get price no older than and u we have seen in the past like many people like in the ETH global Delhi hackathon also they were using get prize unsafe which won't qualify you for the bounty so that's why mm emphasizing that you need to first update and you can find the APIs from here. So this is the method that you need to use and you can play around with it like let's say if I if I want the price of BTC in dollars let's say for last 1 minute.
So in this case I'm getting the sale price right because it's not updated. So first update and then call this method. It it will work fine. So this is the method that you need to use. Please don't use the unsafe method because unsafe what is does it it doesn't check if the price is updated or not.
It will give you the last updated price on chain. So and we want you to really use the updated price because you will be building an application let's say in the D5 space or any space out of price is something which is not very relevant. So yeah that's another thing I want to call out. So yeah I think with this you can find all of the reference links in the eat global prizes section. We have attached all the links there.
With this, I think we are good for the price feed section. Um, I'll take some questions for the price feed now because next I'll be moving to entropy.
Yep, there are a few questions in the chat.
Um, looks to be related to so if we just I could read them out for you and you can just answer them. So, um, let's do five or six. Does the path have any way we can integrate this with ASI directly or only with smart contracts? ASI assume I assume artificial super intelligence.
Okay. Uh currently we support two integrations only. One is through the smart contracts and the other is you can integrate it directly in your front end via the TypeScript SDK. So these are the only two methods and for us like you need to update the prices onchain. Of course you will need a smart contract and whatever logic you have in the application can reside in the front end or any manner but the contract should have should do the updation for the price feeds on chain.
Yes. Uh regarding the price is offchain poll integration considered or does it apply only to onchain pole integrations?
Okay. So um for the for the price eligibility so the the pool integration that we have it's like it has to be done onchain. Reason being like we just talked about right you cannot update the prices onchain if it's offchain what I'm what I'm trying to say is you can only update the prices in the contracts via your smart contract. like there has to be uh there has to be code in your solidity smart contract. So if you are somebody who is just getting the data from Hermes which is an offchain service you won't be eligible for the bounty because they could because the data that you are getting it can't be validated when you call this update onchain method that we have at that point of time only we are checking the authenticity of the data that came through Hermes so the verification can't be done.
So it won't be counted like a valid price usage.
Okay, I will do one more and then just uh move on to the next one for the sake of time. Um what's the latency of price data? Okay. So currently with with we have we update the price speeds at 400 milliseconds which is pretty fast compared to other oracle providers and uh we are already working on something called fifth pro which is in pipeline which gives you data in real time when I say real time it's way way less than 400 milliseconds close to 1 millisecond or like real time data. So but for this hackathon we are giving 400 milliseconds.
So that should be good enough for any of the D5 use case or any of the use case that requires high frequency data.
Yeah.
Okay. Amazing. Thank you. Um for the other questions I would just copy them out and post them later in Discord or we do them like at the end if we have more time.
Thank you.
Yeah. Sure. Sure. Uh just want to call out one more thing like if by end of this session I'm not able to answer all your questions then stay tuned till the end. I have a place where you can post all your questions and everything will be answered.
So uh yeah that's another thing. Okay. So now let's move on to the second offering that we have the second track which is the entropy. So okay I will first okay as all of you know entropy is bits way to generate randomness on chain in a secure manner and uh if you are a smart contract developer you might have used randomness in a smart contract there is one other way to do is do it which is through verifiable random functions called VRFs but pith uses a different approach al together which is called entropy and I'll walk you guys through how the entropy works at a high level. So entropy uses a cryptographic technique called commit and reveal protocol.
So what happens here is there are two phases. The first phase is the commitment phase. So there are basically two parties involved. One is user which is you who wants randomness and the other is the provider. So the user and the provider what they do is both of them generate their random numbers independently as in they don't share their random number with each other.
They do it secretly and then once you have a random number and the provider generates a random number both of you will compute the hash of the random number and commit that that hash onto the blockchain. So at this point of time both of you the user and provider you generated your random number computed hash committed onto the blockchain that's the end of the commitment phase. Now what happens in the second phase which is the reveal phase is one of the parties reveal their random number and the other party can verify if the random number that I'm giving right now is the same or not is through the hash. So let's say I give a random number the user reveals the random number. So provider can check okay this was the hash because it's on blockchain it can't be changed I'll compute the hash of the random number that you gave and check whether these two matches and at this point of time the other party also reveals and the final random number that we have is a combination of both of these parties random numbers and to add another level of randomness we use a block hash to make it even random.
So this is how it works at a very high level and um in this case what is happening is you as a user have the control over how the randomness is generated. You're not relying on one party and this provider is something that pith is running. So we'll come back to it later. But then you also have a say in how the randomness is achieved. So this is little simplified version of how it works.
And uh yeah this is like how is it better or different from other randomness approaches that you might have used is it is not very computationally intensive like VRF and it is pretty easy to implement like you don't have to get tokens lock it somewhere all even the price feed and even this entropy it is permissionless so it's just that you can just get the price feeds and entropy without needing any API key or any access. It's just open for everybody. So that's how it works. And now let's see how you can integrate this. So for that we'll go to docs again.
And in this case also we have like a how to guides. This is the page that you should land on the EVM contract. And uh this one is pretty straightforward. Reason being like you just need to request a number from entropy that's the first step and then you need to implement the entropy call back. So what is happening here is we have this entropy smart contract that like once you do a request the entropy smart contract will find this method in your smart contract.
So your application contract should have a method called entropy call back. It should have the exact same syntax. And this is where you will write your own logic like what do you want to do with the randomness? You will write it here. So this is how easy the implementation is.
First you get the fees, you do the request. This is the request function. And then you have this logic where you do whatever you want to do with the randomness that you got. So and in this case there are certain things to keep in mind like uh there could be scenarios where you requested for a random number okay and uh you you got the random number but then somehow the call back is not happening. So we have provided a explorer which is something that will be really handy for you.
So let's go to the explorer. So this is how the entropy explorer looks like. So for you as a developer, you can just use this to see what is happening with your callback status. So you can search by a sequence number, the transaction hash, by your sender address and you can also filter out based on the chain that you're using the status. So this is really helpful to see what has happened to your request.
So I recommend you guys when you're using entropy and face any issues. So this is the this is your debugging tool that you should check out. And for entropy also we have defined few error codes. This is again another page that is probably handy for you like if you're getting error so you you will understand what does each of the error code mean and yeah and then one more thing to note here is like there could be scenarios where your callback could have like a complex logic. So in that case if the call back is failing because it's the entropy call back that pit is calling and we are paying for the gas.
So we have set some default gas limit and the default gas limit is I'll show you how much that is because it varies from chain to chain. So if you come to this page, you again need the entropy address. Basically depending on the chain, the entropy contract address will change. And then this is the default gas limit. So if your scenario requires more gas to be used.
So you can basically customize that gas limit and that could be done by simply passing the custom gas limit in the request v2 parameter. And this request v2 that you see is it came as like upgrade that we have done. So b we have rolled out entropy v2 which is having you can read more about this here which is enhancing the whole developer experience. So you basically need to pass the custom gas limit here and uh if your use case is pretty simple like what you want to do with the randomness then you can you don't have to really pass this limit. It is completely optional depending on the project that you're building.
And you can find like I talked about you can find all the addresses here. You can check the default gas limit and customize it accordingly. So yeah and here we have listed some of the failure scenarios like how you can debug it. So and most of it is also covered in the explorer. So let's say let's pick a case where okay the call back failed right so in this case you can see okay not this one okay I think I'm not able to figure out a case where I get a proper error response but yeah in this one so let's say this is the in this case the call back failed but do notice that the random number has been generated and you can retry the call back yourself by copying this cast command and then running it yourself.
So this will be really handy in debugging it. So yeah, I think with this the presentation is done and u yeah if you have any questions that I couldn't take during this session dev forum is something that you should definitely check out. You can scan this QR code. Post your questions in the dev forum first. I'll recommend you guys to search the de forum because a lot of questions might already be answered and if you're unable to find the answer for your question then feel free to post it with as much details as you can provide.
So you don't have to rely on anybody just post your questions here and the whole team is monitoring it throughout so we will be able to support you in a better way. Yeah I think that that's it for the presentation.
That is amazing. Thank you so much. Um I see one of the questions uh that might be helpful for everybody. Is it possible to share the slides maybe in Discord afterwards like as a PDF or something so people can reook at it?
Yeah, I I'll share the slide. I'll convert it into PDF and then yeah, I'll share it across.
That is fantastic. Thank you so much. Yeah. Um, for the sake of time and everything, uh, we still have 2 minutes, so you could take a bunch of questions, but it sounds like the deaf pip forum is probably the the better way because you have plenty of time. The entire team is monitoring it, and that's how people can can get the proper support.
And I really appreciate you saying provide as much information as possible because this is going to make everybody's life much much easier, the PIFF teams and all of the hackers as well.
Yeah. Yeah, that that Yeah, that's very much needed. So yeah do make sure first do check out the question like check if your question is answered if it is answered then well our job is done if it's not then post with as much as information. [Music]
Automatic transcript — names and jargon may be misspelled.