You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: develop/interoperability/best-practices-for-teleporting-assets.md
+17-7Lines changed: 17 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Account queries should check:
29
29
- The correct address and address format is used.
30
30
- Whether the account meets existential deposit requirements.
31
31
- Balance of the sending account has:
32
-
- Enough to pay for fees (transaction fees, delivery fees, and/or swap fees).
32
+
- Enough to pay for fees (transaction fees, XCM execution and delivery fees, and/or swap fees).
33
33
- Enough to cover the existential deposit before and after the transfer.
34
34
- Balance of the recipient account has:
35
35
- Enough to cover for the existential deposit.
@@ -57,11 +57,11 @@ You can refer to the following snippet as an example of checking for the Existen
57
57
- **Kusama**: 0.0033 KSM (3.3 * 10^10 planck)
58
58
- **Asset Hub**: 0.01 DOT (10^8 planck)
59
59
60
-
For non-sufficient assets, make sure the destination account has enough native tokens or assets to maintain the ED; otherwise, include asset conversion instructions in the XCM.
60
+
For non-sufficient assets, make sure the destination account has a sufficient amount in the form of a native or sufficient asset to cover for the ED; otherwise, include asset conversion instructions in the XCM to swap for a sufficient asset or native token.
61
61
62
62
## Fee Estimation and Coverage
63
63
64
-
When it comes to transaction fees, XCM delivery fees, and asset conversion swapping fees, you can use associated runtime APIs to obtain an accurate estimate of the fee rather than hardcoded values.
64
+
When it comes to transaction fees, XCM execution and delivery fees, and asset conversion swapping fees, you can use associated runtime APIs to obtain an accurate estimate of the fee rather than hardcoded values.
65
65
66
66
### Runtime API Integration
67
67
@@ -72,13 +72,23 @@ When it comes to transaction fees, XCM delivery fees, and asset conversion swapp
- [XCMPaymentAPI](https://paritytech.github.io/polkadot-sdk/master/xcm_runtime_apis/fees/trait.XcmPaymentApi.html){target=\_blank} for local XCM execution fees:
- [AssetConversionAPI](https://paritytech.github.io/polkadot-sdk/master/pallet_asset_conversion/trait.AssetConversionApi.html){target=\_blank} (available on Asset Hub) for fee conversion:
83
93
84
94
```typescript
@@ -100,8 +110,8 @@ For dealing with non-sufficient assets and fees, there are different fee payment
Swappingnon-sufficientassetsforasufficientassetcanbedonewiththehelpof [assetconversion](https://wiki.polkadot.network/learn/learn-asset-conversion-assethub){target=\_blank} which is live on Asset Hub. Always make sure there is an associated liquidity pool with healthy liquidity for the pair that you intend to swap.
Copy file name to clipboardExpand all lines: llms.txt
+48-12Lines changed: 48 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -376,7 +376,7 @@ Account queries should check:
376
376
- The correct address and address format is used.
377
377
- Whether the account meets existential deposit requirements.
378
378
- Balance of the sending account has:
379
-
- Enough to pay for fees (transaction fees, delivery fees, and/or swap fees).
379
+
- Enough to pay for fees (transaction fees, XCM execution and delivery fees, and/or swap fees).
380
380
- Enough to cover the existential deposit before and after the transfer.
381
381
- Balance of the recipient account has:
382
382
- Enough to cover for the existential deposit.
@@ -433,11 +433,11 @@ async function queryAccountBalance(address: string) {
433
433
- **Kusama**: 0.0033 KSM (3.3 * 10^10 planck)
434
434
- **Asset Hub**: 0.01 DOT (10^8 planck)
435
435
436
-
For non-sufficient assets, make sure the destination account has enough native tokens or assets to maintain the ED; otherwise, include asset conversion instructions in the XCM.
436
+
For non-sufficient assets, make sure the destination account has a sufficient amount in the form of a native or sufficient asset to cover for the ED; otherwise, include asset conversion instructions in the XCM to swap for a sufficient asset or native token.
437
437
438
438
## Fee Estimation and Coverage
439
439
440
-
When it comes to transaction fees, XCM delivery fees, and asset conversion swapping fees, you can use associated runtime APIs to obtain an accurate estimate of the fee rather than hardcoded values.
440
+
When it comes to transaction fees, XCM execution and delivery fees, and asset conversion swapping fees, you can use associated runtime APIs to obtain an accurate estimate of the fee rather than hardcoded values.
This code establishes a connection to the Polkadot network and queries detailed fee information for a specific transaction call, including base fees, length fees, and tip calculations.
460
460
461
+
462
+
- [XCM Payment API](https://paritytech.github.io/polkadot-sdk/master/xcm_runtime_apis/fees/trait.XcmPaymentApi.html){target=\_blank} for local XCM execution fees:
463
+
464
+
```typescript
465
+
import { dot } from '@polkadot-api/descriptors';
466
+
import { createClient } from 'polkadot-api';
467
+
import { getWsProvider } from 'polkadot-api/ws-provider/web';
This code calculates the delivery fees required to send an XCM message to a specific destination parachain, helping estimate cross-chain transaction costs.
477
512
513
+
478
514
- [Asset Conversion API](https://paritytech.github.io/polkadot-sdk/master/pallet_asset_conversion/trait.AssetConversionApi.html){target=\_blank} (available on Asset Hub) for fee conversion:
479
515
480
516
```typescript
@@ -510,8 +546,8 @@ For dealing with non-sufficient assets and fees, there are different fee payment
510
546
511
547
Sufficient assets can:
512
548
513
-
- Pay for transaction and XCM delivery fees directly.
514
549
- Suffice for account existence by meeting the existential deposit requirements.
550
+
- Pay for transaction and, if the chain configuration allows, sufficient assets can also be used for XCM execution and delivery fees.
515
551
516
552
!!!note Sufficient Assets
517
553
Always check the chain to see what assets are considered sufficient assets.
@@ -521,8 +557,8 @@ Sufficient assets can:
521
557
522
558
Non-sufficient assets can:
523
559
524
-
- Pay for transaction and XCM delivery fees by swapping for a sufficent asset.
525
-
- Be used to create a new account by swapping for an exact amount of a sufficient asset to cover for the existential deposit of the new account.
560
+
- Pay for transaction and XCM execution/delivery fees by swapping for a sufficent asset.
561
+
- Be used to create new accounts by swapping for an exact amount of a sufficient asset to cover for the existential deposit of the new account.
526
562
527
563
!!!note Swapping Non-Sufficient Assets
528
564
Swapping non-sufficient assets for a sufficient asset can be done with the help of [asset conversion](https://wiki.polkadot.network/learn/learn-asset-conversion-assethub){target=\_blank} which is live on Asset Hub. Always make sure there is an associated liquidity pool with healthy liquidity for the pair that you intend to swap.
@@ -22738,9 +22774,9 @@ Non-sufficient assets, on the other hand, **cannot** suffice on their own for ac
22738
22774
22739
22775
On Asset Hub, sufficient assets:
22740
22776
22741
-
- Can be natively used for the existential deposit (ED).
22742
-
- Can be natively used for [paying transaction fees](#transaction-fees).
22743
-
- Can be natively used for [paying XCM delivery fees](#xcm-fees).
22777
+
- Can be used for the existential deposit (ED).
22778
+
- Can be used for [paying transaction fees](#transaction-fees).
22779
+
- Can be used for [paying XCM execution and delivery fees](#xcm-fees).
22744
22780
- Cannot be used for storage deposits (only if swapped for the native token).
22745
22781
22746
22782
### Non-Sufficient Assets
@@ -22758,14 +22794,14 @@ This allows developers to create a seamless experience for end users by allowing
22758
22794
22759
22795
### Transaction Fees
22760
22796
22761
-
On Asset Hub, both sufficient and non-sufficient assets can be used for paying transaction fees. For sufficient assets, Asset Hub natively converts the native asset (e.g. DOT) amount required to an asset balance and the signer actually pays that asset to a collator. And for non-sufficient assets on Asset Hub developers can leverage [asset conversion](https://wiki.polkadot.network/learn/learn-asset-conversion-assethub){target=\_blank} via a [swap](/tutorials/polkadot-sdk/system-chains/asset-hub/asset-conversion/) or an XCM `ExchangeAsset` instruction to swap the non-sufficient asset for the native asset. For this to work, non-sufficient assets need to have a [liquidity pool set up](https://wiki.polkadot.network/learn/learn-guides-asset-conversion/#create-a-liquidity-pool){target=\_blank} against the native asset (e.g. DOT).
22797
+
On Asset Hub, both sufficient and non-sufficient assets can be used for paying transaction fees. For sufficient assets, Asset Hub natively converts the native asset (e.g. DOT) amount required to an asset balance and the signer actually pays that asset to a collator. And for non-sufficient assets on Asset Hub developers can leverage [asset conversion](https://wiki.polkadot.network/learn/learn-asset-conversion-assethub){target=\_blank} via a [swap](/tutorials/polkadot-sdk/system-chains/asset-hub/asset-conversion/) or an XCM `ExchangeAsset` instruction to swap the non-sufficient asset for any asset that has a [liquidity pool set up](https://wiki.polkadot.network/learn/learn-guides-asset-conversion/#create-a-liquidity-pool){target=\_blank} against the native asset or sufficient asset and use those tokens to cover for transaction fees.
22762
22798
22763
22799
!!!note
22764
22800
Existing UI's, wallets, and tools may have limitations because of design decisions and/or contraints it places e.g. constructing the XCM call in a specific manner and therefore limiting the end user when in reality the Asset Hub system parachain encompasses more functionality than exposed in the third-party UI, such as the ability to pay transaction fees and XCM delivery fees in any asset.
22765
22801
22766
-
### XCM Delivery Fees
22802
+
### XCM Execution and Delivery Fees
22767
22803
22768
-
Both sufficient assets and non-sufficient assets can be used to pay for XCM delivery fees on Asset Hub. However, it is important to note that the XCM program needs to explicitly reference the asset to pay the XCM fee in.
22804
+
Both sufficient assets and non-sufficient assets can be used to pay for XCM local execution fees and delivery fees on Asset Hub. However, it is important to note that the XCM program needs to explicitly reference the asset to pay the XCM fee in.
22769
22805
22770
22806
For non-sufficient assets, this can be done by calling [asset conversion's swap](https://paritytech.github.io/polkadot-sdk/master/pallet_asset_conversion/pallet/dispatchables/fn.swap_tokens_for_exact_tokens.html){target=\_blank} or including an [`ExchangeAsset`](https://paritytech.github.io/polkadot-sdk/master/cumulus_primitives_core/enum.Instruction.html#variant.ExchangeAsset){target=\_blank} instruction in the XCM program to swap the non-sufficient asset for the native asset to pay for the XCM delivery fee.
Copy file name to clipboardExpand all lines: polkadot-protocol/architecture/system-chains/asset-hub.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,9 +129,9 @@ Non-sufficient assets, on the other hand, **cannot** suffice on their own for ac
129
129
130
130
On Asset Hub, sufficient assets:
131
131
132
-
- Can be natively used for the existential deposit (ED).
133
-
- Can be natively used for [paying transaction fees](#transaction-fees).
134
-
- Can be natively used for [paying XCM delivery fees](#xcm-fees).
132
+
- Can be used for the existential deposit (ED).
133
+
- Can be used for [paying transaction fees](#transaction-fees).
134
+
- Can be used for [paying XCM execution and delivery fees](#xcm-fees).
135
135
- Cannot be used for storage deposits (only if swapped for the native token).
136
136
137
137
### Non-Sufficient Assets
@@ -149,14 +149,14 @@ This allows developers to create a seamless experience for end users by allowing
149
149
150
150
### Transaction Fees
151
151
152
-
On Asset Hub, both sufficient and non-sufficient assets can be used for paying transaction fees. For sufficient assets, Asset Hub natively converts the native asset (e.g. DOT) amount required to an asset balance and the signer actually pays that asset to a collator. And for non-sufficient assets on Asset Hub developers can leverage [asset conversion](https://wiki.polkadot.network/learn/learn-asset-conversion-assethub){target=\_blank} via a [swap](/tutorials/polkadot-sdk/system-chains/asset-hub/asset-conversion/) or an XCM `ExchangeAsset` instruction to swap the non-sufficient asset for the native asset. For this to work, non-sufficient assets need to have a [liquidity pool set up](https://wiki.polkadot.network/learn/learn-guides-asset-conversion/#create-a-liquidity-pool){target=\_blank} against the native asset (e.g. DOT).
152
+
On Asset Hub, both sufficient and non-sufficient assets can be used for paying transaction fees. For sufficient assets, Asset Hub natively converts the native asset (e.g. DOT) amount required to an asset balance and the signer actually pays that asset to a collator. And for non-sufficient assets on Asset Hub developers can leverage [asset conversion](https://wiki.polkadot.network/learn/learn-asset-conversion-assethub){target=\_blank} via a [swap](/tutorials/polkadot-sdk/system-chains/asset-hub/asset-conversion/) or an XCM `ExchangeAsset` instruction to swap the non-sufficient asset for any asset that has a [liquidity pool set up](https://wiki.polkadot.network/learn/learn-guides-asset-conversion/#create-a-liquidity-pool){target=\_blank} against the native asset or sufficient asset and use those tokens to cover for transaction fees.
153
153
154
154
!!!note
155
155
Existing UI's, wallets, and tools may have limitations because of design decisions and/or contraints it places e.g. constructing the XCM call in a specific manner and therefore limiting the end user when in reality the Asset Hub system parachain encompasses more functionality than exposed in the third-party UI, such as the ability to pay transaction fees and XCM delivery fees in any asset.
156
156
157
-
### XCM Delivery Fees
157
+
### XCM Execution and Delivery Fees
158
158
159
-
Both sufficient assets and non-sufficient assets can be used to pay for XCM delivery fees on Asset Hub. However, it is important to note that the XCM program needs to explicitly reference the asset to pay the XCM fee in.
159
+
Both sufficient assets and non-sufficient assets can be used to pay for XCM local execution fees and delivery fees on Asset Hub. However, it is important to note that the XCM program needs to explicitly reference the asset to pay the XCM fee in.
160
160
161
161
For non-sufficient assets, this can be done by calling [asset conversion's swap](https://paritytech.github.io/polkadot-sdk/master/pallet_asset_conversion/pallet/dispatchables/fn.swap_tokens_for_exact_tokens.html){target=\_blank} or including an [`ExchangeAsset`](https://paritytech.github.io/polkadot-sdk/master/cumulus_primitives_core/enum.Instruction.html#variant.ExchangeAsset){target=\_blank} instruction in the XCM program to swap the non-sufficient asset for the native asset to pay for the XCM delivery fee.
0 commit comments