Just an update, working on this with @Tarik and found some more Polkadot JS bugs. Sorry for the delay but we should end up with a successful demo in the next day and better Polkadot JS out of it.
Case 1: A local transfer of USDT
I don’t know why Subscan shows a fee in DOT, but you can see from the event log and address history that it’s never had DOT and paid the fee in USDT.
Case 2: Sending USDT to Moonbeam
It did indeed fail on Polkadot and on Kusama, I stand corrected. It really should have been handled by the TakeFirstAssetTrader
and I need to look into it more. Obviously that should have some test cases. Will log an issue and make sure we fix this.
Haven’t looked into sending PINK from Moonbeam yet, but I don’t have control over the XCM programs they send. Will look into making a demo though.
XCM transport fees are currently limited to using DOT (or some other single asset configured by the runtime).
There is work planned under Asset Transactor on Asset Hubs not Working With Sufficient Assets · Issue #3958 · paritytech/polkadot-sdk · GitHub to give the ability to hook in asset-conversion
for XCM transport fees, and thus be able to just-in-time swap whatever for DOT, thus completely supporting “fees in USDT” on Asset Hub.
Exploring options for other chains here: Asset Hub Brainstorming Session - Call Notes and Discussion Continuation - #2 by acatangiu
Am I right in understanding that sufficient assets can be used only for transaction fees but not for deposit fees on Asset Hub?
Would also really appreciate if someone can provide me with some sufficient assets on Rococo Asset Hub for testing!
Half right, they cannot be used for deposits. Any asset (not just sufficient) can be used for transaction fees. The ONLY thing sufficient assets can do that others cannot is be used in lieu of the existential deposit to make an account exist.
Sure, post an address.
Is this because now we have asset conversion live? What happens if there is no pool for the asset? For example, there’s no pool in Rococo AH for ROC-1984 and the runtime API quotePriceExactTokensForTokens
returns null
. Will it still be possible to pay with 1984 in this case?
5GEse7uuvXbkNFi6o8WeaL1S5omApVB4D9oFjEm7791BuLXW
Thanks!
There needs to be a pool, but anyone can create a pool for any asset. I’ll make sure one for 1984 gets set up in the next day or two.
Sent
We implemented the “pay with any asset with pool” feature in Taniko but seems like asset conversion is not working on Rococo or Westend Asset Hubs.
I tested with Polkadot and managed to put a remark onchain paying with DED (see extrinsic) but on the testnets the asset conversion runtime APIs return null and submitting an extrinsic gives an error 1010: Invalid Transaction: Inability to pay some fees , e.g. account balance too low
.
Let me know if I should file an issue somewhere
Do pools exist for the assets you are trying to pay with?
I created a pool and added liquidity for my asset a while ago, been trying to add more liquidity to see if this is the issue but seems like Rococo Asset Hub is down.
@lrazovic found a nice workaround for this problem. The XCM FeeManager
withdraws the DOT in the dispatch phase, not pre-dispatch like transaction-payment
. So, you can just batch a swap in Asset Conversion ahead of the other call and pay for the whole thing with a non-DOT asset.
Repo here: GitHub - lrazovic/xcm-batch-example
Demo transaction: https://assethub-polkadot.subscan.io/extrinsic/6657108-3