Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(market-maker): add missing avg_entry_price_lamports + trade_count columns

nirholas329dcb68de60
diff --git a/api/_lib/migrations/20260718010000_mm_config_columns.sql b/api/_lib/migrations/20260718010000_mm_config_columns.sql
new file mode 100644
index 000000000..0d40e33c3
--- /dev/null
+++ b/api/_lib/migrations/20260718010000_mm_config_columns.sql
@@ -0,0 +1,13 @@
+-- Market-maker config: add the two columns the worker reads and writes but the
+-- original table never defined.
+--
+-- workers/agent-sniper/market-maker.js loadEnabledConfigs() selects
+-- avg_entry_price_lamports and trade_count, and recordTrade() updates both. The
+-- creating migration (20260626200000_agent_capabilities.sql) shipped the table
+-- with total_buys/total_sells but neither of these, so every market-maker tick
+-- threw "column c.avg_entry_price_lamports does not exist" (Postgres validates
+-- columns at plan time, so an empty config set still failed). Additive and
+-- idempotent — safe to re-run.
+ALTER TABLE agent_market_maker_configs
+ ADD COLUMN IF NOT EXISTS avg_entry_price_lamports NUMERIC NOT NULL DEFAULT 0,
+ ADD COLUMN IF NOT EXISTS trade_count INTEGER NOT NULL DEFAULT 0;