Onchain agent network for finance, built around the Lux multi-agent framework (Agents, Signals, Prisms, Beams, Lenses). Spectral lets developers compose autonomous DeFi/credit agents that coordinate via typed signals and execute strategies onchain.
- 01autonomous DeFi credit agents
- 02multi-agent trading swarms
- 03typed agent-to-agent signals
- 04workflow orchestration (Beams)
- 05onchain creditworthiness oracles
- mix archive.install hex lux
- mix new my_agent --sup && cd my_agent
| Variable | Scope | Description |
|---|---|---|
| SPECTRAL_API_KEY | Server | API key for Spectral platform services (credit scoring, agent registry). |
| AGENT_PRIVATE_KEY | Server | Hex EVM private key for the agent's onchain identity. Server-only. |
| OPENAI_API_KEY | Server | LLM provider key used by Lux Prisms that wrap reasoning models. |
Use Spectral's Lux framework to compose multi-agent finance workflows. In Elixir, `defmodule MyAgent do use Lux.Agent ... end` — declare `Signals` (Pydantic-like typed messages), `Prisms` (pure functional units, e.g. an LLM call or a Uniswap quote), `Beams` (workflow DAGs that route signals between agents), and `Lenses` (adapters to external services / RPC). Each agent runs as an OTP process, so supervision and back-pressure come for free. For Spectral-native services (credit scores, Onyx-style markets), call the Spectral API from a Lens and bind the response into a Beam that triggers a signed onchain action through `agent_private_key`. For non-Elixir teams, the Lux multi-language bindings expose the same agents via Python or JS shells — but the canonical runtime is BEAM/Elixir.
- ⚑Lux is Elixir-first — JS/Python shells exist but lag in features and are not recommended for production-critical paths.
- ⚑Signals are strictly typed; mismatched schemas between agents drop messages at the supervisor without a clear error to the LLM layer.
- ⚑Beams orchestrate parallel agent execution — a poorly-bounded Beam can fan out and trigger many onchain transactions at once; cap concurrency per Beam.
- ⚑Spectral credit/agent APIs are rate-limited; batch lookups inside a Lens rather than calling per signal.
- ⚑Agent EOAs sign autonomously inside a Prism — set per-agent USD spend ceilings and require multisig confirmation for amounts above a threshold.
- ⚑Replay safety: include a chain-tagged nonce in any signal that ultimately produces an onchain tx, otherwise re-running a Beam can double-execute.