Soroswap icon

Soroswap

Interact with Soroswap DEX on Stellar network

Overview

This node integrates with the Soroswap decentralized exchange (DEX) on the Stellar network, enabling users to interact with liquidity pools and perform various trading-related operations. Specifically, the "Remove Liquidity" operation allows users to withdraw a specified amount of liquidity provider (LP) tokens from a liquidity pool composed of two assets.

Common scenarios for this node include:

  • Users wanting to reduce their exposure in a liquidity pool by removing some or all of their LP tokens.
  • Automated workflows that manage liquidity positions on Soroswap based on market conditions.
  • Portfolio rebalancing where liquidity is removed to free up assets for other uses.

Practical example:

  • A user has provided liquidity to a pool consisting of two tokens (Asset A and Asset B). They want to remove 100 LP tokens from this pool and receive the underlying assets back into their wallet. This node facilitates that removal by specifying the token pair, the amount of LP tokens to remove, and optionally the recipient address.

Properties

Name Meaning
Network The Stellar network to use: either Mainnet or Testnet.
Asset A Contract address of the first token in the liquidity pool.
Asset B Contract address of the second token in the liquidity pool.
Liquidity Amount of LP tokens to remove from the pool, specified as a BigInt string.

Output

The output JSON contains the response from the Soroswap SDK's removeLiquidity method. This typically includes details about the transaction or confirmation of liquidity removal, such as amounts of underlying assets returned or transaction identifiers.

If the node supports binary data output (not explicitly shown here), it would represent any raw transaction data or signed transaction payloads related to the liquidity removal process.

Dependencies

  • Requires an API key credential for Soroswap's service.
  • Uses the Soroswap SDK (@soroswap/sdk) to interact with the Soroswap DEX.
  • Needs network configuration (Mainnet or Testnet).
  • Requires proper setup of the API base URL and authentication via credentials in n8n.

Troubleshooting

  • Common issues:

    • Incorrect or missing asset contract addresses can cause failures in identifying the correct liquidity pool.
    • Providing an invalid or insufficient LP token amount may result in errors or failed transactions.
    • Network mismatch (e.g., using Mainnet credentials on Testnet) can lead to unexpected errors.
    • Missing or invalid API key credential will prevent successful API calls.
  • Error messages:

    • "Unknown operation": Indicates the operation parameter was not recognized; ensure "Remove Liquidity" is selected.
    • Errors related to BigInt conversion: Ensure liquidity amounts are valid numeric strings representing integers.
    • API errors from Soroswap: Check API key validity, network selection, and asset addresses.

To resolve these, verify input parameters carefully, confirm credentials, and ensure the network setting matches the intended environment.

Links and References

Discussion