| name | elfa-42-skill |
| description | Guide agent to wire Elfa AUTO triggers to 42.space price-market mints on BNB Smart Chain, with claim watcher for finalised rounds. Skill provides flow, constraints, references, and thin helpers so agents can apply this integration in their own environment. |
elfa-42-skill
Guide agent to wire Elfa AUTO triggers to 42.space price-market mints.
This skill is knowledge plus thin bash helpers, not runtime. Agent chooses runtime and implementation details.
What skill provides
- Strategy authoring flow with Elfa Builder Chat (
/v2/auto/chat) + expert /v2/chat trade suggestion
- Query management (
/v2/auto/queries) for automated triggers
- Receiver flow with signature-verified webhook intake, local dedupe, guardrails, executor quote/buy
- Claim watcher flow for finalised markets
- Execution handoff through
scripts/trade.sh, which wraps the upstream wenlanbot executor
- Minimal API wrappers in
scripts/
Upstream references:
Required auth and boundaries
- Outbound Elfa calls use
x-elfa-api-key.
- 42.space REST uses no auth.
- On-chain quotes, mints, and claims run through
scripts/trade.sh with BSC_PRIVATE_KEY.
- Webhook receivers must verify Auto signatures with
AUTO_SECRET before any fund-moving action.
- Execution details live in
references/executor.md; this repo does not vendor executor source.
- Execution wrappers require
bun and git.
Core constraints
- Query action must be exactly one
webhook action.
- Use Builder Chat
conditions only. Build action block locally.
- Price-markets-only: market
categories must include "Price".
- Never call sell path for price markets.
- Enforce per-strategy
cap_usdt_total before mint.
- Pin
(market_address, token_id, outcome_index, outcome_name, intent_text) at authoring time.
- Execute buys with
token_id only; never pass outcome_index as executable token id.
- Treat
cap_usdt_total as total cumulative spend across all fires for a strategy.
High-level flow
- Author strategy: build conditions, ask expert
/v2/chat to suggest trade bucket, validate query, create query.
- Receiver on fire: verify Auto signature, require
X-Auto-Event-Id, dedupe by event_id, load strategy by queryId, run guardrails, quote then mint via executor.
- Claim watcher: poll pending claims, when market finalised call claim command, record claimed or lost.
Setup summary
- Get Elfa API key.
- Prepare BSC wallet with BNB and USDT.
- Run
scripts/setup_executor.sh.
- Stand up receiver with public HTTPS URL and
AUTO_SECRET.
- Run claim watcher loop.
Reference layout
| File | Purpose |
|---|
references/setup.md | Setup, env, smoke test, production requirements |
references/architecture.md | Authoring, receiver, claim watcher, local store |
references/endpoints.md | Elfa + 42 endpoints used by this skill |
references/elfa-eql.md | EQL subset used by strategy authoring |
references/auto-trigger-templates.md | Concrete Elfa Auto params and query templates for 42 triggers |
references/elfa-chat-bucket.md | Expert /v2/chat trade suggestion template |
references/elfa-webhooks.md | Webhook intake and dedupe behavior |
references/ft-price-markets.md | Price-market mechanics and no-sell rule |
references/executor.md | Executor wrapper usage and commands |
references/strategy-authoring.md | Step-by-step authoring flow |
references/troubleshooting.md | Actionable failure fixes |
scripts/elfa_call.sh | Elfa API wrapper |
scripts/ft_call.sh | 42 REST wrapper |
scripts/setup_executor.sh | Ensure local executor checkout and install |
scripts/trade.sh | Execute status, buy, claim, and portfolio |