Skip to content

feat: staging changes to docs #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,31 @@

## [0.1.3](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.1.2...docs-v0.1.3) (2025-01-22)


### Bug Fixes

* release ([20f30b0](https://github.com/sprintertech/sprinter-sdk/commit/20f30b0ed2a6b8410650beb6825346e79b38eb8b))
- release ([20f30b0](https://github.com/sprintertech/sprinter-sdk/commit/20f30b0ed2a6b8410650beb6825346e79b38eb8b))

## [0.1.2](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.1.1...docs-v0.1.2) (2025-01-21)


### Bug Fixes

* release `1.3.0` v2 ([71959d1](https://github.com/sprintertech/sprinter-sdk/commit/71959d1d8b5583fb27a36826415d5f7fe8ab9581))
- release `1.3.0` v2 ([71959d1](https://github.com/sprintertech/sprinter-sdk/commit/71959d1d8b5583fb27a36826415d5f7fe8ab9581))

## [0.1.1](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.1.0...docs-v0.1.1) (2025-01-21)


### Bug Fixes

* release `1.3.0` ([aaa6938](https://github.com/sprintertech/sprinter-sdk/commit/aaa69388e4910f92d53fe14ea08785cd63ef4176))
- release `1.3.0` ([aaa6938](https://github.com/sprintertech/sprinter-sdk/commit/aaa69388e4910f92d53fe14ea08785cd63ef4176))

## [0.1.0](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.0.1...docs-v0.1.0) (2025-01-21)


### Features

* Add sweep function ([#115](https://github.com/sprintertech/sprinter-sdk/issues/115)) ([efaaa2b](https://github.com/sprintertech/sprinter-sdk/commit/efaaa2b3d8674e46b264caddcd373218c3f552c1)), closes [#110](https://github.com/sprintertech/sprinter-sdk/issues/110)

- Add sweep function ([#115](https://github.com/sprintertech/sprinter-sdk/issues/115)) ([efaaa2b](https://github.com/sprintertech/sprinter-sdk/commit/efaaa2b3d8674e46b264caddcd373218c3f552c1)), closes [#110](https://github.com/sprintertech/sprinter-sdk/issues/110)

### Bug Fixes

* `package.json` - repository ([#127](https://github.com/sprintertech/sprinter-sdk/issues/127)) ([21c7007](https://github.com/sprintertech/sprinter-sdk/commit/21c70077d2e5ef83730f730990e849f8d54ec8c0))
- `package.json` - repository ([#127](https://github.com/sprintertech/sprinter-sdk/issues/127)) ([21c7007](https://github.com/sprintertech/sprinter-sdk/commit/21c70077d2e5ef83730f730990e849f8d54ec8c0))

## [1.0.0](https://github.com/ChainSafe/sprinter-ts/compare/docs-v0.0.1...docs-v1.0.0) (2025-01-13)

Expand Down
2 changes: 1 addition & 1 deletion docs/_temp/sprinterNameService.abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,4 @@
"stateMutability": "nonpayable",
"type": "function"
}
]
]
33 changes: 23 additions & 10 deletions docs/docs/01-introduction/01-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,34 @@ sidebar_position: 1
---

<div class="logo-container">
<img src="/img/Sprinter_Logo_Horizontal_BLACK.png" class="logo-light-mode" alt="Sprinter Logo Black" />
<img src="/img/Sprinter_Logo_Horizontal-WHITE.png" class="logo-dark-mode" alt="Sprinter Logo White" />
<img src="/img/sprinter-header.png" class="logo-light-mode" alt="Sprinter Logo Black" />
<img src="/img/sprinter-header.png" class="logo-dark-mode" alt="Sprinter Logo White" />
</div>

# Welcome To The Sprinter Docs
#

Sprinter is a **fast, smooth, interoperable intent execution engine**. Our aim is to make multichain interactions feel like one. In doing so, we enhance cross-chain UX _for all_ as a first-class citizen in both existing and upcoming web3 technologies.
Sprinter envisions a decentralized, open and equitable financial system that provides opportunities for everyone. Our mission is to build the infrastructure that democratizes access to cross-chain liquidity and optimizes liquidity flows across DeFi.

## What's Next
# What is Sprinter?

- If you're new to Sprinter, begin with [Quick Start](../02-quick-start.md).
- Explore detailed examples and advanced usage in the [SDK Documentation](../sdk).
Sprinter combines solving-as-a-service infrastructure with credit-based cross-chain liquidity. It enables solvers to borrow and execute on-chain actions without pre-funded inventory, while giving dApps and protocols access to best-in-class execution routes, powered by the Project Blanc advanced solving technology.

Stay tuned for the complete source code.
## Sprinter’s Core Products

## Need Assistance?
### [Sprinter Stash](Stash)

If you have questions about Sprinter, the code, the docs, or have a business inquiry, please reach out to us on [Discord](https://discord.gg/Qdf6GyNB5J) or via email at [[email protected]](mailto:[email protected]).
A crosschain credit protocol providing liquidity access to solvers and market makers without requiring collateral. Liquidity providers deposit USDC into the protocol, earning returns through solver fees and passive yield strategies.

### [Sprinter Solve](Solve)

A solving-as-a-service platform that offers a request-for-quote (RFQ) based swap API for our partners. It enables dApps, wallets, and protocols to improve execution quality, optimize pricing, and enhance user experience.

## Need to chat to us?

If you have questions about Sprinter, the code, the docs, or have a partnership inquiry, please reach out to us on [Telegram](https://t.me/sprinter_tech/1) or via email at [[email protected]](mailto:[email protected]).

### Join our Community

- **Telegram:** [t.me/sprinter_tech](https://t.me/sprinter_tech)
- **X:** [@sprinter_ux](https://x.com/sprinter_ux)
- **Website:** [sprinter.tech](https://sprinter.tech)
39 changes: 0 additions & 39 deletions docs/docs/01-introduction/02-key-features.md

This file was deleted.

57 changes: 0 additions & 57 deletions docs/docs/01-introduction/03-flow.md

This file was deleted.

29 changes: 0 additions & 29 deletions docs/docs/01-introduction/04-supported-networks.md

This file was deleted.

10 changes: 10 additions & 0 deletions docs/docs/01-introduction/Sprinter DOCS.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"folders": [
{
"path": "../../..",
},
{
"path": "../../..",
},
],
}
140 changes: 140 additions & 0 deletions docs/docs/02-Stash/01-utilizing-stash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
id: use-stash
title: Stash API quick start
sidebar_position: 1
---

:::tip
Request your Stash API key via [Sprinter Stash Request](https://forms.gle/kgpcQK722Ley2gke7) or contacting [email protected]
:::

## As a Solver

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

This guide covers:

1. Recap of the [Stash Fill Lifecycle](use-stash#1-stash-solver-fill-lifecycle)
2. Requesting a [Credit Borrow Cost Estimate](use-stash#2-request-a-borrow-cost-estimate-optional)
3. Requesting a [Final Borrow Quote and Credit Authorization](use-stash#3-request-a-final-borrow-quote)
4. Check out the [Fill Optimization Tips](use-stash#4-fill-optimization-tips)

### 1. Stash Fill Lifecycle

<div style={{ display: "flex", justifyContent: "center" }}>

```mermaid
flowchart TD
A[Solver Detects User Intent] --> B[2 - Solver Previews estimated borrowing cost of credit /request]
B --> C[Receive Borrow Cost Estimate]
C --> D{Fill using Stash Credit?}
D -- Yes --> E[3 - Solver Reserves credit and authorize the fill]
D -- No --> F[Abort Fill]
E --> G[Solver Borrow Liquidity from Sprinter Stash]
G --> H[Stash Executes Cross-Chain Swap/Bridge Execution /quote]
H --> I[Intent Protocol Repays Borrowed Credit + Costs]
I --> J[Fill Complete]

click B "use-stash#2-request-a-borrow-cost-estimate-optional" "Borrow Cost"
style B fill:#FF9B43,stroke:#333,stroke-width:2px,color:#000,font-weight:bold

click E "use-stash#3-request-a-final-borrow-quote" "Borrow Quote"
style E fill:#FF9B43,stroke:#333,stroke-width:2px,color:#000,font-weight:bold

```

</div>

### 2. Request a Credit Borrow Cost Estimate (Optional)

Call the [**Borrow Cost API**](borrow-cost-api) to preview an estimated borrowing cost for a potential fill before requesting credit.

```ts title="Fetch Borrow Cost Estimate Example Payload"
const baseUrl = "https://api.sprinter.tech";
const destChainId = "eip155:8453"; // eip155:8453(Base), eip155:10 (Optimism), eip155:42161 (Arbitrum) destChainId must use capid format from our configuration
const protocol = "across"; // "across" or "mayan"
const txHash = "string"; // Source chain deposit TX
const response = await fetch(
`${baseUrl}/liquidity/chain/${destChainId}/protocol/${protocol}/deposit/${txHash}/requests`,
{
method: "GET",
headers: {
"X-Auth-Token": "<your_api_key>",
},
body: {
input: callData, // encoded callData of deposit
caller: "address", // the address that will execute the borrow and fill ond destChainId
},
},
);
```

### 3. Request a Final Borrow Quote

If proceeding to fill with Sprinter Stash, call the [**Borrow Quote API**](borrow-quote-api) to request a borrow quote to reserve credit and authorize the fill. This can be based on input or output amount.

```ts title="Request Final Borrow Quote with type ExactInput (input amount - borrow costs)"
const baseUrl = "https://api.sprinter.tech";
const sourceChainId = "eip155:8453"; // eip155:8453(Base), eip155:10 (Optimism), eip155:42161 (Arbitrum). ChainId must use capid format from our configuration
const protocol = "across"; // "across" or "mayan"
const type = "ExactInput"; // Request will consider the amount as (input amount - borrow costs)
const amount = 10000000; // This is the ExactInput eg 1 USDC (6 decimals)
const response = await fetch(
`${baseUrl}/liquidity/chain/${sourceChainId}/protocol/${protocol}/type/${type}/quote`,
{
method: "GET",
headers: {
"X-Auth-Token": "<your_api_key>",
},
body: {
amount: amount,
token: "destination_token_address", // Token address
network: "eip155:10", // Destination_Chain_ID
},
},
);

const borrowQuote = await response.json();
console.log("Expected amount:", borrowQuote.expectedOutput);
console.log("Borrow Cost:", borrowQuote.borrowCost);
```

```ts title="Request Final Borrow Quote with type ExactOutput (output amount + borrow costs)"
const baseUrl = "https://api.sprinter.tech";
const sourceChainId = "eip155:8453"; // eip155:8453(Base), eip155:10 (Optimism), eip155:42161 (Arbitrum). ChainId must use capid format from our configuration
const protocol = "across"; // "across" or "mayan"
const type = "ExactOutput"; // Request will consider the amount as (output amount + borrow costs)
const amount = 10000000; // This is the ExactInput eg 1 USDC (6 decimals)
const response = await fetch(
`${baseUrl}/liquidity/chain/${sourceChainId}/protocol/${protocol}/type/${type}/quote`,
{
method: "GET",
headers: {
"X-Auth-Token": "<your_api_key>",
},
body: {
amount: amount,
token: "destination_token_address", // Token address
network: "eip155:10", // Destination_Chiain_ID
},
},
);

const borrowQuote = await response.json();
console.log("Expected Input:", borrowQuote.requiredInput);
console.log("Borrow Cost:", borrowQuote.borrowCost);
```

### 4. Fill Optimization Tips

Here are some tips on getting the best performance and profit from your Sprinter Stash integration:

1. **Pre-fetch Borrow Cost** - Call `GET /type/{type}/quote` as early as possible (when detecting intents) to evaluate solver profitability.

2. **Batch Gas Where Possible** - Bundle execution and repayment transactions to reduce gas costs.

3. **Optimize for Slippage** - Query quotes close to execution time to reduce stale pricing or slippage-induced fills.

4. **Handling Rate Limits** - If you hit 429s, give it a moment and retry using retry_after value. You can request higher limits via [email protected].

5. **Validate Transaction Hash Early** - Ensure the user intent transaction is final and not reverted before calling `/deposit/{txHash}/request`.
Loading