Skip to content

Commit 217be20

Browse files
itsbobbyzzz168MakMufticBeroBurny
authored
feat: staging changes to docs (#146)
Final Updates to Draft. Good to release! --------- Co-authored-by: MakMuftic <[email protected]> Co-authored-by: BeroBurny <[email protected]>
1 parent 64651db commit 217be20

File tree

68 files changed

+9534
-3512
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+9534
-3512
lines changed

docs/CHANGELOG.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,31 @@
22

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

5-
65
### Bug Fixes
76

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

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

12-
1311
### Bug Fixes
1412

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

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

19-
2017
### Bug Fixes
2118

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

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

26-
2723
### Features
2824

29-
* 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)
30-
25+
- 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)
3126

3227
### Bug Fixes
3328

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

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

docs/_temp/sprinterNameService.abi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,4 @@
230230
"stateMutability": "nonpayable",
231231
"type": "function"
232232
}
233-
]
233+
]

docs/docs/01-introduction/01-introduction.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,34 @@ sidebar_position: 1
66
---
77

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

13-
# Welcome To The Sprinter Docs
13+
#
1414

15-
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.
15+
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.
1616

17-
## What's Next
17+
# What is Sprinter?
1818

19-
- If you're new to Sprinter, begin with [Quick Start](../02-quick-start.md).
20-
- Explore detailed examples and advanced usage in the [SDK Documentation](../sdk).
19+
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.
2120

22-
Stay tuned for the complete source code.
21+
## Sprinter’s Core Products
2322

24-
## Need Assistance?
23+
### [Sprinter Stash](Stash)
2524

