Explanation of the Withdraw transaction


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;

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

Last updated