Stash API quick start
Request your Stash API key via Sprinter Stash Request or contacting support@sprinter.tech
As a Solver
Sprinter Stash enables solvers to borrow credit crosschain on-demand to execute user intents without needing pre-funded inventory.
This guide covers:
- Recap of the Stash Solver Fill Lifecycle
- Requesting a Credit Borrow Cost Estimate
- Requesting a Final Borrow Quote and Credit Authorization
- Check out the Fill Optimization Tips
1. Stash Solver Fill Lifecycle
2. Request a Credit Borrow Cost Estimate (Optional)
Call the Borrow Cost API to preview an estimated borrowing cost for a potential fill before requesting credit.
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 credit and authorize the fill.
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);
4. Fill Optimization Tips
Here are some tips on getting the best performance and profit from your Sprinter Stash integration:
-
Pre-fetch Borrow Cost - Call
GET /type/{type}/quote
as early as possible (when detecting intents) to evaluate solver profitability. -
Batch Gas Where Possible - Bundle execution and repayment transactions to reduce gas costs.
-
Optimize for Slippage - Query quotes close to execution time to reduce stale pricing or slippage-induced fills.
-
Handling Rate Limits - If you hit 429s, give it a moment and retry using retry_after value. You can request higher limits via support@sprinter.tech.
-
Validate Transaction Hash Early - Ensure the user intent transaction is final and not reverted before calling
/deposit/{txHash}/request
.