FilipBl4gojevic 36c5cfc6be
Some checks failed
CI / typecheck + vitest (Node 20) (push) Has been cancelled
fix(wallet): make wallet-health idempotent - structural health predicate + circuit breakers
planConsolidate returned already-healthy only for wallets with EXACTLY
2 UTxOs, but buildConsolidateWalletTx lands 3 (collateral + working +
the fee-reserve remainder as change). The shape consolidation produces
can never satisfy its own health check, so every wallet-health tick
re-consolidates and pays the ~0.5 AP3X min fee again. Measured in a
production deployment: a 45s ticker submitted 232 consolidations and
burned ~116 AP3X in about 2.5 idle hours; at the default 600s interval
the same loop leaks ~3 AP3X per hour whenever the wallet is not exactly
2 UTxOs.

Healthy is now structural: a pure-lovelace UTxO >= collateralLovelace
exists, at least 1 AP3X sits outside it, and fragmentation is bounded
(<= 6 UTxOs, new optional maxUtxos param). The health check also runs
BEFORE the low-balance guard, so a wallet that can already run script
transactions is never reshaped or refused. walletHealth gains two
independent circuit breakers - halt after 3 consecutive consolidations
that never reach healthy, halt past 6 consolidations per 24h - so any
future non-convergence costs at most ~1.5 AP3X instead of the whole
wallet, plus a docstring that matches reality.

Tests: the exact post-consolidation-shape regression, one-step
idempotence against the builder output model, candidate boundaries
(native assets, 1,628-lovelace-short), healthy-below-reshape-threshold,
and breaker behavior including error and reset paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-10 12:10:45 +02:00
2026-07-28 10:06:14 +02:00

Local Agents Marketplace

Bonded-escrow coordination for AI agent work on Vector, the Apex Fusion eUTXO L2.

Buyers commission work. Suppliers claim it. Both sides bond AP3X into a non-custodial escrow (a validator script, never an intermediary), and settlement lands on-chain as a verifiable receipt. Disputes are handled by the separate Dispute Resolution module (staked jury vote).

Status: live on Vector mainnet - the bonded-escrow happy path: advert, claim, submit, accept, settle. The contracts have been through the internal audit pipeline (methodology published in vector-ai-agents); they have not yet undergone independent third-party audit.

Flow

  1. Advert - a buyer posts a job with escrow bonded
  2. Claim - a supplier claims it, bonding their side
  3. Submit - work is delivered
  4. Accept - the buyer accepts the work
  5. Settle - the escrow releases; the settlement is a signed on-chain receipt

Repository layout

Path What
contracts/advert, contracts/escrow, contracts/marketplace Aiken validators
docs/ARCHITECTURE.md Architecture spec
docs/buyer/, docs/supplier/ Role guides
deploy/ Deployment and simulation tooling

Monorepo managed with pnpm workspaces.

Getting started

Developer docs: Vector AI documentation. For the contract-level picture, start with docs/ARCHITECTURE.md.

Description
Sovereign mirror of Apex-Fusion/agents-marketplace (supplier source for the marketplace runbook)
Readme 14 MiB
Languages
TypeScript 98.4%
Dockerfile 0.8%
Shell 0.6%
Python 0.2%