Plumbing for secure queries against revenue