Factory
The Factory is used to deploy any PrincipalToken and Curve pools permissionlessly.
Factory.sol code can be found on GitHub.
Methods
deployPT
Deploys the PrincipalToken contract implementation.
See also PrincipalToken.
Input Parameter | Type | Description |
---|---|---|
_ | address | The IBT of the PrincipalToken to be deployed |
| uint256 | The duration of the pt |
Return Parameter | Type | Description |
---|---|---|
| address | The address of the PrincipalToken that was deployed |
deployCurvePool
Deploy a curve pool for the specific _pt
instance with the specified curvePoolParams
Input Parameter | Type | Description |
---|---|---|
_ | address | The IBT of the PrincipalToken to be deployed |
| The parameters of the curve pool to be deployed |
Return Parameter | Type | Description |
---|---|---|
| address | The address of the curve pool that was deployed |
CurvePoolParams
The curve pool parameters as defined in the curve pool documentation is a struct that hold the curve pool parameters.
Struct Parameter | Type | Description |
---|---|---|
| uint256 | Amplification Parameter [4,000 to 4,000,000,000] Larger values of A make the curve better resemble a straight line in the center (when pool is near balance). Highly volatile assets should use a lower value, while assets that are closer together may be best with a higher value. |
| uint256 | The gamma parameter can further adjust the shape of the curve. Default values recommend .000145 for volatile assets and .0001 for less volatile assets. |
| uint256 | [.005% to 1%] Percentage. Fee when the pool is maximally balanced. This is the minimum fee. The fee is calculated as |
| uint256 | [Mid Fee to 1%] Fee when the pool is imbalanced. Must be larger than the Mid Fee and represents the maximum fee. |
| uint256 | [0 to .01] As the pool takes profit, the allowed extra profit parameter allows for greater values. Recommended 0.000002 for volatile assets and 0.00000001 for less volatile assets. |
| uint256 | [0 to 1] Adjusts how fast the fee increases from Mid Fee to Out Fee. Lower values cause fees to increase faster with imbalance. Recommended value of .0023 for volatile assets and .005 for less volatile assets. |
| uint256 | [0 to 1] As the pool rebalances, it will must do so in units larger than the adjustment step size. Volatile assets are suggested to use larger values (0.000146), while less volatile assets do not move as frequently and may use smaller step sizes (default 0.0000055) |
| uint256 | |
| uint256 | [0 to 604,800] In seconds -- the price oracle uses an exponential moving average to dampen the effect of changes. This parameter adjusts the half life used. |
| uint256 | The price of coin0 with respect to coin1. This price set the initial liquidity concentration |
deployAll
Deploy a Principal Token, a curve pool and a LP Vault associated with the PT and the deployed curve pool in a single transaction.
Input Parameter | Type | Description |
---|---|---|
_ | address | The IBT of the PrincipalToken to be deployed |
| uint256 | The duration of the PT contract to deploy |
| The parameters of the curve pool to be deployed |
Return Parameter | Type | Description |
---|---|---|
| address | The address of the PT that was deployed |
| address | The address of the curve pool that was deployed |
| address | The address of the LP Vault that was deployed |
View Methods
getRegistry
Returns the address of Registry contract.
getCurveAddressProvider
Returns the address of the Curve address provider.
getCurveFactory
Returns the address of the Curve Factory.
getInitialPrice
Return the initial_price parameter of the curvePool
.
getCurveFactoryAddress
Returns the address of the associated Curve Factory.
Last updated