Skip to main content

Factory

Factory Functions

newPool

  function newPool(
) external returns (address)

Create new pool with default parameters

isPool

  function isPool(
address b
) external returns (bool)

Returns if an address corresponds to a pool created by the factory

Parameters:

NameTypeDescription
baddressThe pool's address

getSwaapLabs

  function getSwaapLabs(
) external returns (address)

Returns swaap labs' address

transferOwnership

  function transferOwnership(
address _to
) external

Allows an owner to begin transferring ownership to a new address, pending.

Parameters:

NameTypeDescription
_toaddressThe new pending owner's address

acceptOwnership

  function acceptOwnership(
) external

Allows an ownership transfer to be completed by the recipient.

collect

  function collect(
address erc20
) external

Sends the exit fees accumulated to swaap labs

Parameters:

NameTypeDescription
erc20addressThe token's address

pauseProtocol

  function pauseProtocol(
) external

Pause the factory's pools

Pause disables most of the pools functionalities (swap, joinPool & joinswap) and only allows LPs to withdraw their funds

resumeProtocol

  function resumeProtocol(
) external

Resume the factory's pools

Unpausing re-enables all the pools functionalities

whenNotPaused

  function whenNotPaused(
) external

Reverts pools if the factory is paused

This function is called by the pools whenever a swap or a joinPool is being made

revokePoolFactoryControl

  function revokePoolFactoryControl(
address pool
) external

Revoke factory control over a pool's parameters

Parameters:

NameTypeDescription
pooladdressThe pool's address

setPoolSwapFee

  function setPoolSwapFee(
address pool,
uint256 swapFee
) external

Sets a pool's swap fee

Parameters:

NameTypeDescription
pooladdressThe pool's address
swapFeeuint256The new pool's swapFee

setPoolDynamicCoverageFeesZ

  function setPoolDynamicCoverageFeesZ(
address pool,
uint64 dynamicCoverageFeesZ
) external

Sets a pool's dynamic coverage fees Z

Parameters:

NameTypeDescription
pooladdressThe pool's address
dynamicCoverageFeesZuint64The new dynamic coverage fees' Z parameter

setPoolDynamicCoverageFeesHorizon

  function setPoolDynamicCoverageFeesHorizon(
address pool,
uint256 dynamicCoverageFeesHorizon
) external

Sets a pool's dynamic coverage fees horizon

Parameters:

NameTypeDescription
pooladdressThe pool's address
dynamicCoverageFeesHorizonuint256The new dynamic coverage fees' horizon parameter

setPoolPriceStatisticsLookbackInRound

  function setPoolPriceStatisticsLookbackInRound(
address pool,
uint8 priceStatisticsLookbackInRound
) external

Sets a pool's price statistics lookback in round

Parameters:

NameTypeDescription
pooladdressThe pool's address
priceStatisticsLookbackInRounduint8The new price statistics maximum round lookback

setPoolPriceStatisticsLookbackInSec

  function setPoolPriceStatisticsLookbackInSec(
address pool,
uint64 priceStatisticsLookbackInSec
) external

Sets a pool's price statistics lookback in seconds

Parameters:

NameTypeDescription
pooladdressThe pool's address
priceStatisticsLookbackInSecuint64The new price statistics maximum lookback in seconds

setPoolPriceStatisticsLookbackStepInRound

  function setPoolPriceStatisticsLookbackStepInRound(
address pool,
uint8 priceStatisticsLookbackStepInRound
) external

Sets a pool's statistics lookback step in round

Parameters:

NameTypeDescription
pooladdressThe pool's address
priceStatisticsLookbackStepInRounduint8The new price statistics lookback's step

setPoolMaxPriceUnpegRatio

  function setPoolMaxPriceUnpegRatio(
address pool,
uint256 maxPriceUnpegRatio
) external

Sets a pool's maximum price unpeg ratio

Parameters:

NameTypeDescription
pooladdressThe pool's address
maxPriceUnpegRatiouint256The new maximum allowed price unpeg ratio