Extremely high query cost
srameshr opened this issue · comments
oraclize_getPrice("URL")
is returning 4035500000000000
which is about 0.0040355 ETH = 3.86 USD
Is this correct, or am I missing something.
oraclize_getPrice
does not return the Oraclize fee only (which for URL is between 0.01 and 0.05 $), but it includes also the callback transaction cost: when Oraclize returns the data to your smartcontract, it has to send back a transaction. The cost of that callback transaction does strictly depend on the code you implement in the __callback
method of your contract. Most of the cost returned by oraclize_getPrice
is that (gas*gasPrice of the callback tx), hence it goes to miners. If you want to try to minimize it, you can use oraclize_setGasPrice
(to change the default gasPrice, which currently sits at 20gwei) or you can lower the callback tx gas (default is 200k). More info here.
I hope this helps.