Comment on page
Voltz Margin Engine Contract
The Margin Engine is responsible for the management of the underlying assets that collateralize traders and liquidity providers. At the maturity of an IRS pool, it facilitates cash flow movements between positions in the pool in order to settle active interest rate swap contracts initiated before the pool maturity.
The Margin Engine the has 2 key responsibilities:
- Traders and Liquidity Providers can either add or remove underlying tokens from their margin account via the Margin Engine
- After the maturity of the IRS pool, traders and liquidity providers can settle their interest rate swaps via the Margin Engine
The updatePositionMargin function updates the position margin account balance in the underlying ERC20 token, the position can be uniquely identified by its owner address, upper and lower ticks.
If a position is engaged in active interest rate swaps it is only possible to remove margin as long as the remaining balance in the margin account is above or equal to the liquidation margin requirement of the position.
Adding margin on behalf of a position owner can be done by any address (
function updatePositionMargin(address _owner, int24 _tickLower, int24 _tickUpper, int256 _marginDelta) external nonpayable
The settlePosition function can only be called after a given IRS pool has matured. A position with an active interest rate swap can call settlePosition in order to settle (fixed-to-variable or variable-to-fixed) cashflows with the pool.
function settlePosition(address _owner, int24 _tickLower, int24 _tickUpper) external nonpayable