Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

remove_liquidity

Burn LP shares to schedule a counterparty-vault withdrawal (subject to cooldown).

The release value is computed as effective_equity × (shares_to_burn / effective_supply) at burn time, but the USD is not credited immediately — the cooldown prevents LPs from front-running known losses. See protocol book: perps/5-vault §3.

Signature

def remove_liquidity(self, shares_to_burn: int) -> dict[str, Any]

Example

from dango.exchange import Exchange
from dango.utils.types import Addr
 
exchange = Exchange(wallet, base_url, account_address=Addr("0x..."))
 
# Burn 50 LP shares
exchange.remove_liquidity(50)

Parameters

shares_to_burnint. Number of shares to burn (Uint128). Must be a positive int (not bool, not float). Raises TypeError on non-int, ValueError on zero / negative.

Returns

dict[str, Any] — the BroadcastTxOutcome envelope. The actual USD release happens after the vault cooldown period elapses.

Notes

  • The vault cooldown period is in perps_param's vault_cooldown_period field.
  • Pending unlocks surface in user_state's unlocks list.

See also