Skip to content

Swap to DOT through Chainflip and proxy deposit channels - #1548

Merged
0xh3rman merged 3 commits into
mainfrom
hm/chainflip-dot
Oct 15, 2026
Merged

0xh3rman merged 3 commits into
mainfrom
hm/chainflip-dot

Conversation

@0xh3rman

@0xh3rman 0xh3rman commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

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.

  1. Core: map Chainflip Assethub to Polkadot and its DOT asset, and enable swaps on Polkadot; Chainflip keeps Polkadot destination-only for now (live ETH → DOT quote checked)
  2. API: POST /v1/swaps/providers/chainflip/deposit_channel builds broker_request_swap_deposit_address itself (Asset Hub sources only, our 45 bps commission), so it can't be used to call other broker methods
  3. The broker returns Asset Hub channel addresses as 0x hex; 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 payout 21839178-2), our broker account credited at 45 bps.

Deployment: swap.chainflip.url comes from SWAP_CHAINFLIP_URL: chainflip_broker_rpc (gemwalletcom/infra#28, merged), which injects the BaaS key.

DOT on Polkadot still needs is_swappable = true in 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.

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
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
@0xh3rman
0xh3rman merged commit 427b525 into main Oct 15, 2026
6 checks passed
@0xh3rman
0xh3rman deleted the hm/chainflip-dot branch October 15, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant