Charm Finance
  • Charm Overview
    • The mission
  • Products Overview
    • Alpha Vaults
      • Whitepaper
      • FAQ
    • Charm Simulator
  • Provide Liquidity
    • Overview
    • The Benefits
    • Risks and Mitigants
    • Charm Vaults
    • Community Vaults
    • Conclusion
    • Fees
    • FAQ
    • User Guides
      • Home Page
      • Depositing and Withdrawing
      • Vault Information Page
      • Performance Page
      • Portfolio Page
  • Manage Liquidity
    • Overview
    • The Benefits
    • Challenges and Solution
    • Uses Cases
    • How it works
    • Risks and mitigants
    • Conclusion
    • Fees
    • FAQ
    • User Guides
      • Create Vault
        • Default Values
        • Next Steps
      • Vault Parameters
      • Rebalancing
      • Verifying Vaults
      • Capital Efficiency
      • Other Features
      • Best Practices
      • Walkthroughs
        • Create Vault
        • Edit Vault
        • Automating Rebalance
        • Verify Manager
  • Technical References
    • Overview
    • Core
      • AlphaProVault
      • AlphaProVaultFactory
      • CloneFactory
      • Interfaces
    • Periphery
    • Error Codes
    • Contract Addresses
    • Subgraph
  • Links
    • Alpha Vaults v2
    • Contracts
    • Blog
  • Appendix
    • Glossary
    • Audit Reports
    • Team
    • Charm's Investors
    • 中文版
  • Research
    • Medallion
      • Whitepaper
      • FAQ
      • Decentralised competition
  • Previous Products
    • Alpha Vaults v1
    • Charm Options
      • Key Features
        • Capital Efficiency
      • Use Cases
      • How trading works
      • How liquidity provision works
      • Trading Tutorials
        • Open a position
          • Notes
        • Close a position
        • Settlement
      • Liquidity Provision Tutorials
        • Provide liquidity
        • Withdraw Liquidity
    • Cube Tokens
      • How it works
Powered by GitBook
On this page
  • createVault
  • numVaults
  • setProtocolFee
  • setGovernance
  • acceptGovernance
  • Getter functions for public variables
  1. Technical References
  2. Core

AlphaProVaultFactory

The contract that creates liquidity vaults.

createVault

function createVault(
  VaultParams calldata params,
) external returns (address vaultAddress)

Creates a vault for a given set of vault parameters.

Parameters:

Varible
Type
Description

params

VaultParams

Returns:

Variable
Type
Description

vaultAddress

address

The address of the new vault after it is created.

numVaults

function numVaults() external view returns (uint256)

Return Value:

Variable
Type
Description

vaults.length

uint256

The number of vaults created by the factory.

setProtocolFee

function setProtocolFee(uint256 _protocolFee) external onlyGovernance

Sets the protocol fee as a % of fees received from Uniswap. Can only be called by Charm Governance.

Parameters:

Variale
Type
Description

uint256

The amount of protocol fees as a % of fees earned by the vault, with 1 unit of fees = 1e-4 % of fees earned.

The maximum protocol fee is 20000 units (20%).

setGovernance

function setGovernance(address _governance) external onlyGovernance

The first step to change the address of Charm Governance. Can only called by Charm Governance.

Parameters:

Variable
Type
Description

address

acceptGovernance

function acceptGovernance() external

The second step to to change the address of Charm Governance. Can only be called by the address assigned to _governance.

State Changes:

Variable
Type
Description

governance

address

Setting the value of _governance as the new Charm Governance address.

Getter functions for public variables

Getter functions are automatically generated for the following public variables:

Variable
Type
Description

template

address

vaults

array

The array that contains the address of all the vaults created by Alpha Vaults.

isVault

mapping

The mapping used to check whether a vault have been created by Alpha Vaults.

governance

address

The address of Charm Governance.

pendingGovernance

address

protocolFee

uint256

The protocol fee applied to all vaults created using Alpha Vaults.

PreviousAlphaProVaultNextCloneFactory

Last updated 8 months ago

The custom data structure containing the variables and assigned values.

The new address of Charm Governance. The changes will not take effect until the new address calls

The address of the template vault used by to clone and create LP vaults.

The provisional address of Charm Governance. Not finalised until it calls calls

_protocolFee
_governance
Vault Parameters'
accepGovernance
createVault
accepGovernanc