11. Fees and attribution

Nothing is added for you. No builder, search or plan adds a fee, a payout address or a Gibs Finance label unless you pass it. Every fee below is an on-chain setting you read, a charge of a provider that you show, or a fee that you chose.

FeeWhen it appliesHow your app sees itHow your app controls it
Bridge feeEvery omnibridge crossing. It is an on-chain rate for each direction. At the time of writing: 0% entering PulseChain over Ethereum, 0.3% leaving it; 2.97% each way over BNB Smart Chain.candidate.omnibridgeFeeAmount on the route. loadBridgeFees (@gibs/bridge-sdk/chain-info) for the rate, then bridgeCost.It cannot be turned off. Show it.
Delivery feeOnly when a crossing out of PulseChain has shouldDeliver: true.plan.deliveries[i].maximumFee and feeToken. deliveryFee and directedDeliveryFee in @gibs/bridge-sdk/settings. See What the recipient receives.Choose { shouldDeliver: false } (the user claims and pays gas), or set the fee terms yourself in QuotedDeliveryFee.
Provider fees (gas, solver, protocol)Every aggregator section.The fees of the live quote (QuoteFee[]). A fee with includedInFromAmount: false is paid in addition to fromAmount.Not yours to control. Show them.
NEAR Intents keyless surchargeEvery NEAR Intents quote without a partner key: 25 basis points.The NEAR Intents parser reports it as a charge.Get a partner key and pass nearIntentsApiKey.
PulseX swapEvery PulseX section. The pool fee and the price impact are inside the quoted output.The quoted output of the hop, and minAmountOut in the swap calldata.swap.slippageBasisPoints sets the floor.
Aggregator cushionA route that enters the omnibridge through an aggregator asks for an exact output. The amount that the aggregator does not need stays in the wallet on the entry chain.Compare the fromAmount of the live quote with what arrives.By design. Tell the user that it is theirs.
Your LI.FI feeOnly when you pass lifiFee and your own lifiIntegrator.The fee field of the LI.FI request.Leave it out to charge nothing. A positive fee without your integrator throws.
Your Relay feeOnly when you pass relayAppFee: { recipient, basisPoints }.The appFees field of the Relay request.Leave it out to charge nothing.
GasEvery transaction.search.gasCostFor and search.isGasless on the search result.Your wallet's gas settings. gasLimit: null means that you estimate.

Bridge fees are a rate per 1e18. Aggregator referral fees are in basis points.

What the recipient receives

The recipient receives the amount after the bridge fee, minus the delivery fee. The bridge fee is amountToBridge * bridgeFee / 1e18. The delivery fee exists only when you buy delivery. A user who claims alone pays no delivery fee.

Before the send. Use bridgeCost and amountAfterBridgeFee, then deliveryFee, then estimatedAmountOut. All are in @gibs/bridge-sdk/settings. plannedRecipientAmount in examples/example-c-delivered-amount.ts joins them. For a search result, the deliveredAmount of an omnibridge hop already holds this figure when you passed delivery and deliveryFeeTermsFor. The helper amountAfterDeliveryFee in @gibs/bridge-sdk/routing does the same subtraction for one QuotedDeliveryFee.

After the transfer completes. Read delivery.amount from the indexer's transfer record. It is what the destination omnibridge released. On a delivered crossing, that value reached the delivery router before the router took its fee. So subtract the fee that the fee director asks for. Call directedDeliveryFee({ settings, limit, multiplier, value }) with value set to delivery.amount. It returns { kind, fee }.

directedDeliveryFee copies the router's rules:

  • Settings bit 0 (fixed) wins first. The fee is limit.
  • Otherwise, bit 3 (percent) sets the fee to value * multiplier / 1e18. The limit does not cap a percent fee.
  • Otherwise the mode is gas tip. The fee is a gas cost that only the delivery transaction knows. So the result has kind: 'at-most', and fee is the ceiling (the limit), not the charge.
  • Every mode caps the fee at value.

Settings bit 1 asks the router to unwrap to the native coin. Bit 2 excludes the priority fee, and the SDK always sets it. feeTypeSettings writes all four bits.

A result with kind: 'exact' gives the exact amount for the recipient. A result with kind: 'at-most' gives a lowest amount. Show it as "at least". A crossing that the user released alone pays no router fee, so do not apply directedDeliveryFee to it.

Your attribution. Pass it in one place for the search, and in the same fields of the ConsolidatedQuoteRequest for the live quote:

await searchBridgeRoutes({
  // ...
  attribution: {
    lifiIntegrator: 'your-wallet',
    lifiFee: 0.001, // optional: a tenth of a percent, paid to your LI.FI integrator account
    relayReferrer: 'your-wallet', // Relay then requires your key
    relayAppFee: { recipient: '0xYourFeeWallet', basisPoints: 10n }, // optional
  },
  relayApiKey: yourRelayKey,
  nearIntentsApiKey: yourNearKey,
  nearIntentsUserAgent: 'your-wallet/1.0',
});

Each attribution field is either left out (nothing is sent) or your own string. Do not pass anything from @gibs/bridge-sdk/referral. Those values pay Gibs Finance.