Refactor buy and sell into transact.
Now we add to db and do queries.