Futaba
TwitterBlog
  • 🌱Introduction
    • Introduction
    • Concept
    • Architecture
  • 🛠️Protocol
    • Gateway
      • Send
      • Receive
      • Estimate fee
      • Cache
    • Light Client
      • Request Query
      • Verify
      • Estimate fee
    • Relayer
    • Konoha
      • Chainlink Oracle
      • Herodotus
      • Lagrange
  • 💡Guide
    • Futaba Testnet
      • Balance query
      • Custom query
      • Access cache
      • Cross-chain voting
    • Quick Start
    • Customize Light Client
    • Example Apps
  • 📗References
    • FAQ
    • Contract addresses
    • Glossary
  • 🔗Links
    • Twitter
    • Blog
Powered by GitBook
On this page
  • Overview
  • How to calculate
  • Relayer fee
  • Oracle fee

Was this helpful?

  1. Protocol
  2. Light Client

Estimate fee

Calculate the fees required for query

Overview

This function calculates the fees required for the query. If the Gateway contract's query() sends less than the required fee, it is reverted as InvalidFee.

function estimateQueryFee(
    QueryType.QueryRequest[] memory queries
) external view returns (uint256);
Field
Description

queries

An array of QueryRequest data

How to calculate

Light Client Contract's estimateQueryFee() calculates the Verification fee as explained in the Gateway contract.

Verification fees are divided into the following two categories;

  • Relayer fee

  • Oracle fee

Relayer fee

Relayer fee is the fee paid to the Relayer and can be divided into two types of fees:

  • Gas fee

    • Gas costs include base gas costs plus variable gas costs depending on query size

    • Add 21,000 gas per query

  • Rewards for Relayer

    • This is the fee paid to the Relayer

    • At the moment we pay Relayer in Gelato

Oracle fee

This is the fee paid to Oracle, which at this time is accounted for by converting the $LINK paid to Chainlink to the price of the native token by default.

Then use Chainlink's data feed to get the LINK/Native Token rate.

PreviousVerifyNextRelayer

Last updated 1 year ago

Was this helpful?

🛠️