RathRath Finance

Fees

Understand provider costs, network gas, gasless fees, and Permit2 approval costs.

xPath costs depend on the execution flow. Standard swaps and gasless swaps use different fee behavior.

What Users Pay

CostStandard swapGasless swap
DEX or bridge provider costsIncluded in the selected routeIncluded in the selected route
Source-chain gasPaid by the user's walletSwap execution is relayed through Tachyon
Gasless execution feeNot applicableCurrently targets $0.01, collected in the input token
Permit2 approval gasNot applicable to ordinary approval flowsMay be required once before gasless execution

The API quote is the source of truth for provider costs and gas estimates. These values can change with liquidity, route selection, token prices, and network conditions.

Standard Swap Costs

For GET /quote, xPath returns provider and gas information in two objects:

{
  "fees": {
    "routeFee": "0",
    "routeFeeUsd": 0,
    "integratorFee": "0",
    "integratorFeeUsd": 0
  },
  "gasFee": {
    "gasFee": "18000000000000",
    "gasFeeUsd": 0.06,
    "gasLimit": "240000",
    "gasPrice": "75000000",
    "gasToken": {
      "symbol": "ETH",
      "decimals": 18
    }
  }
}

Provider Route Fee

fees.routeFee and fees.routeFeeUsd describe costs reported for the selected route, such as bridge fees.

  • Same-chain routes can report zero when provider pricing is reflected directly in amountOut rather than as a separate fee.
  • Cross-chain routes can report an explicit bridge fee.
  • Compare amountOut and minAmountOut in addition to the fee object.

Network Gas

gasFee estimates the source-chain transaction cost:

  • gasFee.gasFee is denominated in the smallest unit of gasToken.
  • gasFee.gasFeeUsd is an estimated USD value.
  • The final wallet cost can differ when gas prices change before submission.

The user needs enough native token on the source chain to submit a standard swap.

Gasless Swap Fee

The current xPath configuration targets a $0.01 fee per gasless swap. xPath converts that USD target into the input token using the available token price and returns the effective amount:

{
  "fee": {
    "feeAmount": "10000",
    "feeUsd": 0.01,
    "feeRecipient": "0x..."
  }
}

The backend calculates the fee in the input token, deducts it from the input amount, and routes the net amount. Because token amounts use integer units, the effective value can be slightly below the target USD value.

If xPath cannot obtain an input-token price, the derived gasless protocol fee is zero for that quote.

The $0.01 value is the current service configuration, not a permanent pricing guarantee. Always display fee.feeAmount and fee.feeUsd returned by the gasless quote.

Gasless Does Not Mean Zero Cost

For a gasless swap:

  • Tachyon submits the swap execution transaction
  • xPath's returned gasless fee is deducted from the input token
  • DEX or bridge costs still affect the route
  • the user may need a one-time ERC-20 approval to Permit2, which requires native gas

After Permit2 approval exists, the user signs the EIP-712 authorization rather than submitting the swap transaction directly.

What to Display

Before execution, show:

  1. Input amount
  2. Expected output and minimum output
  3. Provider or bridge fee, when separately reported
  4. Estimated source-chain gas for standard swaps
  5. Returned feeAmount and feeUsd for gasless swaps
  6. Quote expiry and selected providers

Use integer strings or bigint for calculations. Use token decimals only for display formatting.

See Core Concepts, Get Quote, and Gasless Swaps with Permit2 for the complete execution flows.

On this page