Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

META: Tutorials and Examples #34

Open
5 tasks
vstam1 opened this issue Jun 22, 2023 · 1 comment
Open
5 tasks

META: Tutorials and Examples #34

vstam1 opened this issue Jun 22, 2023 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation META

Comments

@vstam1
Copy link
Contributor

vstam1 commented Jun 22, 2023

Based on community feedback, it has become evident that there is a need for examples and tutorials for XCM. The existing documentation provides a solid foundation, but developers would greatly benefit from practical implementation guidance and code snippets (cookbook) to better understand and utilize XCM in their projects.

Furthermore, there is a specific request for examples focusing on the configuration of the xcm-executor. It would be highly beneficial to provide clear examples demonstrating the various configurations and options available for xcm-executor.

Additionally, together with the Trappist team we decided to create the examples using Trappist (https://github.com/paritytech/trappist) as the framework. Trappist is widely used as an example within the community and would be an excellent choice for showcasing XCM integration in real-world scenarios.

Examples/Tutorials

Preview Give feedback
@vstam1 vstam1 added documentation Improvements or additions to documentation META labels Jun 22, 2023
@vstam1 vstam1 self-assigned this Jun 22, 2023
@vstam1 vstam1 pinned this issue Jun 22, 2023
@hbulgarini
Copy link

During sub0 2022, we presented with @stiiifff a complex use case that includes most of the items described above.
Here is the presentation: https://www.youtube.com/watch?v=1eJwzbtqZYs
The presentation rely on a use case based on real world assets (RWA) and a borrow and lending protocol from those RWA (represented as NFT).

The topology of the workshop was:

  • Statemine (now called asset hub) as a reserve for NFT and fungible asset.
  • Trappist holding the NFT borrow and lending protocol.
  • Stout as a DEX parachain.

The sequence for the workshop was:

  • Fund Trappist and Stout with stUSD backed in statemine.
  • Transfer an NFT to Trappist being backed in Statemine.
  • Use the NFT in the borrow and lending app by locking it on Statemine and providing some liquidity to the account.
  • The same borrow and lending app performs the following steps :
    • Move the liquidity from Trappist to Stout.
    • Executes a transact that provide liquidity to a liquidity pool running on the DEX of Stout. Also this step is swapping the 50% automatically to fill the 50/50 proportion of LPs.

The code can be found here: https://github.com/paritytech/trappist/blob/sub0_2022
It can be considered as a reference but not definitely as a starting point since some things has changed/improved in XCM v3 from that time and also i cut some corners due to time constraints that need to be addressed. This for example:

https://github.com/paritytech/trappist/blob/sub0_2022/runtime/trappist/src/xcm_config.rs#L73:L91

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation META
Projects
None yet
Development

No branches or pull requests

2 participants