Network: Monad Testnet
Timestamp: yesterday and today
Steps to reproduce:
Get price feed id (mine is BTC/USD)
Call the Hermes API to retrieve binary data
Pass the binary data to getUpdateFee
Error: invalid arrayify value (argument=“value”, value=
Additional notes:
I am trying to create a prediction game on monad testnet that utilizes Pyth price feeds with Pyth Pull Oracle, Hermes API and Gelato Web3 Automated functions. The flow goes like this:
we have a round. there is a 20 second threshold where the users could bet if the price is going to go up or down. then, after 20 seconds, the round locks. we then get the updated data from hermes API, push it to the pull oracle via Gelato operator, compare the new price against the players’ bets and reward whoever won.
right now stuck at getting the fees
hi, sorry for the delayed answer. i already found the issue, it was a mismatch in the types inside the contract. now i dont get any errors, but i still get 0 updates on price feed retrieval inside of the contract.
it passes the calldata properly and the function runs all the way. however, whenever we retrieve prices via the contract, they are always 0. i tried reading the IPyth contract on Monad Testnet via javascript/ethers, and all the data was in place. However, whenever pyth.getPrice is being called via contract it returns 0. or i am not handling it properly. the address, abi and interface is the same in both cases.
i tried using bytes calldata in my previous contract, and it did not work for some reason. at least now it recognizes the calldata, so i’ll keep it like this because it does not revert. i also tried getPriceNoOlderThan(priceId, 20) right after the price update call, but i still get 0.
and both of getPrice and getPriceNoOlderThan work properly called via js ethers script from the contract operator account. and they do have the values i need
update: i was finally able to update prices with actual data on my contract. your function separation helped most likely. i also rewrote quite a bit of code as well. but consider it solved