I am giving my first steps into chainlink more precisly with VRF v2 but I have some doubts regarding the fees costs. I would prefer to have a concrete value of the costs per request.

in this article I can see the following formulas to get the total cost per request.

(Gas price * (Verification gas + Callback gas)) = total gas cost
(total gas cost + LINK premium) = total request cost
  1. However in the contracts address page we can see three tables with values between 0,005 LINK and 0,25 LINK. These values refers only to the LINK premium variable in the previous formula, right?

  2. This premium variable is optional, and we can only set a value to it if we have a urgent need to get the value?

  3. What would be the advantage to choose Ethereum mainnet instead the of the BNB chain, since this last one is cheaper ?

  4. In the VRF v1 there is a reference to Polygon Mainnet. It doesn't appear any reference on the v2. Is it possible to conitnue to link to Polygon mainnet to generate random numbers?

I may be confusing some concepts, and if it is so please feel free to correct me.

1 Answer 1

  1. Yes, this is the amount LINK token fee (gas) Chainlink's node will charge. This is the premium you pay per request in addition to the gas fee for the transaction
  2. This value is accessible through the VRF Coordinator by calling getFeeConfig
  3. It depends on where your smart contracts are deployed, the premium is higher on Ethereum since it is more expensive to update data due to the high tx costs. It's just a matter of environment, needs, preferences and community
  4. Not yet live on Polygon but pretty soon: Currently live on Ethereum main net, Chainlink VRF v2 will deploy onto other top blockchains already supported by the Chainlink Network, including Polygon and BSC, in the near future. chainlinktoday
  • 1
    Thank you Adam. I just think this it's quite expensive generate random numbers. BTW do you know any cheaper solutions?
    – fatada
    Mar 18, 2022 at 12:50
  • @fatada expect pseudo-randomness likehttps://blog.finxter.com/how-to-generate-random-numbers-in-solidity/ for now to my knowledge, there is no. If you want a cheap/free solution you can try using several pricefeeds together which are accessible freely, I've never seen anyone do it, either no one has thought of it, or there is a reason that I have missed.
    – Adam Boudj
    Mar 18, 2022 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.