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 programmatically with various Soroswap features. The "Get Quote" operation specifically provides trading quotes for token swaps between two assets on the selected network (Mainnet or Testnet). This is useful for applications that need to estimate swap rates before executing trades, such as portfolio management tools, trading bots, or DeFi dashboards.

Practical examples include:

  • Fetching a quote to determine how much of token B you will receive when swapping a certain amount of token A.
  • Comparing quotes across multiple protocols supported by Soroswap to find the best price.
  • Integrating real-time price quotes into automated trading workflows.

Properties

Name Meaning
Network Network to use for the operation; options: Mainnet, Testnet
Asset In Source token contract address (the token you want to swap from)
Asset Out Destination token contract address (the token you want to receive)
Amount Amount to trade, provided as a string but converted internally to a BigInt
Trade Type Type of trade; options: Exact In (fixed input amount), Exact Out (fixed output amount)
Protocols One or more protocols to use for the operation; options: Soroswap, Phoenix, Aqua, SDEX

Output

The output JSON contains the quote details returned by the Soroswap SDK's quote method. This typically includes information such as:

  • Estimated amounts for input and output tokens
  • Price impact
  • Fees
  • Selected protocol(s) for the swap
  • Other metadata relevant to the trade quote

The exact structure depends on the Soroswap SDK response but generally provides all necessary data to understand the expected outcome of the swap.

This node does not output binary data.

Dependencies

  • Requires an API key credential for authenticating with the Soroswap SDK service.
  • Uses the Soroswap SDK (@soroswap/sdk) to perform operations.
  • Needs network selection (Mainnet or Testnet) to target the correct blockchain environment.

Troubleshooting

  • Common issues:

    • Invalid or missing API key credential will cause authentication failures.
    • Incorrect token contract addresses may result in errors or empty quotes.
    • Providing non-numeric or improperly formatted amounts can cause conversion errors.
    • Selecting unsupported protocols or networks may lead to failed requests.
  • Error messages:

    • "Unknown operation": Occurs if an unsupported operation name is used; ensure "quote" is selected.
    • Errors related to BigInt conversion: Verify that the "Amount" property is a valid numeric string.
    • Network-related errors: Confirm network selection matches the intended environment and that the API endpoint is reachable.
  • Resolution tips:

    • Double-check all input parameters for correctness.
    • Ensure the API key credential is properly configured in n8n.
    • Use test values on Testnet before switching to Mainnet.
    • Enable "Continue On Fail" in the node settings to handle errors gracefully during batch processing.

Links and References

Discussion