Trading networks and Hodge theory