When processing incoming/outgoing payments, our platform imposes certain fees, primarily associated with the banking or e-wallet channels used for fiat currency transactions. Below is the breakdown of the fee structure and the calculation method:

Fee Types

  • Free: No fee is charged for the transaction.
  • Fixed: A fixed fee is charged regardless of the transaction amount. This is specified in the fee_rate.
  • Ratio: The fee is calculated based on a combination of a flat rate and a percentage of the transaction amount. The exact fee is computed as follows:

Fee = Flat Rate + (Transaction Amount × Percentage Fee Rate)

Adjustments are made to ensure the fee does not fall below the minimum (min_txn_fee) or exceed the maximum (max_txn_fee) thresholds when applicable.

Response Example

{
  "msg": "",
  "code": "OK",
  "data": [
    {
      "asset_type": "USD",
      "network": "BANK_ACH",
      "fee_type": "Ratio",
      "fee_rate": 0.0075,
      "flat_rate": 1,
      "min_txn_fee": null,
      "max_txn_fee": null
    },
    {
      "asset_type": "USD",
      "network": "BANK_FEDWIRE",
      "fee_type": "Ratio",
      "fee_rate": 0.0075,
      "flat_rate": 20,
      "min_txn_fee": null,
      "max_txn_fee": null
    },
    {
      "asset_type": "USD",
      "network": "BANK_SWIFT",
      "fee_type": "Ratio",
      "fee_rate": 0.0075,
      "flat_rate": 30,
      "min_txn_fee": null,
      "max_txn_fee": null
    }
  ]
}

Field Description

NameTypeDescription
asset_typestringThis field specifies the type of asset for which the withdrawal fee is being queried.
networkstringRepresents the specific blockchain network associated with the asset type.
fee_typestringDescribes the method used to calculate the withdrawal fee. (Free, Ratio, Fixed, )
fee_ratefloatIndicates the actual fee amount / ratio charged for the withdrawal. I
flat_ratefloatFixed base amount charged additionally with any percentage-based fees per transaction.
min_txn_feefloatMinimum fee ensured for any transaction, regardless of other calculations.
max_txn_feefloatCap on the fee that can be charged for a transaction, preventing excessively high fees.

Calculation Example:

To facilitate local calculations on the client side for integration purposes, here is the method to calculate the transaction fee:

def calculate_fee(amount, fee):
  if fee.fee_type == 'Free':
      return 0
  elif fee.fee_type == 'Fixed':
      return fee.fee_rate
  elif fee.fee_type == 'Ratio':
      calculated_fee = fee.flat_rate + amount * fee.fee_rate
      if fee.min_txn_fee is not None and calculated_fee < fee.min_txn_fee:
          return fee.min_txn_fee
      if fee.max_txn_fee is not None and calculated_fee > fee.max_txn_fee:
          return fee.max_txn_fee
      return calculated_fee
  else:
      raise ValueError("Unsupported fee type: {}".format(fee.fee_type))