Autonomous Execution
Last updated
Last updated
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()