-- A Ref DCL pool's state and swap whitelist, kept when they change. -- blackbeard/observer#45. -- -- Both are read every minute (refdcl::pools) and were only ever held in memory, -- so a pool paused, or a solver dropped from its whitelist, during a stretch -- with no quotes would leave no trace afterwards. That is exactly the context -- a pause needs: "the pool stopped" and "the quotes stopped while the pool ran" -- are different events. A row is written only when either differs from the -- latest one for the pool, so the table is a list of changes, and the first -- row is the state as first seen. create table ref_pool_settings ( chain text not null references chain (id) on delete cascade, pool_id text not null, at timestamptz not null, state text not null, -- Sorted, so equal whitelists compare equal. whitelist jsonb not null, primary key (chain, pool_id, at) );