Installation
npm install @quickscope/sdk
Usage
Initialization
First, initialize the Quickscope
class with your location ("frankfurt"
or "nyc"
) and your API key:
import Quickscope from '@quickscope/sdk';
// OR
const Quickscope = require('@quickscope/sdk');
const quickscope = new Quickscope("frankfurt", "your-api-key");
Method: getPools
getPools
Description
The getPools
method retrieves a list of liquidity pools available for a given token pair on Solana. Each pool includes provider information, pool UUID, fee structure, and the mint addresses it supports. Use this method to identify pools for quoting, swapping, or building custom routing logic.
Parameters
{
mint_a: string;
mint_b: string;
}
- mint_a: (string) – The mint address of the first token in the pair.
- mint_b:: (string) – The mint address of the second token in the pair.
Note: The order of
mint_a
andmint_b
does not matter.
Returns
Promise<poolResponse[]>
: A promise that resolves to an array of pool objects matching the provided token pair.
poolResponse
Type
poolResponse
Typeexport type poolResponse = {
uuid: string;
provider: string;
fee_basis_points: number;
mint_a_address: string;
mint_b_address: string;
}
Example
async function fetchPools() {
try {
const pools = await quickscope.v1.info.getPools({
mint_a: 'So11111111111111111111111111111111111111112', // SOL
mint_b: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' // USDC
});
console.log('Available pools:', pools);
// Example output:
// [
// {
// uuid: "b98c123d-456e-789f-abcd-ef0123456789",
// provider: "orca",
// fee_basis_points: 30,
// mint_a_address: "So11111111111111111111111111111111111111112",
// mint_b_address: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
// },
// ...
// ]
} catch (error) {
console.error('Error fetching pools:', error);
}
}
fetchPools();
Error Handling
The method will throw an error if the token pair is invalid or unsupported. This could occur if:
- One or both mints are incorrect or delisted
- No active liquidity pools exist for the pair
- The API encounters a network or internal error
Always wrap the method in a try/catch
block for reliable error handling.