WispSwap whitepaper
  • ⏺️Overview
  • πŸŽ‡Launch & Enchated Pools
  • 🀝Business Enquiries
  • products
    • πŸ™ŒGetting Started
    • πŸ”„Token Swap
      • ↕️Concentrated Liquidity Market Maker
      • ⬆️Asymmetric Liquidity Market Maker
      • πŸ’§ Liquidity Pools
        • πŸ“ΌPool Types
        • πŸ’ΉZap
      • πŸ–ΌοΈspNFT
        • πŸ“°Properties
        • ⚑Yield farming
    • ⭐LSDfi
      • Overview
      • Background
        • LSTfi Challenges
        • Solutions with wispSUI
      • WispSUI
        • Risk mitigation
        • Basket composition
        • Basket rebalancing mechanism
      • vdAMM: Validator Decentralization Automated Market Maker
        • Overview
        • Fees structure
      • Integrating with wispSui
        • Developemt progress
        • Contract addresses
        • Minting wispSui
        • Swapping between LSTs
        • Other view functions
      • How to
        • Mint wispSUI with SUI
        • Mint wispSUI with LSTs
        • Swap between LSTs
        • Stake wispSUI
        • Withdraw wispSUI into LSTs
    • πŸ†Wisp-Prediction
      • 🀼Binary Option Prediction Market
      • πŸ–‡οΈCross-chain Prediction Protocol
      • ❔Wisp-Prediction FAQ
    • πŸ”ŒveWISP Plug-ins
      • 🀜Farm Boosting
      • πŸ”…Dividends Pool
      • ✍️Voting
    • πŸŒ‰Cross-Chain Bridge
  • Tokenomics
    • πŸ‘ΎWISP
    • πŸ‘½veWISP
    • πŸ’³Protocol earnings
    • πŸ”₯Deflation Mechanism
  • references
    • 🎯Roadmap
    • πŸ›‘οΈAudit
    • ♾️Official Links
    • πŸ—ƒοΈMedia Kit
    • ❔General FAQ
Powered by GitBook
On this page
  1. products
  2. LSDfi
  3. Integrating with wispSui

Swapping between LSTs

The following section details how to swap LST to LST using wispSui's vdAMM.

Required package

LSDfi::lsdfi::swap

public entry fun swap<I, O>(
    pool_registry: &mut LSDFIPoolRegistry,
    aggregator: &Aggregator,
    in_coin: Coin<I>,
    clock: &Clock,
    ctx: &mut TxContext,
)

Type parameters:

  • I: LST to put into pool

  • O: LST to get back

Parameters:

  • pool_registry: mutable reference to LSDFIPoolRegistry object

  • aggregator: reference to Aggregator object in WispLSDFIAggregator package

  • in_coin: LST coin of type I

  • clock: reference to Clock object (address: 0x6)

  • ctx: mutable reference to TxContext

Use: Swap in_coin to the desired LST coin type. Returned coin will be transfered to sender

LSDfi::lsdfi::swap_non_entry

public fun swap_non_entry<I, O>(
    pool_registry: &mut LSDFIPoolRegistry,
    aggregator: &Aggregator,
    in_coin: Coin<I>,
    clock: &Clock,
    ctx: &mut TxContext,
): Coin<O>

Same as swap but return a Coin of O type for further action instead of transferring to sender

LSDfi::lsdfi::swap_mul_coin

public entry fun swap_mul_coin<I, O>(
    pool_registry: &mut LSDFIPoolRegistry,
    aggregator: &Aggregator,
    in_coins: vector<Coin<I>>,
    amount: u64,
    clock: &Clock,
    ctx: &mut TxContext,
)

Same as swap but use multiple Coins, leftovers will be transferred back to sender

PreviousMinting wispSuiNextOther view functions

Last updated 1 year ago

⭐