# Autonomous Execution

### Autonomous Trading Agents

**Use Case:** Deploy agents that execute market strategies across Solana, Ethereum, and other chains.\
**How Treza Helps:** Agents run in secure enclaves, use delegated keys to sign transactions, and receive real-time data to act on signals — all without human intervention.

<figure><img src="/files/DLX9DGEKxffThN5fyIgh" alt=""><figcaption></figcaption></figure>

Examples:

* Momentum-based trading strategies
* MEV-aware arbitrage across DEXs
* Stop-loss / take-profit logic on-chain

```ts
import { TrezaClient } from '@treza/sdk'

const client = new TrezaClient({
  apiKey: process.env.TREZA_API_KEY,
})

// Example: Run a momentum-based strategy on Solana
const task = {
  taskName: '0xmomentum_strategy_001', // pre-uploaded agent logic
  inputs: {
    pair: 'SOL/USDC',
    timeframe: '5m',
    threshold: 0.015, // Trigger on >1.5% price move
    slippage: 0.005,
    wallet: 'delegated', // uses scoped delegated keys
  },
}

async function executeTrade() {
  const result = await client.submitTask(task)
  console.log('Trade executed:', result)
}

executeTrade()
```

> 🧠 Tip: Task hashes represent specific agent strategies you've uploaded or registered. Inputs are customizable per execution.

***

#### Create Your First Enclave with the SDK

[**GitHub**](https://github.com/treza-labs)\
Start building with Treza’s open-source libraries and examples.

[**Treza SDK**](https://github.com/treza-labs/treza-sdk)\
Create secure enclaves and run your application privately inside Docker containers.

[**Add KYC to Your App with Treza**](https://github.com/treza-labs/treza-contracts)\
Private, zero-knowledge identity verification for KYC/AML.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trezalabs.com/use-cases/autonomous-execution.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
