📚
Duality Documentation
  • What is Duality?
  • Concepts
    • AMMs and Orderbooks
    • Liquidity Pools
    • Ticks
    • TickLiquidity
      • Pool Reserves
        • Fees
      • Limit Order Tranches
    • Liquidity Iteration
    • Swaps
    • Overview
  • Module Documentation for Developers
    • DEX Module
      • Transaction Messages
        • Deposit
        • Withdrawal
        • MultiHop Swap
        • Place Limit Order
        • Cancel Limit Order Message
        • Withdraw Filled Limit Order
      • Queries
  • Dictionary
  • Advanced Concepts
    • Replicating Market Makers
    • Shared Liquidity
  • User Interface
Powered by GitBook
On this page
  • Overview
  • Withdraw Message
  1. Module Documentation for Developers
  2. DEX Module
  3. Transaction Messages

Withdrawal

Explanation of the Withdraw transaction

Overview

Withdraw is used to redeem PoolShares for the user’s pro-rata portion of tokens within a liquidity pool. Users can withdraw from a pool at any time. When Withdrawing from a pool they will receive Token0 and Token1 in the same ratio as what is currently present in the pool. When withdrawing the users PoolShares are burned and their account is credited with the withdrawn tokens.

Withdraw Message

message MsgWithdrawal {
    string creator = 1;
    string receiver = 2;
    string token_a = 3;
    string token_b = 4;
    repeated string shares_to_remove = 5 [
        (gogoproto.moretags) = "yaml:\"shares_to_remove\"",
        (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
        (gogoproto.nullable) = false,
        (gogoproto.jsontag) = "shares_to_remove"
    ];
    repeated int64 tick_indexes_a_to_b = 6;
    repeated uint64 fees = 7;
}
Field
Description

Creator string (sdk.AccAddress)

The account from which the PoolShares are removed

Receiver string (sdk.AccAddress)

The account to which the tokens are credited

TokenA string

Denom for one side of the deposit

TokenB string

Denom for the opposing side of the deposit

SharesToRemove []sdk.Int

Amount of shares to remove from each pool

TickIndexesAToB []int64

Tick indexes of the target LiquidityPools defined in terms of TokenA to TokenB (ie. TokenA is on the left)

Fees []uint64

Fee for the target LiquidityPools

PreviousDepositNextMultiHop Swap

Last updated 1 year ago