25 releases (major breaking)

new 21.1.0 Mar 27, 2025
20.0.0 Sep 26, 2024
19.0.0 Jul 18, 2024
18.0.0 Jul 12, 2024
0.0.0 Mar 31, 2023

#396 in Magic Beans

Download history 29037/week @ 2024-12-09 23381/week @ 2024-12-16 6559/week @ 2024-12-23 12759/week @ 2024-12-30 22659/week @ 2025-01-06 35594/week @ 2025-01-13 30912/week @ 2025-01-20 25748/week @ 2025-01-27 30801/week @ 2025-02-03 35167/week @ 2025-02-10 34328/week @ 2025-02-17 10659/week @ 2025-02-24 4488/week @ 2025-03-03 6154/week @ 2025-03-10 4309/week @ 2025-03-17 4738/week @ 2025-03-24

19,985 downloads per month
Used in 94 crates (10 directly)

Apache-2.0

3.5MB
56K SLoC

asset-conversion

A swap pallet

This pallet allows assets to be converted from one type to another by means of a constant product formula. The pallet based is based on Uniswap V2 logic.

Overview

This pallet allows you to:

  • create a liquidity pool for 2 assets
  • provide the liquidity and receive back an LP token
  • exchange the LP token back to assets
  • swap 2 assets if there is a pool created
  • query for an exchange price via a new runtime call endpoint
  • query the size of a liquidity pool.

Please see the rust module documentation for full details:

cargo doc -p pallet-asset-conversion --open

License

License: Apache-2.0

Release

Polkadot SDK Stable 2412

Dependencies

~19–34MB
~574K SLoC