Actions12
Overview
The node integrates with Soroswap, a decentralized exchange (DEX) on the Stellar network, enabling users to perform various liquidity and trading operations. Specifically, the "Add Liquidity" operation allows users to add token pairs to a liquidity pool, which is essential for facilitating decentralized trading and earning fees.
This node is beneficial in scenarios where users want to:
- Provide liquidity to Soroswap pools by depositing two tokens.
- Participate in decentralized finance (DeFi) activities on Stellar.
- Automate liquidity management workflows within n8n.
Example use case:
A user wants to add liquidity to a pool consisting of two specific tokens on the Stellar mainnet. They specify the token contract addresses and amounts, and the node constructs and sends the appropriate transaction to Soroswap.
Properties
| Name | Meaning |
|---|---|
| Network | Selects the Stellar network to operate on: "Mainnet" or "Testnet". |
| Asset A | Contract address of the first token in the liquidity pair. |
| Asset B | Contract address of the second token in the liquidity pair. |
| Amount A | Amount of the first token to add to the liquidity pool, expressed as a BigInt string. |
| Amount B | Amount of the second token to add to the liquidity pool, expressed as a BigInt string. |
Output
The node outputs a JSON object containing the response from the Soroswap SDK's addLiquidity method. This typically includes details about the liquidity addition transaction such as transaction identifiers, status, and any relevant metadata returned by the Soroswap API.
If an error occurs during execution, the output JSON will contain an error field with the error message.
The node does not output binary data.
Dependencies
- Requires an API key credential for Soroswap's API.
- Uses the Soroswap SDK (
@soroswap/sdk) to interact with the Soroswap DEX. - Needs network configuration (Mainnet or Testnet) to target the correct blockchain environment.
Troubleshooting
Common issues:
- Incorrect or missing API key credential will cause authentication failures.
- Invalid token contract addresses or amounts may result in errors from the Soroswap API.
- Network mismatch (e.g., using Mainnet credentials on Testnet) can cause transaction failures.
Error messages:
"Unknown operation": Indicates an unsupported operation was selected; ensure "Add Liquidity" is chosen.- API errors returned from Soroswap are passed through; check the error message for details like invalid parameters or insufficient funds.
- If the node is set to continue on fail, errors will be included in the output JSON under the
errorproperty.
Links and References
- Soroswap Documentation (for detailed API and SDK usage)
- Stellar Network
- n8n Documentation