```json
{
"tests": [
{
"name": "test_pools_list",
"endpoint": "/v1/pools",
"method": "GET",
"headers": {"X-API-Key": "{api_key}"},
"payload": {},
"expected_status": 200,
"expected_behavior": "Returns list of available yield pools",
"metrics": ["latency", "accuracy", "status_code"],
"validation": {
"field": "data",
"type": "array",
"min_length": 1,
"required_fields": ["pool_id", "name", "apy"],
"apy_range": {"min": 0, "max": 100}
}
},
{
"name": "test_specific_pool",
"endpoint": "/v1/pools/{pool_id}",
"method": "GET",
"headers": {"X-API-Key": "{api_key}"},
"payload": {},
"expected_status": 200,
"expected_behavior": "Returns detailed pool information with TVL and yield data",
"metrics": ["latency", "accuracy", "status_code"],
"validation": {
"field": "data",
"type": "object",
"required_fields": ["pool_id", "tvl", "apy", "updated_at"],
"tvl_numeric": true,
"timestamp_fresh": {"field": "updated_at", "max_age_minutes": 15}
}
},
{
"name": "test_current_yields",
"endpoint": "/v1/yields",
"method": "GET",
"headers": {"X-API-Key": "{api_key}"},
"payload": {},
"expected_status": 200,
"expected_behavior": "Returns current yield rates across protocols",
"metrics": ["latency", "accuracy", "status_code"],
"validation": {
"field": "yields",
"type": "array",
"required_fields": ["protocol", "yield", "timestamp"],
"yield_reasonable": {"min": 0, "max": 50},
"timestamp_fresh": {"max_age_minutes": 5}
}
},
{
"name": "test_tvl_data",
"endpoint": "/v1/tvl",
"method": "GET",
"headers": {"X-API-Key": "{api_key}"},
"payload": {},
"expected_status": 200,
"expected_behavior": "Returns total value locked data",
"metrics": ["latency", "accuracy", "status_code"],
"validation": {
"field": "tvl",
"type": "object",
"required_fields": ["total_tvl_usd", "updated_at"],
"tvl_positive": {"field": "total_tvl_usd", "min": 1000},
"timestamp_fresh": {"field": "updated_at", "max_age_minutes": 10}
}
},
{
"name": "test_protocol_stats",
"endpoint": "/v1/stats",
"method": "GET",
"headers": {"X-API-Key": "{api_key}"},
"payload": {},
"expected_status": 200,
"expected_behavior": "Returns protocol statistics",
"metrics": ["latency", "accuracy", "status_code"],
"validation": {
"field": "stats",
"type": "object",
"required_fields": ["total_users", "total_pools", "total_tvl"]
}
},
{
"name": "test_historical_data",
"endpoint": "/v1/history",
"method": "GET",
"headers": {"X-API-Key": "{api_key}"},
"payload": {},
"expected_status": 200,
"expected_behavior": "Returns historical yield data",
"metrics": ["latency", "accuracy", "status_code"],
"validation": {
"field": "history",
"type": "array",
"min_length": 1,
"required_fields": ["date", "yield", "tvl"],
"chronological_order": true
}
},
{
"name": "test_user_positions_auth_required",
"endpoint": "/v1/positions",
"method": "GET",
"headers": {"X-API-Key": "{api_key}"},
"payload": {},
"expected_status": 200,
"expected_behavior": "Returns user positions (requires valid auth)",
"metrics": ["latency", "accuracy", "status_code"],
"validation": {
"field": "positions",
"type": "array"
}
},
{
"name": "test_auth_failure",
"endpoint": "/v1/positions",
"method": "GET",
"headers": {"X-API-Key": "invalid_key"},
"payload": {},
"expected_status": 401,
"expected_behavior": "Returns unauthorized error for invalid API key",
"metrics": ["latency", "status_code"],
"validation": {
"error_message": "unauthorized"
}
},
{
"name": "test_invalid_pool_id",
"endpoint": "/v1/pools/nonexistent_pool_123",
"method": "GET",
"headers": {"X-API-Key": "{api_key}"},
"payload": {},
"expected_status": 404,
"expected_behavior": "Returns not found error for invalid pool ID",
"metrics": ["latency", "status_code"],
"validation": {
"error_message": "not found"
}
},
{
"name": "test_no_auth_header",
"endpoint": "/v1/pools",
"method": "GET",
"headers": {},
"payload": {},
"expected_status": 401,
"expected_behavior": "Returns unauthorized when no API key provided",
"metrics": ["latency", "status_code"],
"validation": {
"error_message": "api key required"
}
}
],
"pricing_probes": [
{
"name": "verify_rate_limit_free_tier",