trade logic