Morpho V1 Vault Windows
Returns time-windowed performance metrics for Morpho V1 lending vaults, including TVL, deposit/withdrawal flows, share price changes, and supply APY over a selected trailing timeframe. Results can be filtered by chain, vault address, underlying token, and minimum TVL.
GET
https://api.cambrian.org/evm/lending/morpho/v1/vaults/windows
Parameters
timeframe* (string)
Trailing window for historical data results. One of 7d, 30d, 90d, 365d.
vault_address (string)
Morpho V1 vault address
underlying_address (string)
Underlying token address. See tokens for valid addresses.
chain_id (integer)
EVM chain ID.
min_tvl_usd (integer)
Minimum current TVL in USD of the lending vault, not the window average.
limit (integer)
Limit the number of results.
offset (integer)
Offset the results, allows you to skip a number of rows before starting to return rows.
order_asc (array)
List of column names to order by in ascending order divided by comma. Leave empty items to combine with descending order
order_desc (array)
List of column names to order by in descending order divided by comma. Leave empty items to combine with ascending order
Responses
Code
Description
200
Successful response
Media type: application/vnd.cambrian.table.v1.0.0+json
[
{
"columns": [
{
"name": "chainId",
"type": "UInt16"
},
{
"name": "protocolId",
"type": "String"
},
{
"name": "vaultAddress",
"type": "FixedString(42)"
},
{
"name": "symbol",
"type": "Nullable(String)"
},
{
"name": "name",
"type": "Nullable(String)"
},
{
"name": "underlyingAddress",
"type": "String"
},
{
"name": "underlyingSymbol",
"type": "String"
},
{
"name": "tvlUsd",
"type": "Float64"
},
{
"name": "tvlUsdChange",
"type": "Float64"
},
{
"name": "depositsUsd",
"type": "Float64"
},
{
"name": "withdrawalsUsd",
"type": "Float64"
},
{
"name": "netFlowUsd",
"type": "Float64"
},
{
"name": "availableLiquidityChangeUsd",
"type": "Float64"
},
{
"name": "sharePriceChange",
"type": "Float64"
},
{
"name": "supplyApy",
"type": "Float64"
},
{
"name": "supplyBaseApy",
"type": "Float64"
},
{
"name": "supplyExtraRewardsApy",
"type": "Float64"
},
{
"name": "updatedAt",
"type": "DateTime('UTC')"
}
],
"data": [
[
8453,
"morpho-v1",
"0x7bfa7c4f149e7415b73bdedfe609237e29cbf34a",
"sparkUSDC",
"Spark USDC Vault",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"USDC",
455070413.57948697,
96783951.45657098,
390069493.541048,
304744331.286077,
85325162.25497097,
96783951.45657098,
0.000758887014434606,
0.04522070874445855,
0.04522070874445855,
0,
"2026-11-18T12:32:53+00:00"
],
[
8453,
"morpho-v1",
"0xee8f4ec5672f09119b96ab6fb59c27e1b7e44b61",
"gtUSDCp",
"Gauntlet USDC Prime",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"USDC",
396492620.72218865,
-3607329.162811339,
4183119.9697130006,
8127038.0973040005,
-3943918.127591,
-3607329.162811339,
0.0008440003515397532,
0.04523054563072751,
0.04523054563072751,
0,
"2026-11-18T12:41:38+00:00"
],
[
8453,
"morpho-v1",
"0xf80c0529bd94c773844e459853cd91b9263dd525",
"yRSS-USDC",
"King RSS USDC Vault",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"USDC",
227102571.23502985,
200001553.14948884,
0,
0,
0,
200001553.14948884,
0,
97.10877811046518,
97.10877811046518,
0,
"2026-10-08T17:21:51+00:00"
],
[
8453,
"morpho-v1",
"0xbeef010f9cb27031ad51e3333f9af9c6b1228183",
"steakUSDC",
"Steakhouse USDC",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"USDC",
100458158.20195952,
-5224721.786764473,
2573175.5596199995,
7895115.739162,
-5321940.179542,
-5224721.786764473,
0.0006335350425707986,
0.04524224090981285,
0.04524224090981285,
0,
"2026-11-18T12:40:00+00:00"
],
[
8453,
"morpho-v1",
"0xbeefe94c8ad530842bfe7d8b397938ffc1cb83b2",
"steakUSDC",
"Steakhouse Prime USDC",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"USDC",
11418566.105839055,
-175969.29302694462,
513373.146855,
699233.77049,
-185860.62363500003,
-175969.29302694462,
0.0008040621130327441,
0.04540309863512731,
0.04540309863512731,
0,
"2026-11-18T12:29:35+00:00"
],
[
8453,
"morpho-v1",
"0x1401d1271c47648ac70cbcdfa3776d4a87ce006b",
"pUSDC",
"Pangolins USDC",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"USDC",
6839193.758247332,
-68490.85319666844,
11599.639051999997,
85898.742824,
-74299.103772,
-68490.85319666844,
0.0007630614690916637,
0.045220708744458556,
0.045220708744458556,
0,
"2026-11-18T12:20:21+00:00"
],
[
8453,
"morpho-v1",
"0x43cd00de63485618a5ceebe0de364cd6cbeb26e7",
"gtmsETHc",
"Metronome msETH Vault",
"0x7ba6f01772924a82d9626c126347a28299e98c98",
"msETH",
5598999.144345459,
-750222.4339303253,
8.355672434313082,
8.769467228428393,
-0.4137947941153115,
-750222.4339303253,
0.0000016399389344279314,
0.05744374704989203,
0.05744374704989203,
0,
"2026-11-17T11:17:52+00:00"
],
[
8453,
"morpho-v1",
"0xa0e430870c4604ccfc7b38ca7845b1ff653d0ff1",
"mwETH",
"Moonwell Flagship ETH",
"0x4200000000000000000000000000000000000006",
"WETH",
2684054.1525663356,
-627416.0684622996,
7349.489924916901,
223160.79373687733,
-215811.30381196042,
-627416.0684622996,
0.00022969810978668015,
0.014969524809815539,
0.014969524809815539,
0,
"2026-11-18T11:33:37+00:00"
],
[
8453,
"morpho-v1",
"0xc1256ae5ff1cf2719d4937adb3bbccab2e00a2ca",
"mwUSDC",
"Moonwell Flagship USDC",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"USDC",
2462468.8350085355,
53091.546199535485,
409449.95907399995,
358739.704695,
50710.25437899993,
53091.546199535485,
0.0007191389148553107,
0.04529043951654041,
0.04529043951654041,
0,
"2026-11-18T12:20:06+00:00"
],
[
8453,
"morpho-v1",
"0xef417a2512c5a41f69ae4e021648b69a7cde5d03",
"ymvOG-USDC",
"Yearn OG USDC",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"USDC",
2092812.149762399,
-1233.3668006008957,
341563.023973,
345065.195454,
-3502.1714809999685,
-1233.3668006008957,
0.0009827363314651727,
0.0569489880952171,
0.0569489880952171,
0,
"2026-11-18T12:20:32+00:00"
]
],
"rows": 10
}
]
400
Bad Request: Invalid request parameters or malformed request.
401
Unauthorized: Missing or invalid API key. Include X-API-Key header with your request.
403
Forbidden: Invalid API key or insufficient permissions to access this resource.
404
Not Found: Endpoint or resource does not exist.
408
Request Timeout: Request took too long to process. Try again.
500
Internal Server Error: An unexpected error occurred while processing your request.
503
Service Unavailable: The server is temporarily unable to handle the request. Please try again later.
Examples
1. Fetch 7-day vault window metrics
Retrieves windowed performance data for Morpho V1 vaults over the trailing 7-day period, limited to 10 results.
curl
curl -X GET "https://api.cambrian.org/evm/lending/morpho/v1/vaults/windows?timeframe=7d&limit=10" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
JSON
1[
2 {
3 "columns": [
4 {
5 "name": "chainId",
6 "type": "UInt16"
7 },
8 {
9 "name": "protocolId",
10 "type": "String"
11 },
12 {
13 "name": "vaultAddress",
14 "type": "FixedString(42)"
15 },
16 {
17 "name": "symbol",
18 "type": "Nullable(String)"
19 },
20 {
21 "name": "name",
22 "type": "Nullable(String)"
23 },
24 {
25 "name": "underlyingAddress",
26 "type": "String"
27 },
28 {
29 "name": "underlyingSymbol",
30 "type": "String"
31 },
32 {
33 "name": "tvlUsd",
34 "type": "Float64"
35 },
36 {
37 "name": "tvlUsdChange",
38 "type": "Float64"
39 },
40 {
41 "name": "depositsUsd",
42 "type": "Float64"
43 },
44 {
45 "name": "withdrawalsUsd",
46 "type": "Float64"
47 },
48 {
49 "name": "netFlowUsd",
50 "type": "Float64"
51 },
52 {
53 "name": "availableLiquidityChangeUsd",
54 "type": "Float64"
55 },
56 {
57 "name": "sharePriceChange",
58 "type": "Float64"
59 },
60 {
61 "name": "supplyApy",
62 "type": "Float64"
63 },
64 {
65 "name": "supplyBaseApy",
66 "type": "Float64"
67 },
68 {
69 "name": "supplyExtraRewardsApy",
70 "type": "Float64"
71 },
72 {
73 "name": "updatedAt",
74 "type": "DateTime('UTC')"
75 }
76 ],
77 "data": [
78 [
79 8453,
80 "morpho-v1",
81 "0x7bfa7c4f149e7415b73bdedfe609237e29cbf34a",
82 "sparkUSDC",
83 "Spark USDC Vault",
84 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
85 "USDC",
86 455070413.57948697,
87 96783951.45657098,
88 390069493.541048,
89 304744331.286077,
90 85325162.25497097,
91 96783951.45657098,
92 0.000758887014434606,
93 0.04522070874445855,
94 0.04522070874445855,
95 0,
96 "2026-11-18T12:32:53+00:00"
97 ],
98 [
99 8453,
100 "morpho-v1",
101 "0xee8f4ec5672f09119b96ab6fb59c27e1b7e44b61",
102 "gtUSDCp",
103 "Gauntlet USDC Prime",
104 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
105 "USDC",
106 396492620.72218865,
107 -3607329.162811339,
108 4183119.9697130006,
109 8127038.0973040005,
110 -3943918.127591,
111 -3607329.162811339,
112 0.0008440003515397532,
113 0.04523054563072751,
114 0.04523054563072751,
115 0,
116 "2026-11-18T12:41:38+00:00"
117 ],
118 [
119 8453,
120 "morpho-v1",
121 "0xf80c0529bd94c773844e459853cd91b9263dd525",
122 "yRSS-USDC",
123 "King RSS USDC Vault",
124 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
125 "USDC",
126 227102571.23502985,
127 200001553.14948884,
128 0,
129 0,
130 0,
131 200001553.14948884,
132 0,
133 97.10877811046518,
134 97.10877811046518,
135 0,
136 "2026-10-08T17:21:51+00:00"
137 ],
138 [
139 8453,
140 "morpho-v1",
141 "0xbeef010f9cb27031ad51e3333f9af9c6b1228183",
142 "steakUSDC",
143 "Steakhouse USDC",
144 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
145 "USDC",
146 100458158.20195952,
147 -5224721.786764473,
148 2573175.5596199995,
149 7895115.739162,
150 -5321940.179542,
151 -5224721.786764473,
152 0.0006335350425707986,
153 0.04524224090981285,
154 0.04524224090981285,
155 0,
156 "2026-11-18T12:40:00+00:00"
157 ],
158 [
159 8453,
160 "morpho-v1",
161 "0xbeefe94c8ad530842bfe7d8b397938ffc1cb83b2",
162 "steakUSDC",
163 "Steakhouse Prime USDC",
164 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
165 "USDC",
166 11418566.105839055,
167 -175969.29302694462,
168 513373.146855,
169 699233.77049,
170 -185860.62363500003,
171 -175969.29302694462,
172 0.0008040621130327441,
173 0.04540309863512731,
174 0.04540309863512731,
175 0,
176 "2026-11-18T12:29:35+00:00"
177 ],
178 [
179 8453,
180 "morpho-v1",
181 "0x1401d1271c47648ac70cbcdfa3776d4a87ce006b",
182 "pUSDC",
183 "Pangolins USDC",
184 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
185 "USDC",
186 6839193.758247332,
187 -68490.85319666844,
188 11599.639051999997,
189 85898.742824,
190 -74299.103772,
191 -68490.85319666844,
192 0.0007630614690916637,
193 0.045220708744458556,
194 0.045220708744458556,
195 0,
196 "2026-11-18T12:20:21+00:00"
197 ],
198 [
199 8453,
200 "morpho-v1",
201 "0x43cd00de63485618a5ceebe0de364cd6cbeb26e7",
202 "gtmsETHc",
203 "Metronome msETH Vault",
204 "0x7ba6f01772924a82d9626c126347a28299e98c98",
205 "msETH",
206 5598999.144345459,
207 -750222.4339303253,
208 8.355672434313082,
209 8.769467228428393,
210 -0.4137947941153115,
211 -750222.4339303253,
212 0.0000016399389344279314,
213 0.05744374704989203,
214 0.05744374704989203,
215 0,
216 "2026-11-17T11:17:52+00:00"
217 ],
218 [
219 8453,
220 "morpho-v1",
221 "0xa0e430870c4604ccfc7b38ca7845b1ff653d0ff1",
222 "mwETH",
223 "Moonwell Flagship ETH",
224 "0x4200000000000000000000000000000000000006",
225 "WETH",
226 2684054.1525663356,
227 -627416.0684622996,
228 7349.489924916901,
229 223160.79373687733,
230 -215811.30381196042,
231 -627416.0684622996,
232 0.00022969810978668015,
233 0.014969524809815539,
234 0.014969524809815539,
235 0,
236 "2026-11-18T11:33:37+00:00"
237 ],
238 [
239 8453,
240 "morpho-v1",
241 "0xc1256ae5ff1cf2719d4937adb3bbccab2e00a2ca",
242 "mwUSDC",
243 "Moonwell Flagship USDC",
244 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
245 "USDC",
246 2462468.8350085355,
247 53091.546199535485,
248 409449.95907399995,
249 358739.704695,
250 50710.25437899993,
251 53091.546199535485,
252 0.0007191389148553107,
253 0.04529043951654041,
254 0.04529043951654041,
255 0,
256 "2026-11-18T12:20:06+00:00"
257 ],
258 [
259 8453,
260 "morpho-v1",
261 "0xef417a2512c5a41f69ae4e021648b69a7cde5d03",
262 "ymvOG-USDC",
263 "Yearn OG USDC",
264 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
265 "USDC",
266 2092812.149762399,
267 -1233.3668006008957,
268 341563.023973,
269 345065.195454,
270 -3502.1714809999685,
271 -1233.3668006008957,
272 0.0009827363314651727,
273 0.0569489880952171,
274 0.0569489880952171,
275 0,
276 "2026-11-18T12:20:32+00:00"
277 ]
278 ],
279 "rows": 10
280 }
281]
2 {
3 "columns": [
4 {
5 "name": "chainId",
6 "type": "UInt16"
7 },
8 {
9 "name": "protocolId",
10 "type": "String"
11 },
12 {
13 "name": "vaultAddress",
14 "type": "FixedString(42)"
15 },
16 {
17 "name": "symbol",
18 "type": "Nullable(String)"
19 },
20 {
21 "name": "name",
22 "type": "Nullable(String)"
23 },
24 {
25 "name": "underlyingAddress",
26 "type": "String"
27 },
28 {
29 "name": "underlyingSymbol",
30 "type": "String"
31 },
32 {
33 "name": "tvlUsd",
34 "type": "Float64"
35 },
36 {
37 "name": "tvlUsdChange",
38 "type": "Float64"
39 },
40 {
41 "name": "depositsUsd",
42 "type": "Float64"
43 },
44 {
45 "name": "withdrawalsUsd",
46 "type": "Float64"
47 },
48 {
49 "name": "netFlowUsd",
50 "type": "Float64"
51 },
52 {
53 "name": "availableLiquidityChangeUsd",
54 "type": "Float64"
55 },
56 {
57 "name": "sharePriceChange",
58 "type": "Float64"
59 },
60 {
61 "name": "supplyApy",
62 "type": "Float64"
63 },
64 {
65 "name": "supplyBaseApy",
66 "type": "Float64"
67 },
68 {
69 "name": "supplyExtraRewardsApy",
70 "type": "Float64"
71 },
72 {
73 "name": "updatedAt",
74 "type": "DateTime('UTC')"
75 }
76 ],
77 "data": [
78 [
79 8453,
80 "morpho-v1",
81 "0x7bfa7c4f149e7415b73bdedfe609237e29cbf34a",
82 "sparkUSDC",
83 "Spark USDC Vault",
84 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
85 "USDC",
86 455070413.57948697,
87 96783951.45657098,
88 390069493.541048,
89 304744331.286077,
90 85325162.25497097,
91 96783951.45657098,
92 0.000758887014434606,
93 0.04522070874445855,
94 0.04522070874445855,
95 0,
96 "2026-11-18T12:32:53+00:00"
97 ],
98 [
99 8453,
100 "morpho-v1",
101 "0xee8f4ec5672f09119b96ab6fb59c27e1b7e44b61",
102 "gtUSDCp",
103 "Gauntlet USDC Prime",
104 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
105 "USDC",
106 396492620.72218865,
107 -3607329.162811339,
108 4183119.9697130006,
109 8127038.0973040005,
110 -3943918.127591,
111 -3607329.162811339,
112 0.0008440003515397532,
113 0.04523054563072751,
114 0.04523054563072751,
115 0,
116 "2026-11-18T12:41:38+00:00"
117 ],
118 [
119 8453,
120 "morpho-v1",
121 "0xf80c0529bd94c773844e459853cd91b9263dd525",
122 "yRSS-USDC",
123 "King RSS USDC Vault",
124 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
125 "USDC",
126 227102571.23502985,
127 200001553.14948884,
128 0,
129 0,
130 0,
131 200001553.14948884,
132 0,
133 97.10877811046518,
134 97.10877811046518,
135 0,
136 "2026-10-08T17:21:51+00:00"
137 ],
138 [
139 8453,
140 "morpho-v1",
141 "0xbeef010f9cb27031ad51e3333f9af9c6b1228183",
142 "steakUSDC",
143 "Steakhouse USDC",
144 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
145 "USDC",
146 100458158.20195952,
147 -5224721.786764473,
148 2573175.5596199995,
149 7895115.739162,
150 -5321940.179542,
151 -5224721.786764473,
152 0.0006335350425707986,
153 0.04524224090981285,
154 0.04524224090981285,
155 0,
156 "2026-11-18T12:40:00+00:00"
157 ],
158 [
159 8453,
160 "morpho-v1",
161 "0xbeefe94c8ad530842bfe7d8b397938ffc1cb83b2",
162 "steakUSDC",
163 "Steakhouse Prime USDC",
164 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
165 "USDC",
166 11418566.105839055,
167 -175969.29302694462,
168 513373.146855,
169 699233.77049,
170 -185860.62363500003,
171 -175969.29302694462,
172 0.0008040621130327441,
173 0.04540309863512731,
174 0.04540309863512731,
175 0,
176 "2026-11-18T12:29:35+00:00"
177 ],
178 [
179 8453,
180 "morpho-v1",
181 "0x1401d1271c47648ac70cbcdfa3776d4a87ce006b",
182 "pUSDC",
183 "Pangolins USDC",
184 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
185 "USDC",
186 6839193.758247332,
187 -68490.85319666844,
188 11599.639051999997,
189 85898.742824,
190 -74299.103772,
191 -68490.85319666844,
192 0.0007630614690916637,
193 0.045220708744458556,
194 0.045220708744458556,
195 0,
196 "2026-11-18T12:20:21+00:00"
197 ],
198 [
199 8453,
200 "morpho-v1",
201 "0x43cd00de63485618a5ceebe0de364cd6cbeb26e7",
202 "gtmsETHc",
203 "Metronome msETH Vault",
204 "0x7ba6f01772924a82d9626c126347a28299e98c98",
205 "msETH",
206 5598999.144345459,
207 -750222.4339303253,
208 8.355672434313082,
209 8.769467228428393,
210 -0.4137947941153115,
211 -750222.4339303253,
212 0.0000016399389344279314,
213 0.05744374704989203,
214 0.05744374704989203,
215 0,
216 "2026-11-17T11:17:52+00:00"
217 ],
218 [
219 8453,
220 "morpho-v1",
221 "0xa0e430870c4604ccfc7b38ca7845b1ff653d0ff1",
222 "mwETH",
223 "Moonwell Flagship ETH",
224 "0x4200000000000000000000000000000000000006",
225 "WETH",
226 2684054.1525663356,
227 -627416.0684622996,
228 7349.489924916901,
229 223160.79373687733,
230 -215811.30381196042,
231 -627416.0684622996,
232 0.00022969810978668015,
233 0.014969524809815539,
234 0.014969524809815539,
235 0,
236 "2026-11-18T11:33:37+00:00"
237 ],
238 [
239 8453,
240 "morpho-v1",
241 "0xc1256ae5ff1cf2719d4937adb3bbccab2e00a2ca",
242 "mwUSDC",
243 "Moonwell Flagship USDC",
244 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
245 "USDC",
246 2462468.8350085355,
247 53091.546199535485,
248 409449.95907399995,
249 358739.704695,
250 50710.25437899993,
251 53091.546199535485,
252 0.0007191389148553107,
253 0.04529043951654041,
254 0.04529043951654041,
255 0,
256 "2026-11-18T12:20:06+00:00"
257 ],
258 [
259 8453,
260 "morpho-v1",
261 "0xef417a2512c5a41f69ae4e021648b69a7cde5d03",
262 "ymvOG-USDC",
263 "Yearn OG USDC",
264 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
265 "USDC",
266 2092812.149762399,
267 -1233.3668006008957,
268 341563.023973,
269 345065.195454,
270 -3502.1714809999685,
271 -1233.3668006008957,
272 0.0009827363314651727,
273 0.0569489880952171,
274 0.0569489880952171,
275 0,
276 "2026-11-18T12:20:32+00:00"
277 ]
278 ],
279 "rows": 10
280 }
281]
x402 Payment Option
This endpoint supports pay-per-use access via the x402 payment protocol (v2): pay $0.05 USDC per request using blockchain micropayments. No API key required.
Quickstart (Typescript)
bash
npm install @x402/fetch @x402/evm viem
TypeScript
1import { x402Client } from "@x402/core/client";
2import { ExactEvmScheme } from "@x402/evm/exact/client";
3import { wrapFetchWithPayment } from "@x402/fetch";
4import { privateKeyToAccount } from "viem/accounts";
5const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
6const client = new x402Client();
7client.register("eip155:*", new ExactEvmScheme(signer));
8const fetchWithPayment = wrapFetchWithPayment(fetch, client);
9const response = await fetchWithPayment(
10 "https://x402.cambrian.org/evm/lending/morpho/v1/vaults/windows"
11);
12const data = await response.json();
2import { ExactEvmScheme } from "@x402/evm/exact/client";
3import { wrapFetchWithPayment } from "@x402/fetch";
4import { privateKeyToAccount } from "viem/accounts";
5const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
6const client = new x402Client();
7client.register("eip155:*", new ExactEvmScheme(signer));
8const fetchWithPayment = wrapFetchWithPayment(fetch, client);
9const response = await fetchWithPayment(
10 "https://x402.cambrian.org/evm/lending/morpho/v1/vaults/windows"
11);
12const data = await response.json();
Quickstart (Python)
bash
pip install "x402[httpx]"
Python
1import asyncio, os
2from eth_account import Account
3from x402 import x402Client
4from x402.http.clients import x402HttpxClient
5from x402.mechanisms.evm import EthAccountSigner
6from x402.mechanisms.evm.exact.register import register_exact_evm_client
7async def main():
8 client = x402Client()
9 account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
10 register_exact_evm_client(client, EthAccountSigner(account))
11 async with x402HttpxClient(client) as http:
12 response = await http.get("https://x402.cambrian.org/evm/lending/morpho/v1/vaults/windows")
13 print(response.json())
14asyncio.run(main())
2from eth_account import Account
3from x402 import x402Client
4from x402.http.clients import x402HttpxClient
5from x402.mechanisms.evm import EthAccountSigner
6from x402.mechanisms.evm.exact.register import register_exact_evm_client
7async def main():
8 client = x402Client()
9 account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
10 register_exact_evm_client(client, EthAccountSigner(account))
11 async with x402HttpxClient(client) as http:
12 response = await http.get("https://x402.cambrian.org/evm/lending/morpho/v1/vaults/windows")
13 print(response.json())
14asyncio.run(main())
Payment Flow
- Send a normal request to the endpoint (no API key needed)
- Server returns 402 Payment Required with payment details
- The x402 SDK automatically signs a payment authorization with your wallet
- The SDK resubmits the request with the signed payment
- Server verifies payment and returns the API response
The x402 SDK handles steps 2 through 5 automatically.
Network: Base (chain ID 8453) | Currency: USDC | Price: $0.05 per request