Config precedence
flags > env > config file > defaults
Default config path:
Useful env vars
| Variable | Purpose |
|---|---|
DEFI_OUTPUT | json or plain |
DEFI_TIMEOUT | Provider/planner request timeout |
DEFI_RETRIES | Retries per request |
DEFI_MAX_STALE | Stale fallback window |
DEFI_NO_STALE | Disable stale fallback |
DEFI_NO_CACHE | Disable cache |
DEFI_CACHE_PATH | Cache DB path |
DEFI_CACHE_LOCK_PATH | Cache lock path |
Cache behavior
- Fresh cache hits (
age <= ttl) return immediately. - After TTL expires, CLI refetches providers.
- Stale data is served only when providers fail temporarily (
unavailableorrate_limited) and withinmax_stale. - Cache writes use SQLite WAL + busy timeout + lock/backoff retries to reduce lock contention in parallel runs.
- If cache init fails (path/permissions), commands continue with cache disabled.
- Metadata commands (
version,schema,providers list,chains list) bypass cache initialization.
Command TTLs
| Command | TTL |
|---|---|
chains top, chains assets, protocols top, protocols categories, protocols fees, protocols revenue, dexes volume, stablecoins top, stablecoins chains | 5m |
lend markets, yield opportunities, bridge list, bridge details | 60s |
lend rates, lend positions, yield positions | 30s |
yield history | 5m |
bridge quote, swap quote | 15s |
plan, run, submit, status) and action inspection (actions list|show|estimate) bypass cache reads/writes.
Strict mode
If any selected provider fails and partial results occur,--strict returns exit code 15 (partial_results).
