📂Example of Asset Categorization
Last updated
Last updated
Let's take a typical FIBER call and add some example parameters to understand the flow of events.
These are not actual FIBER call parameters. Some of these parameters will require querying the FIBER engine to getCABN
, or ferrumNetworkIdentifer
information.
The information below is just to demonstrate the logic used by FIBER to categorize and optimize swap paths across chains.
sourceCABN
: BUSD
sourceFerrumNetworkIdentifier
: BSC
destinationCABN
: USDT
destinationFerrumNetworkIdentifier
: Polygon
amountSourceCABN
: 100000000000000000000 (wei value)
destinationAddress
: 0xdestination
slippage
: 2% per chain (4% total)
platformFeeCABN
: BNB
isFeeEnabled
: true
When FIBER receives this call, it starts the process of categorizing the sourceCABN
and destinationCABN
. In order to categorize the FIBER engine conducts the following checks:
Conducts abridgePool
liquidity check on destination network to determine if the asset has sufficient liquidity available in the bridgePool
to be categorized as a Foundry Asset for this swap.
Conducts if there is pair liquidity available with the bridgeable asset. i.e. Is it possible to convert user's asset to bridgeable asset in a single hop or swap. If the user's asset can be swapped for the bridgeable asset in a single hop, then the asset will be categorized as a Refinery Asset. Otherwise the asset will be categorized as an Ionic Asset.
aggregatedBestQuoteCheck
a check for the best price on source and destination networks. Checks quotes from aggregators such as 1inch and compares those quotes against DEX quotes from DEX Router contracts. Suggest all options available rated from best to worst.