26-
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]).
25+
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.
26+
27+
### [Sprinter Solve](Solve)
28+
29+
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.
30+
31+
## Need to chat to us?
32+
33+
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]).
34+
35+
### Join our Community
36+
37+
- **Telegram:** [t.me/sprinter_tech](https://t.me/sprinter_tech)
38+
- **X:** [@sprinter_ux](https://x.com/sprinter_ux)
39+
- **Website:** [sprinter.tech](https://sprinter.tech)

docs/docs/01-introduction/02-key-features.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

docs/docs/01-introduction/03-flow.md

Lines changed: 0 additions & 57 deletions
This file was deleted.

docs/docs/01-introduction/04-supported-networks.md

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "../../..",
5+
},
6+
{
7+
"path": "../../..",
8+
},
9+
],
10+
}
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
---
2+
id: use-stash
3+
title: Stash API quick start
4+
sidebar_position: 1
5+
---
6+
7+
:::tip
8+
Request your Stash API key via [Sprinter Stash Request](https://forms.gle/kgpcQK722Ley2gke7) or contacting [email protected]
9+
:::
10+
11+
## As a Solver
12+
13+
Sprinter Stash enables solvers to **borrow crosschain credit on-demand** to execute user intents without needing pre-funded inventory.
14+
15+
This guide covers:
16+
17+
1. Recap of the [Stash Fill Lifecycle](use-stash#1-stash-solver-fill-lifecycle)
18+
2. Requesting a [Credit Borrow Cost Estimate](use-stash#2-request-a-borrow-cost-estimate-optional)
19+
3. Requesting a [Final Borrow Quote and Credit Authorization](use-stash#3-request-a-final-borrow-quote)
20+
4. Check out the [Fill Optimization Tips](use-stash#4-fill-optimization-tips)
21+
22+
### 1. Stash Fill Lifecycle
23+
24+
<div style={{ display: "flex", justifyContent: "center" }}>
25+
26+
```mermaid
27+
flowchart TD
28+
A[Solver Detects User Intent] --> B[2 - Solver Previews estimated borrowing cost of credit /request]
29+
B --> C[Receive Borrow Cost Estimate]
30+
C --> D{Fill using Stash Credit?}
31+
D -- Yes --> E[3 - Solver Reserves credit and authorize the fill]
32+
D -- No --> F[Abort Fill]
33+
E --> G[Solver Borrow Liquidity from Sprinter Stash]
34+
G --> H[Stash Executes Cross-Chain Swap/Bridge Execution /quote]
35+
H --> I[Intent Protocol Repays Borrowed Credit + Costs]
36+
I --> J[Fill Complete]
37+
38+
click B "use-stash#2-request-a-borrow-cost-estimate-optional" "Borrow Cost"
39+
style B fill:#FF9B43,stroke:#333,stroke-width:2px,color:#000,font-weight:bold
40+
41+
click E "use-stash#3-request-a-final-borrow-quote" "Borrow Quote"
42+
style E fill:#FF9B43,stroke:#333,stroke-width:2px,color:#000,font-weight:bold
43+
44+
```
45+
46+
</div>
47+
48+
### 2. Request a Credit Borrow Cost Estimate (Optional)
49+
50+
Call the [**Borrow Cost API**](borrow-cost-api) to preview an estimated borrowing cost for a potential fill before requesting credit.
51+
52+
```ts title="Fetch Borrow Cost Estimate Example Payload"
53+
const baseUrl = "https://api.sprinter.tech";
54+
const destChainId = "eip155:8453"; // eip155:8453(Base), eip155:10 (Optimism), eip155:42161 (Arbitrum) destChainId must use capid format from our configuration
55+
const protocol = "across"; // "across" or "mayan"
56+
const txHash = "string"; // Source chain deposit TX
57+
const response = await fetch(
58+
`${baseUrl}/liquidity/chain/${destChainId}/protocol/${protocol}/deposit/${txHash}/requests`,
59+
{
60+
method: "GET",
61+
headers: {
62+
"X-Auth-Token": "<your_api_key>",
63+
},
64+
body: {
65+
input: callData, // encoded callData of deposit
66+
caller: "address", // the address that will execute the borrow and fill ond destChainId
67+
},
68+
},
69+
);
70+
```
71+
72+
### 3. Request a Final Borrow Quote
73+
74+
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.
75+
76+
```ts title="Request Final Borrow Quote with type ExactInput (input amount - borrow costs)"
77+
const baseUrl = "https://api.sprinter.tech";
78+
const sourceChainId = "eip155:8453"; // eip155:8453(Base), eip155:10 (Optimism), eip155:42161 (Arbitrum). ChainId must use capid format from our configuration
79+
const protocol = "across"; // "across" or "mayan"
80+
const type = "ExactInput"; // Request will consider the amount as (input amount - borrow costs)
81+
const amount = 10000000; // This is the ExactInput eg 1 USDC (6 decimals)
82+
const response = await fetch(
83+
`${baseUrl}/liquidity/chain/${sourceChainId}/protocol/${protocol}/type/${type}/quote`,
84+
{
85+
method: "GET",
86+
headers: {
87+
"X-Auth-Token": "<your_api_key>",
88+
},
89+
body: {
90+
amount: amount,
91+
token: "destination_token_address", // Token address
92+
network: "eip155:10", // Destination_Chain_ID
93+
},
94+
},
95+
);
96+
97+
const borrowQuote = await response.json();
98+
console.log("Expected amount:", borrowQuote.expectedOutput);
99+
console.log("Borrow Cost:", borrowQuote.borrowCost);
100+
```
101+
102+
```ts title="Request Final Borrow Quote with type ExactOutput (output amount + borrow costs)"
103+
const baseUrl = "https://api.sprinter.tech";
104+
const sourceChainId = "eip155:8453"; // eip155:8453(Base), eip155:10 (Optimism), eip155:42161 (Arbitrum). ChainId must use capid format from our configuration
105+
const protocol = "across"; // "across" or "mayan"
106+
const type = "ExactOutput"; // Request will consider the amount as (output amount + borrow costs)
107+
const amount = 10000000; // This is the ExactInput eg 1 USDC (6 decimals)
108+
const response = await fetch(
109+
`${baseUrl}/liquidity/chain/${sourceChainId}/protocol/${protocol}/type/${type}/quote`,
110+
{
111+
method: "GET",
112+
headers: {
113+
"X-Auth-Token": "<your_api_key>",
114+
},
115+
body: {
116+
amount: amount,
117+
token: "destination_token_address", // Token address
118+
network: "eip155:10", // Destination_Chiain_ID
119+
},
120+
},
121+
);
122+
123+
const borrowQuote = await response.json();
124+
console.log("Expected Input:", borrowQuote.requiredInput);
125+
console.log("Borrow Cost:", borrowQuote.borrowCost);
126+
```
127+
128+
### 4. Fill Optimization Tips
129+
130+
Here are some tips on getting the best performance and profit from your Sprinter Stash integration:
131+
132+
1. **Pre-fetch Borrow Cost** - Call `GET /type/{type}/quote` as early as possible (when detecting intents) to evaluate solver profitability.
133+
134+
2. **Batch Gas Where Possible** - Bundle execution and repayment transactions to reduce gas costs.
135+
136+
3. **Optimize for Slippage** - Query quotes close to execution time to reduce stale pricing or slippage-induced fills.
137+
138+
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].
139+
140+
5. **Validate Transaction Hash Early** - Ensure the user intent transaction is final and not reverted before calling `/deposit/{txHash}/request`.

0 commit comments

Comments
 (0)