API Reference
Note: The APIs are currently in closed alpha testing and not yet live. This reference is for partners to review and understand our development progress.
Returns ETH and token balances for the provided wallet across all supported chains.
Wallet address (0x-prefixed)
^0x[a-fA-F0-9]{40}$
Balance snapshot
Invalid account address supplied
GET /balances/{account} HTTP/1.1
Host: api.tetrics.io
Accept: */*
{
"account": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"balances_by_chain": {
"ANY_ADDITIONAL_PROPERTY": {
"native_token": "text",
"tokens": {
"ANY_ADDITIONAL_PROPERTY": "text"
}
}
}
}
Returns a balance snapshot for the default account used in automated tests.
Balance snapshot
GET /balances HTTP/1.1
Host: api.tetrics.io
Accept: */*
Balance snapshot
{
"account": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"balances_by_chain": {
"ANY_ADDITIONAL_PROPERTY": {
"native_token": "text",
"tokens": {
"ANY_ADDITIONAL_PROPERTY": "text"
}
}
}
}
Returns adapter discovery statistics and configuration health.
Discovery status
GET /protocols/discovery HTTP/1.1
Host: api.tetrics.io
Accept: */*
Discovery status
{
"total_protocols_discovered": 1,
"total_protocols_enabled": 1,
"protocols_by_chain": {
"ANY_ADDITIONAL_PROPERTY": [
"text"
]
},
"health_status": {
"ANY_ADDITIONAL_PROPERTY": true
},
"discovery_stats": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"last_config_reload": 1
}
Returns metadata for all registered protocol adapters grouped by chain.
Protocol metadata
GET /protocols HTTP/1.1
Host: api.tetrics.io
Accept: */*
Protocol metadata
{
"protocols": [
{
"name": "text",
"chain": "text",
"version": "text",
"description": "text",
"supported_methods": [
"text"
],
"contract_address": "text",
"requires_approval": true
}
],
"protocols_by_chain": {
"ANY_ADDITIONAL_PROPERTY": [
"text"
]
},
"total_protocols": 1
}
Returns service readiness information and adapter health status.
Service is healthy
GET /health HTTP/1.1
Host: api.tetrics.io
Accept: */*
Service is healthy
{
"status": "healthy",
"service": "tetrics-modernized-api",
"version": "2.0.0",
"chains_supported": [
"ethereum",
"hyperliquid"
],
"protocols_discovered": 1,
"discovery_service_status": "active",
"adapter_health": {
"ANY_ADDITIONAL_PROPERTY": true
}
}
Validates a strategy configuration without executing it on-chain. This endpoint checks:
Protocol method availability
Parameter validity
Gas estimates
Cross-chain compatibility
Validation summary
Strategy payload could not be processed
POST /validate HTTP/1.1
Host: api.tetrics.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 298
{
"actions": [
{
"chain": "Ethereum",
"protocol": "lido",
"method": "deposit",
"params": {
"amount": "1000000000000000000"
},
"value": "1000000000000000000"
},
{
"chain": "Ethereum",
"protocol": "morpho",
"method": "supply",
"params": {
"market": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"amount": "1000000000000000000"
}
}
]
}
{
"valid": true,
"errors": [
"text"
],
"warnings": [
"text"
],
"total_steps": 1,
"estimated_total_gas": "text"
}
Executes a strategy using the server-controlled executor wallet. Supports both atomic (single transaction) and sequential (multi-transaction) execution modes.
Execution Modes:
atomic
- All actions bundled into a single transaction (fails atomically if any step fails)sequential
- Actions executed one-by-one (can partially succeed)
Note: This endpoint is suitable for testing and development. For production use with user funds, use the /execute
endpoint with Permit2 signatures.
Wallet on whose behalf the strategy is executed
Execution mode (atomic
or sequential
)
Execution result
Invalid request
Strategy failed due to business logic error
POST /execute/direct HTTP/1.1
Host: api.tetrics.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 370
{
"name": "Lido Stake and Morpho Supply",
"execution_mode": "sequential",
"user_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"actions": [
{
"chain": "Ethereum",
"protocol": "lido",
"method": "deposit",
"params": {
"amount": "1000000000000000000"
},
"value": "1000000000000000000"
},
{
"chain": "Ethereum",
"protocol": "wsteth",
"method": "wrap",
"params": {
"amount": "1000000000000000000"
}
}
]
}
{
"execution_id": "text",
"user_address": "text",
"success": true,
"total_gas_used": "text",
"total_gas_cost": "text",
"action_results": [
{
"protocol": "text",
"method": "text",
"chain": "text",
"success": true,
"tx_hash": "text",
"gas_used": "text",
"gas_price": "text",
"gas_cost": "text",
"output_amount": "text",
"error": "text",
"execution_order": 1
}
],
"execution_time_ms": 1,
"error": "text",
"fee_collection": {
"total_fees_collected": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"fee_transactions": [
{
"chain": "text",
"asset": "text",
"amount": "text",
"tx_hash": "text",
"success": true,
"error": "text"
}
],
"collection_success": true,
"error": "text",
"gas_compensation": {
"relayer_address": "text",
"total_gas_used": "text",
"gas_price": "text",
"compensation_amount": "text",
"tx_hash": "text",
"success": true,
"error": "text"
}
}
}
Executes a strategy on behalf of a user using their Permit2/EIP-712 signature. This enables gasless execution where the API pays for gas and the user authorizes token movements via signature.
Flow:
User calls
/permit2/signature
to generate EIP-712 typed dataUser signs the typed data with their wallet
User submits signature + typed data to this endpoint
API executes the strategy and pays for gas
Security: The signature is verified on-chain to ensure only authorized token transfers occur.
Hex-encoded EIP-712 signature
Execution result
Invalid signature or request payload
Signature did not match the claimed wallet
Strategy failed due to business logic error
POST /execute HTTP/1.1
Host: api.tetrics.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 480
{
"name": "text",
"user_address": "text",
"user_signature": "text",
"signed_typed_data": {
"types": {
"ANY_ADDITIONAL_PROPERTY": [
{
"name": "text",
"type": "text"
}
]
},
"primaryType": "text",
"domain": {
"name": "text",
"version": "text",
"chainId": "text",
"verifyingContract": "text"
},
"message": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
},
"actions": [
{
"chain": "Ethereum",
"protocol": "text",
"method": "text",
"params": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"value": "text",
"recipient": "text",
"skip_on_failure": false
}
]
}
{
"execution_id": "text",
"user_address": "text",
"success": true,
"total_gas_used": "text",
"total_gas_cost": "text",
"action_results": [
{
"protocol": "text",
"method": "text",
"chain": "text",
"success": true,
"tx_hash": "text",
"gas_used": "text",
"gas_price": "text",
"gas_cost": "text",
"output_amount": "text",
"error": "text",
"execution_order": 1
}
],
"execution_time_ms": 1,
"error": "text",
"fee_collection": {
"total_fees_collected": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"fee_transactions": [
{
"chain": "text",
"asset": "text",
"amount": "text",
"tx_hash": "text",
"success": true,
"error": "text"
}
],
"collection_success": true,
"error": "text",
"gas_compensation": {
"relayer_address": "text",
"total_gas_used": "text",
"gas_price": "text",
"compensation_amount": "text",
"tx_hash": "text",
"success": true,
"error": "text"
}
}
}
Generates EIP-712 typed data for Permit2 token authorization. The user signs this data with their wallet to authorize the strategy execution without requiring on-chain token approvals.
Returns:
EIP-712 typed data structure for wallet signing
Execution preview showing gas estimates
Gas savings compared to traditional approve + execute flow
Use the returned typed_data
with wallet signing libraries (e.g., ethers.js signTypedData
) and submit the signature to /execute
for gasless execution.
Permit2 signing payload
Strategy is not eligible for atomic execution
Missing or invalid API key
POST /permit2/signature HTTP/1.1
Host: api.tetrics.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 196
{
"user_address": "text",
"actions": [
{
"chain": "Ethereum",
"protocol": "text",
"method": "text",
"params": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"value": "text",
"recipient": "text",
"skip_on_failure": false
}
]
}
{
"typed_data": {
"types": {
"ANY_ADDITIONAL_PROPERTY": [
{
"name": "text",
"type": "text"
}
]
},
"primaryType": "text",
"domain": {
"name": "text",
"version": "text",
"chainId": "text",
"verifyingContract": "text"
},
"message": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
},
"execution_preview": "text",
"gas_estimate": 1,
"gas_savings_estimate": 1
}
Establishes a WebSocket connection for streaming real-time strategy execution updates, transaction receipts, and balance changes.
Message Types:
strategy_progress
- Step-by-step execution updatestransaction_update
- Transaction confirmation eventsbalance_update
- Wallet balance changeserror
- Execution errors and warnings
Example Message:
{
"type": "strategy_progress",
"data": {
"execution_id": "abc-123",
"step": 2,
"total_steps": 5,
"protocol": "lido",
"status": "completed"
}
}
WebSocket connection established
No content
Invalid WebSocket upgrade request
GET /ws HTTP/1.1
Host: api.tetrics.io
Accept: */*
No content
Last updated