referrerpolicy=no-referrer-when-downgrade

redeem

Function redeem 

Source
pub fn redeem<T: Config>(
    asset_id: T::AssetId,
    amount: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance,
)
Expand description

Swap internal for external stablecoin.

§Dispatch Origin

Must be Signed by the user performing the swap.

§Details

Burns amount internal from the caller minus fee (transferred to Config::FeeDestination), then transfers the resulting amount in external stablecoin from PSM to the caller. The fee is calculated using ceiling rounding (mul_ceil), ensuring the protocol never undercharges.

§Parameters

  • asset_id: The external stablecoin to receive (must be in ExternalAssets)
  • amount: Amount of internal to redeem

§Errors

§Events

§Warning: Doc-Only

This function is an automatically generated, and is doc-only, uncallable stub. See the real version in Pallet::redeem.