Skip to Content
BrokersBrokers

Introduction

A Broker, in the context of the Chainflip protocol, is an entity that facilitates the process of initiating a swap on behalf of end users. They provide an endpoint to interact with the State Chain, reducing the complexity of transactions and lowering gas fees.

Brokers forward users’ swap requests to the network, paying transaction fees on their behalf and potentially taking a commission for each swap. Successful brokers need to provide and market a swapping interface and ensure they are resistant to spam attacks.

Brokers

Any State Chain account can play the role of a Broker. Their role is to construct and submit Deposit Channel Requests extrinsics to the blockchain for themselves, but mostly on behalf of end users. This role is essential in enabling the Chainflip protocol’s default user experience: without an access point to submit a transaction to the state chain, users would have to be forced to include complex transaction metadata in their swap deposits to vaults. This would increase gas fees for users and would also necessitate the use of specialized wallets and a myriad of SDK integrations to overcome this issue.

A Broker should offer an endpoint that takes an input of swap intent information and returns the extrinsic hash once the Broker has opened a Deposit Channel on the State Chain for the user. From there, the Deposit Channel can be verified through any secondary source before a deposit to the resulting Deposit Channel Address is made.

Although the role of a Broker is relatively straightforward, one of the major challenges with running a public endpoint to the State Chain is the threat of blockchain spam. To overcome this for the sake of network integrity, Brokers pay a small State Chain transaction fee in $FLIP every time they submit an extrinsic to the State Chain. These $FLIP transaction fees are burned.

This places the burden of spam prevention on the Broker. If their endpoint is abused, they end up paying for the associated transaction fees. As a result, Brokers will need to design systems that protect against spam attacks. Private Brokers sidestep this issue, but public ones will need to ensure their web interface or API is appropriately protected, and that requests are appropriately filtered.

Vault Swaps

Deposit Channels can be bypassed through Vault swaps. This process requires the user to send funds directly to the Vault’s primary wallet or call a Vault contract’s swap function, but must include all of the required swap information, such as Destination Address and Destination Chain, in the deposit transaction on the external chain. Upon witnessing this direct transfer, Validators will parse the metadata and immediately include the trade in the swap queue.

This method could be used by application developers who want to avoid the time needed for a call-and-response from the State Chain, and instead trigger the swap directly.

There are trade-offs in using Vault swaps depending on the source chain. For instance, on Ethereum, using a Deposit Channel is more gas-efficient (and therefore cheaper) than a Vault swap. On the other hand, deposit channels require interaction with the State Chain through a Broker API.

Broker Fees

This design then raises the question: why would anyone run a Broker if they have to pay for third parties to use it, especially when those third parties may be malicious?

The answer lies in Broker Fees. Broker operators can choose to charge a fee for the use of their endpoint, and can be set at any value from 0 basis point to 1000 basis points. When set to more than zero, the network will charge an additional fee which, like the network fee, is deducted from the USDC amount of every successful swap and credited to the broker’s account.

This way, anyone wishing to integrate Chainflip into their wallet, web interface, or other Web3 products can benefit from getting their users trading on the protocol. The better the balance Broker operators can strike between attracting users and managing Deposit Channel Request transaction fees, the more profits they can expect to make.

Broker fees are expected to be an important driver of protocol growth, filling the role of an equivalent affiliate scheme common in many centralized exchanges, and even some decentralized ones.

It also removes some incentives to fragment the cross-chain swapping app by offering an easy way to collect fees based on the same protocol in the backend but with different trading interfaces, target users, and product experiences.

With that said, many Brokers will probably not take a fee, particularly private Brokers set up by professional traders to rapidly interact with the network for software trading strategies. However, Brokers that decide to take fees can withdraw these balances at any time through the CLI.

Quick Start

If you are a developer of wallets, aggregators or DEXes, you can earn revenue by bringing volume to Chainflip’s ecosystem. Any State Chain account can register as a Broker, and start submitting Deposit Channel Request or Vault swaps on users’ behalf.

To integrate Chainflip swapping, you can integrate via:

Last updated on