Skip to content

Commit

Permalink
Update builders/interoperability/xcm/remote-execution/substrate-calls…
Browse files Browse the repository at this point in the history
…/xcm-transactor-precompile.md

Co-authored-by: Erin Shaben <[email protected]>
  • Loading branch information
themacexpert and eshaben authored Jan 17, 2025
1 parent 9194baf commit 15c9ee3
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ To estimate the amount of token Alice's Computed Origin account will need to hav
```
The response shows that the `transactExtraWeightSigned` is `{{ networks.moonbase_beta.xcm_message.transact.weight.display }}`. This weight is needed to execute the four XCM instructions for this remote call in that specific destination chain. Next, you need to find out how much the destination chain charges per weight of XCM execution in reference to the asset's price. Previously, this was done by sourcing a units per second value. However, this method has been replaced by calculating a relative price. Relative price refers to how many units of the foreign asset correspond to one unit of the native token (GLMR or MOVR) from a value (i.e., price) perspective. For example, if the foreign asset is worth $5 and GLMR is worth $0.25, the relative price would be 0.05. However, we must scale the result to 18 decimals to correspond to the Wei units used. In this case, the relative price would be `50000000000000000`.

You can calculate the relative price with a script in the [XCM Tools repo](https://github.com/Moonsong-Labs/xcm-tools?tab=readme-ov-file#calculate-relative-price){target=\_blank}. The script is also reproduced below:

??? code "Calculate Relative Price"
Expand Down

0 comments on commit 15c9ee3

Please sign in to comment.