Chainlink VRF – Understanding and Calculating Fee Costs

chainlinkfeesvrf

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.

Best Answer

  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
Related Topic