You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/02-Stash/01-utilizing-stash.md
+35-34Lines changed: 35 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,8 @@ Sprinter Stash enables solvers to **borrow crosschain credit on-demand** to exec
15
15
This guide covers:
16
16
17
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)
18
+
2. Requesting a [Credit Borrow Quote Estimate](use-stash#2-request-a-credit-borrow-quote-estimate-optional)
19
+
3. Requesting a [Final Borrow Cost and Credit Authorization](use-stash#3-request-the-final-credit-borrow-cost)
20
20
4. Check out the [Fill Optimization Tips](use-stash#4-fill-optimization-tips)
21
21
22
22
### 1. Stash Fill Lifecycle
@@ -25,13 +25,13 @@ This guide covers:
25
25
26
26
```mermaid
27
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]
28
+
A[Solver Detects User Intent] --> B[2 - Solver Previews estimated borrowing /quote of credit]
29
+
B --> C[Receive Borrow Quote Estimate]
30
30
C --> D{Fill using Stash Credit?}
31
-
D -- Yes --> E[3 - Solver Reserves credit and authorize the fill]
31
+
D -- Yes --> E[3 - Solver Reserves credit and authorize the fill /cost]
32
32
D -- No --> F[Abort Fill]
33
33
E --> G[Solver Borrow Liquidity from Sprinter Stash]
34
-
G --> H[Stash Executes Cross-Chain Swap/Bridge Execution /quote]
34
+
G --> H[Stash Executes Cross-Chain Swap/Bridge Execution /request]
35
35
H --> I[Intent Protocol Repays Borrowed Credit + Costs]
36
36
I --> J[Fill Complete]
37
37
@@ -45,35 +45,11 @@ style E fill:#FF9B43,stroke:#333,stroke-width:2px,color:#000,font-weight:bold
45
45
46
46
</div>
47
47
48
-
### 2. Request a Credit Borrow Cost Estimate (Optional)
48
+
### 2. Request a Credit Borrow Quote Estimate (Optional)
49
49
50
-
Call the [**Borrow Cost API**](borrow-cost-api) to preview an estimated borrowing cost for a potential fill before requesting credit.
50
+
Call the [**Borrow Quote API**](borrow-quote-api) to preview an estimated borrowing cost for a potential fill before requesting credit. This can be based on input or output amount.
51
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
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)"
52
+
```ts title="Request Borrow Quote Estimate with type ExactInput (input amount - borrow costs)"
77
53
const baseUrl ="https://api.sprinter.tech";
78
54
const sourceChainId ="eip155:8453"; // eip155:8453(Base), eip155:10 (Optimism), eip155:42161 (Arbitrum). ChainId must use capid format from our configuration
```ts title="Request Final Borrow Quote with type ExactOutput (output amount + borrow costs)"
78
+
```ts title="Request Final Borrow Quote Estimate with type ExactOutput (output amount + borrow costs)"
103
79
const baseUrl ="https://api.sprinter.tech";
104
80
const sourceChainId ="eip155:8453"; // eip155:8453(Base), eip155:10 (Optimism), eip155:42161 (Arbitrum). ChainId must use capid format from our configuration
If proceeding to fill with Sprinter Stash, call the [**Borrow Cost API**](borrow-cost-api) to request the final borrow cost to reserve credit and authorize the fill.
108
+
109
+
```ts title="Fetch Borrow Cost Example Payload"
110
+
const baseUrl ="https://api.sprinter.tech";
111
+
const destChainId ="eip155:8453"; // eip155:8453(Base), eip155:10 (Optimism), eip155:42161 (Arbitrum) destChainId must use capid format from our configuration
A [borrow quote](/Resources/glossary#stash-borrow-quote) is the **preliminary estimated fee** a solver would incur to borrow credit from Sprinter Stash. It is returned off-chain via the Stash API and helps solvers determine if pursuing a fill is profitable.
34
+
35
+
Borrow quote includes expected gas, risk premiums, protocol fees, and capital access costs — but it is not a binding or reserved price.
36
+
37
+
See the [Request a Credit Borrow Quote Estimate example payload](use-stash#2-request-a-credit-borrow-quote-estimate-optional).
38
+
39
+
A [borrow quote](/Resources/glossary#stash-borrow-quote) is the final, **authorized borrowing offer** issued by Sprinter Stash when a solver decides to proceed with a fill.
40
+
It reserves credit under specific conditions, allowing solvers to confidently execute the cross-chain transaction.
41
+
42
+
See the [Request Final Borrow Quote example payload](/Stash/use-stash#3-request-a-final-borrow-quote).
43
+
44
+
<Heading
45
+
id={"request"}
46
+
as={"h2"}
47
+
className={"openapi-tabs__heading"}
48
+
children={"Request"}
49
+
></Heading>
50
+
51
+
<ParamsDetails
52
+
parameters={[
53
+
{
54
+
description:
55
+
"destChainID must use capid format from our configuration <br />-eip155:8453(Base),<br />-eip155:10 (Optimism),<br />-eip155:42161 (Arbitrum)",
56
+
in: "path",
57
+
name: "destChainId",
58
+
required: true,
59
+
schema: { type: "string" },
60
+
},
61
+
{
62
+
description: "Protocol name - across, mayan",
63
+
in: "path",
64
+
name: "protocol",
65
+
required: true,
66
+
schema: { type: "string" },
67
+
},
68
+
{
69
+
description:
70
+
"Quote algorithm type: <br /><br /> ExactInput - Request will consider the amount as (input amount - borrow costs) <br /><br /> ExactOutput - Request will consider the amount as (output amount + borrow costs) ",
71
+
in: "path",
72
+
name: "type",
73
+
required: true,
74
+
schema: { type: "string" },
75
+
},
76
+
{
77
+
description:
78
+
"Destination Network ID (optional, defaults to the network from the request body)",
0 commit comments