Essays on Dynamic Optimization for Markets and Networks