Skip to content

Architecture Overview

Decent is a liquidity network that enables fast cross-chain swaps. Decent's foundational liquidity layer meshes canonical bridges with third party ones to enable routing to any chain on its first day. Decent leverages this liquidity layer to facilitate a solver network that fills cross chain transactions for users in seconds.

Decent passes messages through a combination of third party arbitrary message bridges (AMBs) and canonical bridges. With each transaction, users can pass any arbitrary calldata. Decent uses this functionality to:

  1. Execute smart contract functions. Developers typically use Decent to build the calldata required for any-token transactions in the point of sale of their applications.
  2. Collect and split fees on each transaction. Signed transactions include a hash of the application's fees in the transaction calldata.

Because each transaction is verified by decentralized messaging providers, transactions are processed in a trustless manner, settle in real time, and can include complex sets of unique instructions. This is what enables developers to tailor Decent to meet their specific requirements.

Routing

Decent is a liquidity network, meaning users deposit canonical tokens on a source chain and receive canonical tokens on the destination chain. Unlike other bridges, users will never receive wrapped assets, which fragment user experiences and create security risks across chains.

Decent Bridge Diagram

Cross-chain transactions are a combination of:

  1. Swap from an ERC20 token to WETH
  2. Deposit WETH into a Decent endpoint to burn dcntETH
  3. Mint dcntETH and exchange for WETH
  4. Swap WETH for ERC20

Decent handles three types of transactions:
Note: "correct" defined as the chain of the target smart contract. This is relevant for cross-chain execution but not swaps.

  1. Direct: user has the correct tokens on the correct chain. In this scenario, we bypass all Decent routing and call the smart contract as you would in a normal transaction.
  2. Swap & Execute: user has incorrect tokens on the correct chain. In this scenario, we execute a swap but do not deposit into a Decent endpoint to initiate a bridge.
  3. Bridge & Execute: user has incorrect tokens on an incorrect chain. In this scenario, we execute a swap on the source chain and a bridge. If the target contract expects a token that is not ETH or WETH, we execute another swap on the destination chain. The flow involving two swaps and a bridge is illustrated above and is our most complex route.

Bridge & DEX Aggregation

To supplement Decent's liquidity network, we aggregate Stargate and chain's canonical bridges. This approach enables Decent to scale to any new network on its first day without liquidity constraints and guarantees users strong execution quality. We prioritize canonical bridge integrations for chains with high transaction volume and low total value locked (TVL).

To facilitate swaps, Decent aggregates a primary DEX on each chain. When available, we route through Uniswap.

Messaging

Decent uses a combination of LayerZero and canonical bridges to pass messages between chains. The combination of these AMBs enable Decent to easily send external function calls, fee and splits information, and tokens between chains while preserving developers' full autonomy and control over their applications.

Transaction Execution

The diagram below illustrates a sequence of the smart contract functions required to facilitate the key two transaction flows described above: swapAndExecute and bridgeAndExecute.

Transaction Sequence

UniSwapper is a module that routes through Uniswap to execute swaps. This module can be easily substituted to support other DEX's or oracles.

Fallbacks

Decent's transactions are atomic, meaning any transaction that successfully executes on the source chain will execute on the destination chain. However, there can be edge cases that could cause transactions to revert. Common ones are:

  • Developer error: please ensure that your transaction arguments are correct. The Developer Console provides a no-code transaction builder to validate transactions are correctly configured. If there is an error, transactions may revert on the destination chain.
  • Non-existent liquidity: For example, if an NFT mints out or prices swing dramatically during the course of a transaction, transactions may revert on the destination chain.

In the event of a failed transaction, users will be refunded in the chain's gas token on the chain where the transaction fails. This means that users will often receive refunds for bridgeAndExecute transactions on the destination chain. This approach minimizes user funds lost to gas fees and leaves the user with funds where they intended to spend them.

Transaction Times & Fees

Decent is fast and cheap for users. Transactions confirm on the source chain in 1-2 seconds, and settle in 5 to 30 seconds. Each transaction costs between 5 cents and $1.50 depending on the token and chain pairs.

Security

Because Decent's liquidity layer routes over LayerZero and canonical bridges, the primary trust assumptions for developers to consider are those of LayerZero and the underlying blockchain. Users are never exposed to long-tail bridge risk or centralized routing.

Decent uses native liquidity on each chain so that the security assumptions of one chain do not bleed into another. Decent absorbs this risk based on our vetting of supported chains so that users do not have to.

As with any protocol, developers should consider smart contract risk. All smart contracts included in Decent's routing have successfully passed multiple audits: