Margin management on contracts