Actions12
Overview
This node integrates with the Soroswap decentralized exchange (DEX) on the Stellar network, enabling users to interact programmatically with various liquidity and trading features. Specifically, the "Get Pool by Tokens" operation retrieves information about a liquidity pool that exists for a specific pair of tokens across selected protocols.
Common scenarios where this node is beneficial include:
- DeFi traders or developers who want to fetch details about liquidity pools for token pairs before executing swaps or liquidity operations.
- Portfolio managers or analytics tools needing up-to-date pool data for price discovery or risk assessment.
- Automated strategies that require querying multiple protocols to find the best liquidity pools for given token pairs.
Practical example:
- A user wants to find the liquidity pool details for two tokens (e.g., USDC and XLM) on the Mainnet using the Soroswap and Phoenix protocols. This node will query those protocols and return the pool data, which can then be used to make informed trading or liquidity decisions.
Properties
| Name | Meaning |
|---|---|
| Network | The blockchain network to use: Mainnet or Testnet. |
| Protocols | One or more protocols to query for the pool. Options: Soroswap, Phoenix, Aqua, SDEX. |
| Asset A | Contract address of the first token in the pair. |
| Asset B | Contract address of the second token in the pair. |
Output
The output is a JSON object containing the pool information for the specified token pair from the selected protocols. The exact structure depends on the response from the Soroswap SDK but typically includes details such as:
- Pool identifiers
- Token reserves or balances
- Liquidity metrics
- Protocol-specific metadata
Each output item corresponds to an input item and is paired accordingly.
The node does not output binary data for this operation.
Dependencies
- Requires an API key credential for the Soroswap service.
- Uses the Soroswap SDK library to interact with the Soroswap DEX APIs.
- Needs network connectivity to the Soroswap API endpoint configured via credentials.
- No additional environment variables are explicitly required beyond the API key and base URL provided in credentials.
Troubleshooting
Common issues:
- Invalid or missing token contract addresses may cause the API to return errors or empty results.
- Selecting unsupported or misspelled protocols could lead to no data being returned.
- Network misconfiguration (e.g., wrong network selection between Mainnet and Testnet) might result in no matching pools found.
- API key issues such as expired or invalid keys will cause authentication failures.
Error messages:
"Unknown operation: getPoolByTokens": Indicates the operation parameter was incorrectly set; ensure it matches exactly.- API errors related to invalid tokens or protocols will be returned in the JSON error field if "Continue On Fail" is enabled.
- Network or timeout errors should be checked by verifying API endpoint accessibility and credentials.
To resolve errors:
- Double-check token contract addresses for correctness.
- Verify protocol names against the allowed options.
- Confirm API key validity and permissions.
- Ensure the correct network is selected matching the tokens' deployment.
Links and References
- Soroswap Official Website
- Stellar Network Documentation
- Soroswap SDK GitHub Repository (for detailed API and usage)
- n8n Documentation (for general node usage and credential setup)