diff --git a/aibtc-agents/speedy-indra/README.md b/aibtc-agents/speedy-indra/README.md new file mode 100644 index 0000000..8c819c7 --- /dev/null +++ b/aibtc-agents/speedy-indra/README.md @@ -0,0 +1,99 @@ +--- +name: speedy-indra +btc-address: bc1q7maxug87p9ul7cl8yvmv6za8aqxfpfea0h6tc9 +stx-address: SP1H35Z548R39KCMMNP9498QQ28SZFE07FB7Q3CBT +registered: false +agent-id: null +--- + +# Speedy Indra — Agent Configuration + +> Agent operacional na mainnet Stacks focado em DeFi (Bitflow swaps, stacking, sBTC), desenvolvido no ecossistema AIBTC/BFF Brazil. + +## Agent Identity + +| Field | Value | +|-------|-------| +| Display Name | Speedy Indra | +| Handle | speedy-indra | +| BTC Address (SegWit) | `bc1q7maxug87p9ul7cl8yvmv6za8aqxfpfea0h6tc9` | +| BTC Address (Taproot) | `bc1ptnnv7qu30adkszyhet9vwef977em55svhlm6js2tfr8qm92neglqzwxz9s` | +| STX Address | `SP1H35Z548R39KCMMNP9498QQ28SZFE07FB7Q3CBT` | +| Registered | No — see [register-and-check-in.md](../../what-to-do/register-and-check-in.md) | +| Agent ID | Not yet minted | +| Home Repo | [luizinhotec/local-ai-agent](https://github.com/luizinhotec/local-ai-agent) | +| Skills Repo | [luizinhotec/skills](https://github.com/luizinhotec/skills) | +| BFF Skills | [luizinhotec/bff-skills](https://github.com/luizinhotec/bff-skills) | + +## Skills Used + +| Skill | Used | Notes | +|-------|------|-------| +| `bitflow` | [x] | Swaps STX ↔ aeUSDC, cotações e rotas na mainnet | +| `bns` | [ ] | | +| `btc` | [ ] | | +| `defi` | [x] | Monitoring Zest e Bitflow yield | +| `identity` | [ ] | | +| `nft` | [ ] | | +| `ordinals` | [ ] | | +| `pillar` | [ ] | | +| `query` | [ ] | | +| `sbtc` | [x] | Monitoramento e transferências de sBTC | +| `settings` | [x] | Configuração de rede mainnet | +| `signing` | [ ] | | +| `stacking` | [x] | Delegação via dual-stacking-v3 | +| `stx` | [x] | Transferências STX e contract calls | +| `tokens` | [ ] | | +| `wallet` | [x] | Gestão de carteira agent-mainnet | +| `x402` | [ ] | | +| `yield-hunter` | [ ] | | + +## BFF Competition Skills + +Skills desenvolvidas para a competição AIBTC x Bitflow: + +| Skill | Description | +|-------|-------------| +| `bitflow-hodlmm-manager` | Gestão de liquidez HODLMM/DLMM no Bitflow | +| `execution-readiness-guard` | Verificação de pré-condições antes de execução de swaps | +| `route-profitability-estimator` | Estimativa de lucratividade de rotas Bitflow | +| `zest-yield-manager` | Gestão de yield no protocolo Zest | + +## Wallet Setup + +```bash +# Unlock wallet before write operations +cd C:/dev/skills +NETWORK=mainnet bun run wallet/wallet.ts unlock --wallet-id de1522df-bf68-461c-958c-2b7cb14b14e4 --password + +# Check wallet status +NETWORK=mainnet bun run wallet/wallet.ts status +``` + +**Network:** mainnet +**Wallet file:** `~/.aibtc/wallets/de1522df-bf68-461c-958c-2b7cb14b14e4` + +## Environment Variables + +| Variable | Required | Description | +|----------|----------|-------------| +| `NETWORK` | Yes | Deve ser `mainnet` | +| `BITFLOW_API_HOST` | Yes | `https://bitflow-sdk-api-gateway-7owjsmt8.uc.gateway.dev` | +| `HIRO_API_KEY` | No | Hiro API key para rate limits maiores | + +## Workflows + +| Workflow | Frequency | Notes | +|----------|-----------|-------| +| [register-and-check-in](../../what-to-do/register-and-check-in.md) | Daily | | +| [check-balances-and-status](../../what-to-do/check-balances-and-status.md) | Daily | | +| [swap-tokens](../../what-to-do/swap-tokens.md) | As needed | Via Bitflow skill | + +## Preferences + +| Setting | Value | Notes | +|---------|-------|-------| +| Check-in frequency | 60 min | Standard loop interval | +| Preferred DEX | bitflow | Para token swaps | +| Fee tier | standard | | +| Auto-reply to inbox | disabled | | diff --git a/execution-readiness-guard/AGENT.md b/execution-readiness-guard/AGENT.md new file mode 100644 index 0000000..ce61ed3 --- /dev/null +++ b/execution-readiness-guard/AGENT.md @@ -0,0 +1,50 @@ +# Execution Readiness Guard — Agent Guide + +## Role + +The Execution Readiness Guard is a decision skill responsible for determining whether a route is safe to execute. + +It should be used as a final gating step before any execution attempt. + +## When to Use + +Use this skill: + +- After route selection +- After protocol and route health evaluation +- Before sending any transaction +- In any system where execution safety matters + +## What It Does + +This skill evaluates: + +- Route operator decision +- Route health status +- Protocol health status +- Route performance score + +It then determines: + +- If execution is allowed +- If execution must be blocked +- If the route is degraded and should not be executed + +## Decision Priority + +The evaluation follows strict priority: + +1. Route operator (BLOCK) +2. Route health (blocked) +3. Protocol health (blocked) +4. Route performance (degraded) + +## How to Integrate + +This skill expects: + +```json +{ + "route": "string", + "state": "object" +} diff --git a/execution-readiness-guard/SKILL.md b/execution-readiness-guard/SKILL.md new file mode 100644 index 0000000..8f9642c --- /dev/null +++ b/execution-readiness-guard/SKILL.md @@ -0,0 +1,25 @@ +# Execution Readiness Guard + +## Overview + +The Execution Readiness Guard is a decision skill that evaluates whether a route is safe and eligible for execution. + +It consumes consolidated state from multiple upstream skills and determines if execution should proceed, be blocked, or considered degraded. + +## Purpose + +This skill acts as a final safety checkpoint before execution. + +It ensures that: + +- Blocked routes are never executed +- Degraded routes are identified and prevented from execution +- Only healthy routes are eligible + +## Input + +```json +{ + "route": "string", + "state": "object" +} diff --git a/execution-readiness-guard/execution-readiness-guard.ts b/execution-readiness-guard/execution-readiness-guard.ts new file mode 100644 index 0000000..81fb668 --- /dev/null +++ b/execution-readiness-guard/execution-readiness-guard.ts @@ -0,0 +1,100 @@ +'use strict'; + +type Input = { + route: string; + state: any; +}; + +type Output = { + ok: boolean; + route: string; + readiness: 'healthy' | 'degraded' | 'blocked'; + eligible: boolean; + reason: string; +}; + +function evaluateReadiness(input: Input): Output { + const route = input?.route; + const state = input?.state || {}; + + const routeOperator = state?.routeOperatorByRoute?.[route] || null; + const routeHealth = state?.routeHealthByRoute?.[route] || null; + const protocol = routeOperator?.protocol; + const protocolHealth = state?.protocolHealthByProtocol?.[protocol] || null; + const routeScore = state?.routeScoreByRoute?.[route] || null; + + // BLOCK conditions + if (!routeOperator || routeOperator?.decision === 'BLOCK') { + return { + ok: true, + route, + readiness: 'blocked', + eligible: false, + reason: 'ROUTE_OPERATOR_BLOCKED' + }; + } + + if (routeHealth?.status === 'blocked') { + return { + ok: true, + route, + readiness: 'blocked', + eligible: false, + reason: routeHealth?.reason || 'ROUTE_BLOCKED' + }; + } + + if (protocolHealth?.status === 'blocked') { + return { + ok: true, + route, + readiness: 'blocked', + eligible: false, + reason: protocolHealth?.reason || 'PROTOCOL_BLOCKED' + }; + } + + // DEGRADED condition + if (routeScore?.status === 'degraded') { + return { + ok: true, + route, + readiness: 'degraded', + eligible: false, + reason: routeScore?.reason || 'ROUTE_UNDERPERFORMING' + }; + } + + // HEALTHY + return { + ok: true, + route, + readiness: 'healthy', + eligible: true, + reason: 'READY' + }; +} + +// CLI execution +async function main() { + try { + let input = ''; + + process.stdin.on('data', chunk => { + input += chunk; + }); + + process.stdin.on('end', () => { + const parsed = JSON.parse(input); + const result = evaluateReadiness(parsed); + console.log(JSON.stringify(result)); + }); + } catch (err) { + console.error(JSON.stringify({ + ok: false, + error: 'INVALID_INPUT' + })); + } +} + +main();