Skip to main content

Query a Single Pool

Within the wallet API, liquidity pools are identified by a unique numeric ID or the address of the receipt token. Providing the numeric ID will result in generally better performance.

Endpoint

GET https://wallets.nodefinance.org/pools/{id}

Query Parameters

  • wallet (optional): A string representing the wallet address to filter the results by.

Response

The response will be a JSON object with the following shape:

{
_type: "SNX" | "LG3";
category: "stable" | "volatile";
name: string;
id: number;
underlying: Token[];
receiptToken: Token;
chainId: number;
protocol: number;
apr: number;
totalDeposited: {
amount: number;
valueInLocalCurrency: number;
}
}

Example

Here is an example of how you can query this endpoint using curl:

curl "https://wallets.nodefinance.org/pools/12345?wallet=0x1234567890abcdef"

This will send a GET request to the endpoint with the wallet query parameter set to 0x1234567890abcdef. If the request is successful, the response will be a JSON object with information about the pool with ID 12345 and the specified wallet address.

Error Handling

If the request is unsuccessful, the endpoint will return a JSON object with an error field containing a description of the error. Some possible error messages are:

  • Pool not found: The pool with the specified ID does not exist.
  • Invalid wallet address: The wallet address provided is not a valid Ethereum address.
  • Internal server error: An internal server error occurred while processing the request.

Notes

  • The wallet query parameter is optional and can be omitted if you do not want to filter the results by wallet address.
  • The depositToken and receiptToken fields contain information about the tokens used for deposits and receipts, respectively. These fields are objects with the following shape:
{
symbol: string;
name: string;
decimals: number;
address: string;
}