Reactive Execution
import { TrezaClient } from '@treza/sdk'
const client = new TrezaClient({
apiKey: process.env.TREZA_API_KEY,
})
// Agent listens for wallet activity and reacts to large deposits
const task = {
taskName: '0xwallet_monitor_v2', // pre-deployed reactive strategy
inputs: {
watchAddress: '9xWhale123...', // target wallet to monitor
triggerCondition: {
token: 'USDC',
threshold: 50000, // trigger on $50k+ deposit
},
action: {
type: 'copyTrade',
pair: 'SOL/USDC',
amountPct: 0.1, // copy with 10% size of detected trade
},
},
mode: 'watch', // special mode for long-running monitoring tasks
}
async function startMonitoring() {
const result = await client.submitTask(task)
console.log('Monitoring initiated:', result)
}
startMonitoring()Create Your First Enclave with the SDK
Last updated