First database function in TradeController