Margin
Profit margin configuration per operation context (payment orders, transfers, USDT). Supports global and individual user scopes.
Get current margin for user
Returns the margin for the authenticated user or a specific user
Create or update margin settings
Creates a new margin settings if it does not exist or updates the existing one. It can receive ownerId to update the margin of a specific user
Normalize Margin.ownerId to always be a User id (maintenance)
One-time maintenance operation: for each Margin whose ownerId currently points to a Branch, Client or Commercial id instead of a User id, resolves and corrects it. Processes one batch at a time — call again with the returned nextOffset until it comes back null.