In addition to paying and receiving surplus collateral in the input/output of swap, mint and burn calls user can directly deposit, withdraw or transfer their surplus collateral balance.
All of these surplus collateral use callpath 0 with specific
Deposits
To deposit surplus collateral, the user should call the following user command:
recv - The address the surplus collateral will be credited
value - The total amount deposited
token - The address of the ERC20 token deposited or address(0) for native Ethereum)
Note that deposit will use transferFrom() in to deposit the surplus collateral, so the user must approve or permit at least value amount of the token. In the case of native Ethereum, the deposit is collected from msg.value so the user must attach at least the amount matching the value parameter to the Ethereum transaction.
For EIP-2612 compliant tokens, users can deposit using an off-chain permit signature avoiding the need to approve the DEX contract: