Builders
Use Drizzle ORM or Prisma. Prefer SQL migrations committed to git. Addresses are stored lowercase for lookup plus checksum formatting at presentation.
usersid uuid pkwallet_address varchar(42) uniquerole enum(user,admin,superadmin)created_atlast_login_atagentsid uuid pkslug text uniquecreator_user_id uuidname textticker textshort_description textpersonality texttemplate_id textstatus enum(draft,launching,live,chat_disabled,archived)avatar_url textbeneficiary_address varchar(42) — cache of on-chain vault beneficiary; refresh from BeneficiaryUpdatedfee_vault_owner varchar(42) — cache of vault owner; refresh from OwnershipTransferredfee_vault_address varchar(42)is_verified boolis_platform_token boolcreated_at, updated_at, launched_atagent_prompt_versionsid uuid pkagent_id uuidtemplate_version textcreator_config jsonbcapabilities jsonbsystem_prompt_hash textactive boolDo not store platform secrets in prompt rows.
agent_sourcesid uuidagent_idtypelabelurl_or_refconfig_encrypted jsonb only if necessaryenabledlaunch_intentsid uuidagent_idcreator_addressadapterchain_id bigintfee_vault_addresseconomics_hashtx_totx_value numeric(78,0)tx_data_hashexpires_atsubmitted_tx_hash nullablestatustokenschain_id bigintaddress varchar(42)namesymboldecimalsagent_id nullablecreated_block bigintcreated_tx_hash(chain_id,address)launcheschain_idtoken_addresscurve_addressdeployer_addresspair_token_address nullablelaunch_config_id numericgraduation_threshold numericphase enum(curve,graduating,pool)pool_id/address nullableblock_numberblock_hashtradeschain_idtoken_addresstx_hashlog_index intblock_numberblock_hashside enum(buy,sell)token_amount numeric(78,0)quote_amount numeric(78,0)fee_amount numeric(78,0)creator_tax_amount numeric(78,0)timestamp(chain_id,tx_hash,log_index)market_snapshotsTime-series derived metrics, not chain source of truth.
fee_splitschat_sessionschat_messagesApply retention policy and avoid persisting raw hidden reasoning.
agent_usage_dailyidentity_generationsAudit/cost rows for wizard Generate with Grok jobs (not chat).
id uuid pkuser_id uuidagent_id uuid nullabletemplate_id textseed_hash text (do not require storing raw seed forever)model textimage_model textstatus enum(pending,completed,failed)identity_json jsonb (generated fields snapshot)avatar_candidate_urls jsonbselected_avatar_url text nullablecreated_atagent_usage_daily (extended)Also track identity_generations and identity_images counters per user/day for rate limits when no agent yet exists — either here with nullable agent_id or a sibling user_usage_daily table.
boost_burnsboost_campaignsadmin_audit_logindexer_checkpointsAt minimum:
(chain_id, token_address, block_number desc, log_index desc)(status, launched_at desc)(deployer_address)(agent_id)(chain_id, token_address, bucket_ts desc)(status, starts_at, ends_at)(session_id, created_at)Nightly pg_dump encrypted/off-host + DigitalOcean snapshot strategy. Test restoration before launch.