Skip to main content

Stash API quick start

tip

Request your Stash API key via Sprinter Stash Request or contacting support@sprinter.tech

As a Solver

Sprinter Stash enables solvers to borrow liquidity crosschain on-demand to execute user intents without needing pre-funded inventory.

This guide covers:

  1. Recap of the Stash Fill Lifecycle
  2. Requesting a Borrow Cost Estimate
  3. Requesting a Final Borrow Quote and Liquidity Authorization

1. Stash Fill Lifecycle

2. Request a Borrow Cost Estimate (Optional)

Call the Borrow Cost API to preview an estimated borrowing cost) for a potential fill before requesting liquidity.

Fetch Borrow Cost Estimate
const protocol = "across"; // Example: "across", "uniswapx"
const type = "swap"; // Example: "swap", "bridge"

const response = await fetch(
`https://api.sprinter.tech/v1/liquidity/protocol/${protocol}/type/${type}/quote`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
"X-API-Key": "<your_api_key>",
},
},
);

const costEstimate = await response.json();
console.log("Borrow Cost Estimate:", costEstimate);

3. Request a Final Borrow Quote

If the estimated cost is acceptable, call the Borrow Quote API to request a borrow quote to reserve liquidity and authorize the fill.

Request Final Borrow Quote
const protocol = "across";
const txHash = "0xabc123"; // Related transaction hash

const response = await fetch(
`https://api.sprinter.tech/v1/liquidity/protocol/${protocol}/deposit/${txHash}/request`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
"X-API-Key": "<your_api_key>",
},
},
);

const borrowQuote = await response.json();
console.log("Borrow Quote:", borrowQuote);