Skip to main content
This contract is owned and managed by the product’s team. It allows developers to deploy and set up their own pools. The following are the main technical aspects of this contract: See FactoryBase.sol.

Deployers Allow List

In order for a developer to be able to use the factory, they must first be added to the allow list in the Factory contract. Currently, only the product team can add or remove a deployer to the allow list. If you are interested in using our product and being added to the allow list, reach out at liquidity@thrackle.io .

Pool Configurations

For the pool to be properly setup, it is important to understand the parameters that it requires:

Pairs

A pool serves as a trading means for a pair of ERC20 tokens. This pair is composed of one ERC20 that we will call the x-token and another ERC20 that we will call the y-token aka collateral token.

Available y Tokens

This token can be chosen from a predetermined list which is maintained by the product’s team. Currently available y-tokens are: Note: The pool’s default for decimals is 18. Upon creation of a pool an offset will be set for Collateral tokens with less than 18 decimals. The offset will be applied during swaps to make sure the difference in decimals is accounted for.

x Token

This can actually be any ERC20 token, even y tokens, as long as it complies with the supply requirements:
  • Max Supply For x-tokens: The total supply of an x-token is set at construction, immutable, and must not be more than 100 billion tokens (assuming it has 18 decimals) to be part of a pool.
  • Token uses 18 decimals: It is an expectation for the x-token to use 18 decimals.
Visit the Token Support page for a more explicit list of token requirements.

LP Fees

Pools have an LP-fee feature which initial value must be set through the factory. Take into account that this fee value can also be updated at any time in the pool contract itself after deployed. The LP fee is the percentage of the swaps that the pool will set aside as a liquidity-provider fee. The fee will be collected and accumulated in y-tokens. This is a percentage expected to be in basis points (100 -> 1%).

Curve Parameters

  • b: The slope of the tbc function. Related to the price impact of trades, if the slope is higher, a certain trade will move the price more.
  • c: The y-intercept of the tbc function. This is the price of the x-token when the pool is empty.
  • C: The concentration parameter of the tbc function.
  • lowerPrice: The initial lower price for an x-token. This is basically the initial price, in WAD, of the x-token to be bought from the pool. This value is expected in WAD (1 -> 1 * 1e18).
  • xMin: The minimum value of variable x.
  • xMax: The highest price for an x-token.
  • V: Vector field parameter.
  • Zn: A balancing quantity that needs to be added to L for fair LP fee accounting.
  • winactive: The amount of liquidity that is inactive. It cannot extract revenue, cannot further add liquidity and removal of liquidity is on a modified flow.

Protocol Fees

Protocol fees are a portion of each swap that will go towards the protocol as a compensation for its service provided. The management of the protocol fee is under complete control of the protocol, and the factory plays a central role in this management. The following are the properties of the factory’s protocol fees:
  • Protocol fees can be updated at any time only by the owner of the factory.
  • Protocol fees can be 0.
  • Protocol fees are expressed in basis points.
  • Protocol fees can be as high as 0.20%.

Factory’s protocol fee value

The factory is in charge of setting the initial value of the protocol fees of the pools at deployment time. Only the owner of the factory can set this value. The following functions are available to manage the protocol fee:

Factory’s protocol fee collector

The factory is also in charge of setting the initial address of the protocol fee collector of the pools at deployment time. Only the owner of the factory can set this value. The following functions are available to manage this address:
Notice that the process of assigning a new protocol fee collector is a 2-step process in order to prevent human errors from setting the wrong address:
  1. The owner of the factory proposes a new protocol fee collector address through the function proposeProtocolFeeCollector.
  2. The proposed protocol fee collector account then needs to call the confirmProtocolFeeCollector function to accept/confirm this role.

Usage

Deploy A New ALTBC Pool

To deploy a new ALTBC pool, call the following function on the ALTBCFactory contract:
This function returns the address of the new pool. See Pool documentation for more details.