MUTATE
// Documentation

Docs

Development

Requirements

Node 22 or newer, Docker, and a Reown project id for wallet connections.

First run

npm install
cp .env.example .env.local        # then fill in the values below
docker start mutate-postgres-1 mutate-redis-1   # or your own Postgres and Redis
npm run db:migrate
npm run dev                       # http://localhost:3000
npm run worker                    # in a second terminal

Postgres listens on port 54329 and Redis on 56379 (see .env.example).

Environment

The full list is in .env.example. The values you need first:

VariablePurpose
APP_URL, NEXT_PUBLIC_APP_URLThe site origin; write routes reject other origins
NEXT_PUBLIC_REOWN_PROJECT_IDWallet connections. Add the site's domain in the Reown dashboard
DATABASE_URL, REDIS_URLData stores
SOLANA_CLUSTER, SOLANA_RPC_URLS, NEXT_PUBLIC_SOLANA_RPC_URLChain access. Only devnet executes transactions
PROTOCOL_METADATA_AUTHORITYRequired to prepare a launch: the protocol wallet's public key
PUBLIC_METADATA_BASE_URLA public origin serving /api/metadata and /api/media; localhost is rejected
METADATA_VOTING_MINUTES, METADATA_PROPOSAL_COOLDOWN_HOURSHolder vote length on identity changes (default 10) and the wait before the creator may propose another change for the same token (default 24)
DBC_MIGRATION_USD_TARGETGraduation target in USD (default 750)
MUTATE_MUTATION_FEE_USD_CENTSThe one-time mutation fee in USD cents (default 1900)
MUTATE_TOKEN_MINT, MUTATE_PRICE_API_KEYNeeded for any $MUTATE quote or burn
IMAGE_PROVIDERopenai (default) or mock. mock is devnet only: no API key, fake deterministic edits
MUTATE_DEVNET_USD_PRICEDevnet only: fixed USD price for $MUTATE (replaces the Jupiter key). Also makes $MUTATE selectable as a pair
JUPITER_TOKENS_API_URLOptional override for the token list API
BLOB_READ_WRITE_TOKENOptional. When set, images go to a private Vercel Blob store instead of UPLOAD_DIR
DATABASE_POOL_MAXOptional. Connections per process (default 5)

Image generation needs an OpenAI key and is disabled otherwise: image jobs then fail with IMAGE_GENERATION_DISABLED.

Commands

CommandWhat it does
npm run devDev server (webpack)
npm run workerBackground job worker
npm run typecheck, npm run lintStatic checks
npm testUnit tests
npm run test:integrationDatabase integration tests (RUN_DB_TESTS=1)
npm run db:generateCreate a migration from schema changes
npm run db:migrateApply migrations
npm run checkLint, types, tests, Anchor tests and a build

Notes

  • The public devnet RPC rate limits aggressively. A worker with a backlog of reconcile jobs can trigger 429 errors; a dedicated RPC fixes this.
  • Clear the cached quote list after changing CURATED_QUOTE_MINTS: delete the quote-assets:* keys in Redis.
  • The Vercel deployment serves the front end only. It has no database, Redis, upload storage or worker.
  • Commits carry no tool attribution.