Swagger

Fees

2 endpoints.

2 endpoints

Fees

POST/fee/estimateEstimate the fee

Preview what an operation would cost for the given calls and transferred assets, without submitting anything. The shape is the same on every rail, which is what lets a wallet's Max button stay rail-agnostic.

  • Two FIGURES FOR the same fee. estimatedFee and estimatedFeeRaw are the worst case: the gas limits priced at the bumped ceiling. They are the only pair to reserve, cap, or check a balance against. expectedFee and expectedFeeRaw are what the operation is expected to actually bill, and are the pair to show a user.
  • gasFee and serviceFee split the expected figure into the network's own cost and the UGTP markup, and sum back to it exactly. Display only, and they arrive together or not at all.
  • RequiredBalanceRaw, on the executor rail only, is what the account must hold of the fee token for the request to pass validation — which is not always the fee alone. Never read its absence as zero.
  • On the self-funded rail nothing of ours is priced, so the whole amount is the account's own gas.
  • When the project charges its own markup, the part paid in the fee token is already INCLUDED in estimatedFee, expectedFee, serviceFee and requiredBalanceRaw. A wallet therefore reserves and shows one fee, and a Max of the whole balance leaves room for the markup. projectFee reports the markup on its own: rate, recipient and amount per token that moves. Absent means the project charges none.
  • Omit feeToken for a native-coin estimate. The executor rail always charges in an ERC-20 and refuses a preview without one (FEE_TOKEN_REQUIRED); it prices ERC-20 transfers only (EXECUTOR_RAIL_PREVIEW_UNSUPPORTED, EXECUTOR_RAIL_NATIVE_UNSUPPORTED).
  • 429 when the rate limit is exceeded; check the Retry-After response header.

Authentication: X-API-Key

Input — request body

networkId string required
Chain id
senderAddress string required
The account address whose operation is priced
calls Call[] required
Each: { to, data?, value? } (hex)
transferredAssets Asset[] required
Each: { address, amount } (base-unit hex)
feeToken string
Fee token address (omit for native-gas estimate)

Input — example request

{
  "networkId": "137",
  "senderAddress": "0xCa9d43184Cc3179609f77D38433D363833C73c60",
  "calls": [
    {
      "to": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
      "value": "0x0",
      "data": "0x..."
    }
  ],
  "transferredAssets": [
    {
      "address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
      "amount": "0xf4240"
    }
  ],
  "feeToken": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F"
}

Output — example response (200)

{
  "estimatedFee": "0.0512",
  "estimatedFeeRaw": "0xc7f8",
  "expectedFee": "0.0410",
  "expectedFeeRaw": "0xa028",
  "gasFee": "0.0400",
  "gasFeeRaw": "0x9c40",
  "serviceFee": "0.0010",
  "serviceFeeRaw": "0x3e8",
  "symbol": "USDT"
}

Output — every status this endpoint answers with

StatusWhen
200Fee estimate
400Invalid request body or query parameters
401Missing or invalid credentials
429Rate limit exceeded — retry after the number of seconds in the `Retry-After` response header
500Internal server error
Open in Swagger
GET/fee/termsRead the fee terms

The rates the paymaster deducts from the transferred asset on every gasless operation, beyond the gas itself. Read them rather than hard-coding a rate: a project can be priced away from the platform default, and the default itself can change.

  • Each fee carries its stored integer units and the human ones: bps and staticUsdMicros (1e6 = $1) beside percent (0.1 = 0.1%) and staticUsd.
  • platform.fee is UGTP's own rate. project.fee is the project's markup on the moved value, and project.payoutAddress is where that markup is paid — zero and null until the project sets them.
  • total.fee.percent is the two percentages combined. The static part is the platform's alone.
  • For a screen that explains a fee rather than quotes one: what an operation will actually bill comes from POST /fee/estimate, or from the ugtpFee a prepare answers.
  • 429 when the rate limit is exceeded; check the Retry-After response header.

Authentication: X-API-Key

Output — example response (200)

{
  "platform": {
    "fee": {
      "bps": 10,
      "staticUsdMicros": 50000,
      "staticUsd": 0.05,
      "percent": 0.1
    }
  },
  "project": {
    "fee": {
      "bps": 0,
      "staticUsdMicros": 0,
      "staticUsd": 0,
      "percent": 0
    },
    "payoutAddress": null
  },
  "total": {
    "fee": {
      "percent": 0.1
    }
  }
}

Output — every status this endpoint answers with

StatusWhen
200Paymaster fee terms
401Missing or invalid credentials
404The calling project is not priced yet on this deployment.
429Rate limit exceeded — retry after the number of seconds in the `Retry-After` response header
500Internal server error
Open in Swagger