Risk management

What is the main credit-risk function of posting margin on a collateralized derivatives position?