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: src/content/quickstarts/ccip-direct-staking.mdx
+38-32Lines changed: 38 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,66 +95,72 @@ The following contract addresses are for the **Lido protocol** as an example imp
95
95
96
96
### Available Use Cases
97
97
98
-
The [chainlink-csr repository](https://github.com/Aphyla/chainlink-csr) provides protocol-agnostic implementations for direct staking operations. These implementations include fee encoding, allowance management, and cross-chain tracking functionality:
98
+
The [chainlink-csr repository](https://github.com/Aphyla/chainlink-csr) provides protocol-agnostic implementations for direct staking operations. These implementations include fee encoding, allowance management, and cross-chain tracking functionality.
99
99
100
100
#### Core Estimation Functions
101
101
102
-
-**[`estimateFastStake()`](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/useCases/fastStake/estimate.ts)** - Calculate expected outputs, validate pool liquidity, and get fee breakdowns for fast stake operations
103
-
-**[`estimateSlowStakeFees()`](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/useCases/slowStake/estimate.ts)** - Estimate cross-chain fees (CCIP + bridge) with automatic encoding for all supported bridge types
|**[`estimateFastStake()`](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/useCases/fastStake/estimate.ts)**| Calculate expected outputs, validate pool liquidity, and get fee breakdowns for fast stake operations |
105
+
|**[`estimateSlowStakeFees()`](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/useCases/slowStake/estimate.ts)**| Estimate cross-chain fees (CCIP + bridge) with automatic encoding for all supported bridge types |
104
106
105
107
#### Pool Monitoring & Analysis
106
108
107
-
-**[`getPoolBalances()`](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/useCases/pool/balance.ts)** - Monitor TOKEN_IN/TOKEN_OUT liquidity across all supported chains with pool health indicators
108
-
-**[`getTradingRate()`](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/useCases/pool/trading-rate.ts)** - Get current exchange rates, oracle pricing, and effective rates users receive after fees
|**[`getPoolBalances()`](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/useCases/pool/balance.ts)**| Monitor TOKEN_IN/TOKEN_OUT liquidity across all supported chains with pool health indicators |
112
+
|**[`getTradingRate()`](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/useCases/pool/trading-rate.ts)**| Get current exchange rates, oracle pricing, and effective rates users receive after fees |
109
113
110
114
#### Transaction Execution
111
115
112
-
-**[`executeSlowStake()`](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/useCases/slowStake/execute.ts)** - Complete slow staking flow with automatic allowance management for both WETH and LINK tokens
113
-
-**[`executeFastStakeReferral()`](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/useCases/fastStake/execute.ts)** - Fast stake execution with automatic allowance management for both native ETH and wrapped token payments
|**[`executeSlowStake()`](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/useCases/slowStake/execute.ts)**| Complete slow staking flow with automatic allowance management for both WETH and LINK tokens |
119
+
|**[`executeFastStakeReferral()`](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/useCases/fastStake/execute.ts)**| Fast stake execution with automatic allowance management for both native ETH and wrapped token payments |
114
120
115
121
#### Allowance Management
116
122
117
-
-**[`checkTokenAllowance()`](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/useCases/allowance/check.ts)** - Token allowance checking that detects staking tokens and provides status analysis
|**[`checkTokenAllowance()`](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/useCases/allowance/check.ts)**| Token allowance checking that detects staking tokens and provides status analysis |
118
126
119
-
####Complete Integration Examples
127
+
### Complete Integration Examples
120
128
121
129
The [chainlink-csr repository](https://github.com/Aphyla/chainlink-csr) provides **[comprehensive implementation examples](https://github.com/Aphyla/chainlink-csr/tree/main/offchain/src/examples/lido)** demonstrating different patterns:
122
130
123
131
<br />
124
132
125
-
#####Fast Stake Implementation
133
+
#### Fast Stake Implementation
126
134
127
-
-**[Native ETH Fast Stake](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/fastStakeNativeExample.ts)** - Complete implementation using native ETH payment (no allowance management required)
128
-
-**[WETH Fast Stake](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/fastStakeWrappedExample.ts)** - Complete implementation using WETH tokens with automatic allowance checking and approval
|**[Native ETH Fast Stake](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/fastStakeNativeExample.ts)**| Complete implementation using native ETH payment (no allowance management required) |
138
+
|**[WETH Fast Stake](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/fastStakeWrappedExample.ts)**| Complete implementation using WETH tokens with automatic allowance checking and approval |
129
139
130
140
<br />
131
141
132
-
#####Slow Stake Implementation
142
+
#### Slow Stake Implementation
133
143
134
-
_Native ETH Staking:_
144
+
Complete implementations covering all four payment combinations:
135
145
136
-
-**[Native ETH + Native CCIP](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/slowStakeNativeExample.ts)** - Staking ETH with CCIP fees paid in ETH
137
-
-**[Native ETH + LINK CCIP](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/slowStakeNativeLinkExample.ts)** - Staking ETH with CCIP fees paid in LINK
138
-
139
-
_WETH Staking:_
140
-
141
-
-**[WETH + Native CCIP](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/slowStakeWrappedNativeExample.ts)** - Staking WETH with CCIP fees paid in ETH
142
-
-**[WETH + LINK CCIP](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/slowStakeWrappedLinkExample.ts)** - Staking WETH with CCIP fees paid in LINK
|**[Native ETH + Native CCIP](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/slowStakeNativeExample.ts)**| ETH | Native | Most efficient - no token approvals needed |
149
+
|**[Native ETH + LINK CCIP](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/slowStakeNativeLinkExample.ts)**| ETH | LINK | ETH payment with LINK for cross-chain fees |
|**[WETH + LINK CCIP](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/slowStakeWrappedLinkExample.ts)**| WETH | LINK | Full wrapped token implementation |
143
152
144
153
<br />
145
154
146
-
##### Utility and Analysis
147
-
148
-
_Pool and Rate Analysis:_
149
-
150
-
-**[Pool Balance Check](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/poolBalanceExample.ts)** - Query liquidity across all supported chains with health indicators
151
-
-**[Trading Rate Analysis](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/tradingRateExample.ts)** - Real-time exchange rates, oracle pricing, and effective rates after fees
152
-
-**[Allowance Management](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/allowanceExample.ts)** - Comprehensive token allowance checking across all chains with detailed status analysis
-**[Slow Stake Fee Estimation](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/slowStakeEstimateExample.ts)** - Multi-chain fee comparison and optimization analysis for both ETH and LINK payment methods
|**Pool Analysis**|**[Pool Balance Check](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/poolBalanceExample.ts)**| Query liquidity across all supported chains with health indicators |
160
+
|**Rate Analysis**|**[Trading Rate Analysis](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/tradingRateExample.ts)**| Real-time exchange rates, oracle pricing, and effective rates after fees |
161
+
|**Allowance**|**[Allowance Management](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/allowanceExample.ts)**| Comprehensive token allowance checking across all chains with detailed status analysis |
|**Fee Estimation**|**[Slow Stake Fee Estimation](https://github.com/Aphyla/chainlink-csr/blob/main/offchain/src/examples/lido/slowStakeEstimateExample.ts)**| Multi-chain fee comparison and optimization analysis for both ETH and LINK payment methods |
0 commit comments