🌉
Celer cBridge
  • 👋Welcome to cBridge
  • Introduction
    • Architectural Benefits
    • State Guardian Network
    • SGN and cBridge
      • The SGN as a cBridge node gateway and Service Level Agreement (SLA) arbitrator
      • The SGN as a Shared Liquidity Pool Manager
    • Fungible Token Bridging Models
    • cBridge Security
  • Tutorial
    • Cross-chain Transfer
    • LP Guide
    • SGN V2 Staking Guide
    • SGN V1 Unbonding Guide
    • Smart Contract as LP
    • Aptos Bridging Guide
    • Ape Chain Bridging Guide
    • Flow Cadence Bridging Guide
    • Flow EVM Bridging Guide
  • Developer
    • Circle Cross-chain USDC Transfer Protocol(CCTP)
    • cBridge SDK
    • cBridge Pool-Based Transfer (xLiquidity)
      • Transfer
      • Transfer Refund
    • cBridge Canonical Mapping Transfer (xAsset)
      • Mint
      • Mint Refund
      • Burn
      • Burn Refund
    • cBridge Transfer Web Widget
    • cBridge Aptos Transfer (xAsset Only)
    • Custom Transfer URL Schemes
    • cBridge APIs for Sui
    • Referral Specific Transfer
    • cBridge Limit Parameters
    • API Reference
      • Gateway: GetTransferConfigsForAll
      • Gateway: EstimateAmt
      • Contract: Pool-Based Transfer
      • Gateway: GetTransferStatus
      • Contract: Pool-Based Transfer Refund
      • Gateway: TransferHistory
      • Contract: Mint Canonical Token(OriginalTokenVault)
      • Contract: Mint Canonical Token(OriginalTokenVaultV2)
      • Contract: Mint Canonical Token Transfer Refund
      • Contract: Burn Canonical Token(PeggedTokenBridge)
      • Contract: Burn Canonical Token (PeggedTokenBridgeV2)
      • Contract: Burn Canonical Token Transfer Refund
      • Gateway: MarkRefRelation
      • Contract: TransferAgent Mint Token Submission
      • Contract: TransferAgent Burn Token Submission
      • Contract: Aptos Vault Mint Token Submission
      • Contract: Aptos PegBridge Burn Token Submission
  • NFT Bridge
    • Introduction
    • NFT Bridge Fee
  • List Your Tokens
    • Simple Listing Process
  • Reference
    • FAQ
    • Audit Reports
    • Contract Addresses
Powered by GitBook
On this page
  • Source Chain
  • Destination Chain
  1. Developer

cBridge Limit Parameters

PreviousReferral Specific TransferNextAPI Reference

Last updated 1 year ago

There are certain rules limiting on source and destination chains for security purposes. When transferring assets through cBridge, it's essential to check these limit parameters beforehand.

Source Chain

1. minSend/maxSend

The sending amount range is (minSend, maxSend], for Pool-based transfer, you can get the / on source chain , the address is the token address on source chain.

The screenshot is an example to get the USDC minSend Value on Ethereum.

Note if the transfer token is ETH, use the WETH token address as the query key.

2. pool cap

The pool cap signifies the maximum volume allowed in this pool. Once the pool cap of the source chain is reached, transfers of the token from this chain are temporarily suspended until the volume decreases below the cap.

The sending amount should be matched the rule of sending amount + current volume <= pool cap

The error code

ERROR_CODE_LIQ_OVER_CAP // 1017

Error Message:

You can transfer up to {remainning_amount} {token_symbol} at this moment. You may reduce your transfer amount. the remainning_amount = pool - current volume

Destination Chain

1. Big amount delay

If the sending amount is greater than an on-chain threshold, the transaction might be delayed for a while due to security reasons. You can retrieve these parameters from the destination chain.

2. Epoch volume cap

The epoch volume cap restricts the amount of volume that can be transferred on the destination chain within a specific time frame.

Example code of calculating the accumulated volume

uint256 volume = epochVolumes[_token];
uint256 epochStartTime = (timestamp / epochLength) * epochLength;
if (lastOpTimestamps[_token] < epochStartTime) {
   volume = _amount; // new epoch, the total amount is current sending amount
} else {
   volume += _amount; // last brdige is within the current time frame,last volume should be accumulated to total volume
}
require(volume <= cap, "volume exceeds cap");

To check pool cap by handling the error in api when you quote the transfer.

(Aside) The pool cap limit value can be read from the inbound_lmt field in the file.

delayThresholds:

delayPeriod: indicates the transaction delay time in second.

You can obtain the epochVolumeCaps , lastOpTimestamps, epochLength and corresponding token epochVolumes from the Contract, which has been implemented by the Bridge Contract. The accumulated volume in this period must be lower than the value specified by the "epochVolumeCaps".

estimateAmt
configuration
https://github.com/celer-network/sgn-v2-contracts/blob/4d742f6c337f06777947a73accd9f78239de92ee/contracts/safeguard/DelayedTransfer.sol#L15C40-L15C55
https://github.com/celer-network/sgn-v2-contracts/blob/4d742f6c337f06777947a73accd9f78239de92ee/contracts/safeguard/DelayedTransfer.sol#L16C20-L16C31
VolumeControl
minSend
minMax
Bridge contract
Example of getting the USDC minSend Value on Ethereum
Example of getting epochVolumeCaps from Ethereum pool.