Repository navigation
Swap to DOT through Chainflip and proxy deposit channels - #1548
Merged
Merged
Conversation
1. Map Chainflip Assethub to Polkadot and its DOT asset (dot.hub) 2. Enable swaps on Polkadot; Chainflip keeps Polkadot destination-only since Asset Hub has no vault swaps 3. Update the features matrix
1. API: proxy broker_request_swap_deposit_address for Asset Hub sources only with our commission 2. Cache the SS58 channel address as a Chainflip deposit id so a transfer to it is tracked as a swap
0xh3rman
marked this pull request as ready for review
October 15, 2026 01:21
1. Encode our commission in the broker request instead of taking it from the client; the API only checks the source is Asset Hub 2. Parse the broker's JSON-RPC reply on DepositChannelResponse and decode hex channel addresses with decode_hex 3. Add DepositChannelRequest::mock on the shared testkit addresses, with a new TEST_POLKADOT_SENDER that mock_polkadot reuses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #754. Chainflip supports Polkadot through Asset Hub (
dot.hub), but Asset Hub has no vault swaps, so swapping from DOT needs a broker deposit channel. This PR ships the parts that don't change the app's DOT-source behaviour: DOT as a destination, and the API route that opens deposit channels so it can be deployed and tested before the source path lands.Assethubto Polkadot and its DOT asset, and enable swaps on Polkadot; Chainflip keeps Polkadot destination-only for now (live ETH → DOT quote checked)POST /v1/swaps/providers/chainflip/deposit_channelbuildsbroker_request_swap_deposit_addressitself (Asset Hub sources only, our 45 bps commission), so it can't be used to call other broker methods0xhex; the route converts them to SS58 and caches them as Chainflip deposit ids, so a transfer to the channel is tracked as a swap. The test vector is a real channel opened on mainnet (2.55 s through the broker RPC, no opening fee)Tested on mainnet from an iOS simulator build: 0.1 SOL → 8.6407 DOT, Chainflip swap 1919267 (Solana deposit
4oVnrS…wrNyy, Asset Hub payout21839178-2), our broker account credited at 45 bps.Deployment:
swap.chainflip.urlcomes fromSWAP_CHAINFLIP_URL: chainflip_broker_rpc(gemwalletcom/infra#28, merged), which injects the BaaS key.DOT on Polkadot still needs
is_swappable = truein the assets table for the Swap button to show.Next: the DOT source path (quote without a vault swap, transfer to the channel, BaaS status by transaction hash, Polkadot swap fee estimate) is on
hm/chainflip-dot-source, to be opened after a real 4 DOT swap against the deployed route.