We’re excited to announce that SwapKit now supports Chainflip’s Dollar-Cost Averaging (DCA) swap feature. Integrators can now fetch priced optimized quotes where large swaps can be broken down into smaller “chunks” which are executed over time.
DCA Swaps is similar to THORChain/Maya Protocol’s ‘Streaming Swaps’ feature, which allows for greater capital efficiency via lower slippage regardless of liquidity depth. Supported chains include Native Bitcoin, Ethereum, Solana, Polkadot and Arbitrum.
For existing SwapKit integrators, the new provider name is CHAINFLIP_STREAMING. Read on to learn more about the feature and how to support in your integration.
Enabling Chainflip DCA (Streaming)
To integrate Chainflip DCA Swaps, SwapKit integrators should enable the new provider CHAINFLIP_STREAMING
. Simply copy the metadata.chainflip
object and pass it as the request body when calling /chainflip/broker/channel
as the quote response includes all of the information you need to open a channel.
For example:
"meta": {
...,
"chainflip": {
"sellAsset": {
"chain": "Ethereum",
"asset": "ETH"
},
"buyAsset": {
"chain": "Ethereum",
"asset": "USDC"
},
"destinationAddress": "0xB6F1F501BA37551964C9b23B4c38faED71DDEAfA",
"affiliateFees": [
{
"brokerAddress": "cFNwtr2mPhpUEB5AyJq38DqMKMkSdzaL9548hajN2DRTwh7Mq",
"feeBps": 50
}
],
"refundParameters": {
"minPrice": "0xd8594b953e893800000000000",
"refundAddress": "0xB6F1F501BA37551964C9b23B4c38faED71DDEAfA",
"retryDuration": 150
},
"dcaParameters": {
"chunkInterval": 2,
"numberOfChunks": 6
}
}
}
Slippage Protection
If slippage protection is enabled, the minimum price requirement is applied to each individual chunk. If a chunk is executed, but does not meet the minimum price requirement, it is retried a few blocks later, pushing back the execution of any remaining chunks. If the same chunk reaches its retry limit, it will be refunded along with any remaining chunks in a single transaction to the user specified refund address (SwapIN). In that case, any amount successfully swapped in prior chunks is still sent to the user-specified destination address (SwapOUT).
Case Studies
Example 1: Successful DCA swap
![](https://swapkit.dev/wp-content/uploads/2025/01/image-1024x430.png)
- A user initiates a swap by depositing 5 BTC to get USDC with a minimum accepted price of 50,000 USDC/BTC. The channel’s DCA parameters have been set to split the swap into 5 chunks with an interval of 2 blocks between them.
- The deposit is witnessed at state chain block 100. The first chunk of 1 BTC is scheduled for execution at block 102 (small initial delay allows LPs update their orders for the first chunk).
- At block 102 the chunk is executed with the output of 50,100 USDC, which is within the price limit. According to DCA parameters, the second chunk is scheduled for execution 2 blocks later, at block 104.
- At block 104 the second chunk is executed at a price of 49,900 USDC, which is below the limit, and the swap is reverted. According to slippage protection parameters the chunk is to be retried a few times before the swap is refunded, with the first attempt scheduled for block 109.
- At block 109 the second chunk is retried, and this time gives the user the price of 50,070 USDC, which is within the limit.
- The remaining chunks are also executed successfully at blocks 111, 113, and 115 resulting in 50020 USDC, 50010 USDC, and 50000 USDC respectively.
- The total output of the swap is 250,200 USDC which is sent to the user’s USDC wallet address.
Example 2: DCA with partial refund
![](https://swapkit.dev/wp-content/uploads/2025/01/image-1-1024x437.png)
- A user initiates a swap by depositing 5 BTC to get USDC with a minimum accepted price of 50,000 USDC/BTC. The channel’s DCA parameters have been set to split the swap into 5 chunks with an interval of 2 blocks between them.
- The deposit is witnessed at state chain block 100. The first chunk of 1 BTC is scheduled for execution at block 102.
- At block 102 the chunk is executed with the output of 50,100 USDC, which is within the price limit. According to DCA parameters, the second chunk is scheduled for execution 2 blocks later, at block 104.
- As in the example above, the second chunk fails at block 104 and is retried at block 109. This time, however, the retry also fails, and the swap is aborted (to keep the example simple we assume only one retry is allowed). As a result, the amount of 50100 USDC from the successfully executed chunks is sent to the user’s destination USDC wallet address. The remaining 4 BTC is refunded to the user’s refund BTC wallet address.
Integrate Chainflip DCA via SwapKit today
Chainflip DCA swaps are ideal for swappers looking to avoid large price swings during high-volume trades. By spreading out the swaps into chunks, users can benefit from improved average pricing and reduced exposure to sudden market movements.
Start integrating Chainflip DCA with SwapKit today and provide your users with professional-grade trading tools:
- Visit docs.swapkit.dev: Learn more about our API, SDK via the developer documentation.
- Integrate Our SDK: If you’re building a wallet, dApp, or any DeFi interface, add support for cross-chain swaps in as few as 100 lines of code.
- Configure Chainflip: Cross-chain swaps via Chainflip protocol are available via SwapKit through the
CHAINFLIP
andCHAINFLIP_STREAMING
providers.
Get in touch if you need any support or to discuss integrating SwapKit in your product.
SwapKit: Seamless Access to Best-in-class Cross-Chain Swaps
![](https://swapkit.dev/wp-content/uploads/2025/01/swapkit-flow-4-copy-1024x312.jpg)
SwapKit provides a comprehensive SDK that simplifies the integration of cross-chain swaps, offering unparalleled flexibility and efficiency. By providing a unified interface for interacting with Chainflip/THORChain/Maya Protocol, SwapKit simplifies the integration process for all dApps, allowing any team to tap into robust decentralized liquidity pools and trustless cross-chain technology with minimal friction.
Learn more about how SwapKit can simplify cross-chain integrations, visit SwapKit.dev.
We invite projects and teams to experience the transformative power of SwapKit. SwapKit offers a composable, user-friendly API+SDK that makes integrating cross-chain functionality easy- empowering any dApp to go multi-chain in less than 100 lines of code.
SwapKit comes with the benefits of streamlined affiliate fees, improved quotes & gas pricing, robust wallet connectivity, and DEX aggregation enabling swaps between 6,000+ crypto assets across 17+ blockchains in a single transaction.
Powering leading protocols such as THORSwap, Ledger Live, OKX Wallet, LI.FI, Jumper, Onekey and more, SwapKit abstracts the complexity of integrating Cross-Chain services with a battle-tested infrastructure for cost-effective, enterprise-level performance.
Integrate our SDK to access state-of-the-art cross-chain technology, expand your trading operations, and drive significant volume and growth. SwapKit is more than a tool; it’s a gateway to the future of decentralized finance, offering a path to innovate, excel, and lead in the ever-evolving DeFi landscape.
![](https://swapkit.dev/wp-content/uploads/2024/04/image-1-1024x309.png)