Developer Docs
Search
⌃K

Factory

Voltz Factory Contract
The Factory contract is at the heart of Voltz Protocol and has two key responsibilities:
  • Management of external contract approvals to be able to interact with Voltz Protocol positions on behalf of their owners
  • Deployment of Interest Rate Swap pools

isApproved

The isApproved function checks if a given owner address has approved a given address (contract or externally owned account) to interact with IRS pools on Voltz Protocol on behalf of the owner.
function isApproved(address ownerAddress, address trustedAddress) external view returns (_isApproved bool);
Parameters
Name
Type
Description
ownerAddress
address
Address of a Voltz Protocol user
trustedAddress
address
Contract or externally owned account address
Returns
Name
Type
Description
_isApproved
bool
true if ownerAddress approved trustedAddress to interact with IRS pools on Voltz Protocol on behalf of ownerAddress

setApproval

The setApproval function lets a given ownerAddress approve (or disapprove) an address (contract or externally owned account) to interact with IRS pools on Voltz Protocol on behalf of the owner.
function setApproval(address intAddress, bool allowIntegration) external;
Parameters
Name
Type
Description
trustedAddress
address
Contract or externally owned account address
_isApproved
bool
If true, sets the approval status of the trustedAddress to true where the owner is the msg.sender, if false, the approval is revoked.

deployIRSInstance

The deployIRSInstance function deploys a Voltz Interest Rate Swap pool. Each pool on Voltz Protocol has a fixed maturity date and is linked to a yield-bearing pool with a variable rate of return. The deployIRSInstance function can only be called by the owner of the Factory contract.
function deployIrsInstance(address underlyingToken, address rateOracle, uint256 termStartTimestampWad, uint256 termEndTimestampWad, int24 tickSpacing) external returns (address marginEngineProxy, address vammProxy, address fcmProxy)
Parameters
Name
Type
Description
underlyingToken
address
Underlying ERC20 token address (e.g. address of the USDC contract on Ethereum mainnet).
termStartTimestampWad
uint256
The Unix block timestamp at which the Interest Rate Pool becomes live (the Wad suffix indicates that this number is scaled by 10^18)
termEndTimestampWad
uint256
The Unix block timestamp at which the Interest Rate Pool matures (the Wad suffix indicates that this number is scaled by 10^18)
tickSpacing
int24
The VAMM tick spacing.
Note: Only ticks with indexes that are divisible by tickSpacing can be initialized, i.e. used as boundaries when providing concentrated liquidity. Small choices for tickSpacing allow tighter and more precise ranges, but may cause Interest Rate Swaps to be more gas-intensive (since each initialized tick that a swap crosses imposes a gas cost on the swapper).
Returns
Name
Type
Description
marginEngineProxy
address
Address of the Margin Engine Proxy of the IRS pool
vammProxy
address
Address of the vAMM Proxy of the IRS pool
fcmProxy
address
Address of the Full Collateralisation Module Proxy of the IRS pool

setMasterFCM

The setMasterFCM function sets the master FCM contract implementation for a given pool.
function setMasterFCM(IFCM _masterFCM, uint8 _yieldBearingProtocolID) external override onlyOwner

Parameters

Name
Type
Description
_masterFCM
IFCM
Master FCM contract implementation for the corresponding yield bearing protocol ID
_yieldBearingProtocolID
uint8
Unique identifier for the yield bearing protocol of a pool...?

setMasterMarginEngine

The setMasterMarginEngine function sets the master margin engine contract implementation for a given pool.
function setMasterMarginEngine(IMarginEngine _masterMarginEngine) external override onlyOwner

Parameters

Name
Type
Description
_masterMarginEngine
IMarginEngine
Master Margin Engine contract implementation.

setMasterVAMM

The setMasterVAMM function sets the master vamm contract implementation for a given pool.
function setMasterVAMM(IVAMM _masterVAMM) external override onlyOwner

Parameters

Name
Type
Description
_masterVAMM
IVAMM
Master VAMM contract implementation.

setPeriphery

The setPeriphery function sets the periphery contract implementation for a given pool.
function setPeriphery(IPeriphery _periphery) external override onlyOwner

Parameters

Name
Type
Description
_periphery
IPeriphery
Periphery contract address