import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
export const liquiditySnapshots = sqliteTable("liquidity_snapshots", {
  chain: text("chain").primaryKey(),
  payload: text("payload"),
  observedAt: integer("observed_at").notNull().default(0),
  leaseUntil: integer("lease_until").notNull().default(0),
  leaseToken: text("lease_token"),
});

export const liquidityCollectors = sqliteTable("liquidity_collectors", {
  chain: text("chain").primaryKey(),
  state: text("state"),
  provider: text("provider").notNull().default("geckoterminal"),
  leaseUntil: integer("lease_until").notNull().default(0),
  leaseToken: text("lease_token"),
  nextAttemptAt: integer("next_attempt_at").notNull().default(0),
  failures: integer("failures").notNull().default(0),
  lastStatus: integer("last_status").notNull().default(0),
  lastAttemptAt: integer("last_attempt_at").notNull().default(0),
  lastSuccessAt: integer("last_success_at").notNull().default(0),
});
