Implemented trade logic.