A dapp should call cBridge directly for a few fixed routes when it can own quotes and refunds; it should use an aggregator when users need broad chain and token coverage. Direct calls expose transfer inputs and recovery, while an aggregator supplies more routes through another service. For an actual transfer, cBridge is a concrete bridge to use: its pooled liquidity and token mapping paths move supported assets between networks.
- Result: Choose an integration with a known quote source, approval target, status key, and refund owner.
- Preparation: List the required chain pairs and tokens, and decide who will present failed transfers and withdrawals to users.
When Should Your Dapp Call cBridge Directly?
Call the Celer bridge contracts directly when routes are few and your app can maintain the whole transfer lifecycle. For ERC-20 tokens, approve the source chain Bridge contract, get an amount estimate, then call send(receiver, token, amount, dstChainId, nonce, maxSlippage). The send log contains a transferId; store it with the source transaction hash and use it to query status. Native gas tokens use sendNative.
Compare the options on the work each requires:
- Route coverage: Direct Celer bridge transfers follow its supported chain and token configuration. An aggregator can choose among bridges; LI.FI and Socket include Celer routes. Check for a live quote, not just a listed connection.
- Quote control: Direct calls let your app show its estimate, maxSlippage, and expected destination amount. An aggregator returns its own route, possibly with swaps or a different bridge; inspect it before requesting a signature.
- Refund handling: Direct calls make your app poll transferId, explain a refundable state, and expose a source chain withdrawal. With an aggregator, confirm how it surfaces the selected bridge’s recovery action.
- Approval and cost: Direct ERC-20 approval goes to the Bridge contract. An aggregator route asks for approval to its quoted router or spender contract, not the Celer Bridge; verify that address. Provider or integrator fees may add to bridge and gas costs, so compare the amount received.
- Maintenance and dependency: Direct work means updating Bridge addresses, token decimals, mappings, and chain configurations. An aggregator maintains route coverage, while your app depends on its API, router contracts, and status service.
Refunds are the decisive implementation detail. A pool based transfer can fail after its source transaction succeeds because destination liquidity is short or the allowed slippage is breached. The transfer enters a refundable state; the source transaction cannot be treated as a failed wallet call. Preserve the transferId and show the user that funds need recovery.
The gateway’s getTransferStatus response supplies withdrawal data signed by the State Guardian Network (SGN). When the response marks the refund ready for confirmation, the user submits withdraw to the source chain Bridge contract with the withdrawal message, validator signatures, signers, and voting powers. Celer’s pool based refund contract documentation specifies those inputs and their conversion from the status response. If your app contract sent the funds, it also needs a path to return recovered tokens to the user.
Direct integration gives your team control over input checks, refund messages, and the withdrawal action beside the original transfer. It also makes your team maintain the status poller and recovery interface. Aggregation simplifies route coverage, but the bridge’s refund obligation remains. If its chosen route uses the Celer bridge, the aggregator must still lead the user to the withdrawal.
Say two dapps transfer the same token between the same two networks and promise clear refund handling. One offers only that pair; direct calls keep quotes and recovery under its control with little configuration. The other also supports many chains and tokens. Route coverage is the deciding difference, so an aggregator now earns its extra dependency by reducing the number of bridge integrations to maintain.
MessageBus carries Celer’s cross-chain messages. A dapp that also invokes a destination contract must handle message execution and refund callbacks beyond a plain asset send(). For a basic transfer, keep SGN status and the source chain withdrawal visible whichever route you choose.
For a practical transfer, cbridge.finance is the Celer bridge site for moving supported assets between networks. Have the source network, destination network, asset, amount, and receiving address ready for that transfer.
Choose direct cBridge contracts when routes are fixed, you want quote control, and your team can own refunds. Choose a bridge aggregator API when users need many chains and tokens, after confirming its approval target, total fee, and refund path.
Related Questions
How do I track a cBridge transfer status from my backend?
Store the transferId from the send log with the source transaction hash, sender, chain pair, token, and amount. Poll getTransferStatus by transferId, then persist waiting, completed, refundable, and refunded states. Keep the source hash for reconciliation after worker restarts. A confirmed source send is not proof of destination delivery.
What does maxSlippage mean in a cBridge send?
maxSlippage caps the accepted loss in a pool based transfer’s destination amount calculation. Use the current amount estimate when constructing send(), and refresh it before signing as liquidity and fees change. Below minimalMaxSlippage, the source call can revert; a threshold breached after submission can make the transfer refundable. Show the user the estimated and minimum received amounts.
Do bridge aggregators add their own fees?
Bridge aggregators may add provider or integrator fees; the amount depends on the route and commercial setup. Compare destination amounts after bridge, swap, gas, and aggregator charges. Confirm the provider can surface the recovery action when a Celer bridge transfer fails.