```json
{
"tests": [
{
"name": "test_get_all_yield_pools",
"endpoint": "/defi/yields",
"method": "GET",
"headers": {
"X-API-Key": "your_api_key_here"
},
"payload": {},
"expected_status": 200,
"expected_behavior": "Returns list of all DeFi yield pools",
"metrics": ["latency", "status_code"],
"validation": {
"field": "data",
"type": "array",
"min_length": 1
}
},
{
"name": "test_filter_yields",
"endpoint": "/defi/yields?chain=ethereum&min_apy=3",
"method": "GET",
"headers": {
"X-API-Key": "your_api_key_here"
},
"payload": {},
"expected_status": 200,
"expected_behavior": "Returns filtered list of yields by chain and min_apy",
"metrics": ["latency", "status_code"],
"validation": {
"field": "data",
"type": "array",
"min_length": 1
}
},
{
"name": "test_get_protocol_yields",
"endpoint": "/defi/yields/Aave",
"method": "GET",
"headers": {
"X-API-Key": "your_api_key_here"
},
"payload": {},
"expected_status": 200,
"expected_behavior": "Returns yields for the Aave protocol",
"metrics": ["latency", "status_code"],
"validation": {
"field": "data",
"type": "array",
"min_length": 1
}
},
{
"name": "test_simulate_swap_success",
"endpoint": "/defi/simulate-swap",
"method": "POST",
"headers": {
"X-API-Key": "your_api_key_here"
},
"payload": {
"amount": 100,
"to_token": "DAI",
"from_token": "ETH"
},
"expected_status": 200,
"expected_behavior": "Successful simulation of token swap",
"metrics": ["latency", "status_code"],
"validation": {
"field": "estimated_return",
"type": "number",
"min_value": 0
}
},
{
"name": "test_missing_params",
"endpoint": "/defi/simulate-swap",
"method": "POST",
"headers": {
"X-API-Key": "your_api_key_here"
},
"payload": {
"amount": 100,
"to_token": "DAI"
},
"expected_status": 400,
"expected_behavior": "Returns error for missing from_token parameter",
"metrics": ["status_code"]
}
],
"pricing_probes": [],
"stress_profile": {
"concurrent_requests": 5,
"duration_seconds": 10,
"ramp_up": true
}
}
```