modified query for trade