> ## Documentation Index
> Fetch the complete documentation index at: https://docs.saucerswap.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Liquidity Position Fee

> Retrieve the current fee for creating or adding to a liquidity position

The following code demonstrates how to retrieve the fee for minting a new liquidity position or adding to an existing position, with the fees expressed in HBAR, using a combination of JSON-RPC and REST API calls.

<Note>
  The **mintFee()** function will return the current fee expressed in **Tinycent** (US).
</Note>

⛽ *No gas cost*

<Tabs>
  <Tab title="JSON RPC">
    **Resources:**

    * [SaucerSwap deployed contract IDs](/developerx/contract-deployments)
    * [Ethers.js docs (v6)](https://docs.ethers.org/v6/)
    * [Hedera JSON RPC Relay](https://docs.hedera.com/hedera/core-concepts/smart-contracts/deploying-smart-contracts/json-rpc-relay)
    * [Hedera REST API](https://docs.hedera.com/hedera/sdks-and-apis/rest-api)

    ```typescript Typescript theme={null}
    import * as ethers from 'ethers'; //V6

    //Set one of Hedera's JSON RPC Relay as the provider
    const provider = new ethers.JsonRpcProvider(hederaJsonRelayUrl, '', {
      batchMaxCount: 1, //workaround for V6
    });

    //load ABI data containing Factory's mintFee() function
    const interfaces = new ethers.Interface(abi);

    //get pool creation fee in tinycent
    const factoryContract = new ethers.Contract(factoryV2EvmAddress, interfaces.fragments, provider);
    const result = await factoryContract.mintFee();
    const tinycent = Number(result); //amount in tinycent (US)

    //get the current exchange rate via REST API
    const url = `${mirrorNodeBaseUrl}/api/v1/network/exchangerate`;
    const response = await axios.get(url);
    const currentRate = response.data.current_rate;
    const centEquivalent = Number(currentRate.cent_equivalent);
    const hbarEquivalent = Number(currentRate.hbar_equivalent);
    const centToHbarRatio = centEquivalent/hbarEquivalent;

    //calculate the fee in terms of HBAR
    const tinybar = BigNumber(tinycent / centToHbarRatio).decimalPlaces(0);
    const poolCreateFeeInHbar = Hbar.from(tinybar, HbarUnit.Tinybar);
    console.log(`New liquidity position fee: ${poolCreateFeeInHbar.toString(HbarUnit.Hbar)}`);
    ```
  </Tab>
</Tabs>
