Skip to main content

Prerequisites

  • Access to the ALTBC Liquidity Repo
  • An account you control added to the deployer allowlist
  • An ERC-20 token with some tokens available to initialize the pool

Get Started

1

Clone the `liquidity-altbc` repo

git clone git@github.com:Forte-Service-Company-Ltd/liquidity-altbc.git
cd liquidity-altbc
forge install
The forge install step will require a github access token to install the liquidity-base dependency.
2

Setup .env file

cp env.example .env
First, set the following values with your public/private keypair. You can use the same account for both deployer and fee collector.
DEPLOYMENT_OWNER=
DEPLOYMENT_OWNER_KEY=
FEE_COLLECTOR=
FEE_COLLECTOR_KEY=
3

Add info for base-sepolia

You can use these values to deploy a pool to base-sepolia testnet:
# base sepolia info
YTOKEN_ADDRESS=0xfAAB528466868AAD7A5732F113De93f5133EF2ea # this is a mock USDC token you can freely mint to test swaps
Y_TOKEN_ALLOWLIST=0x5B10c5EEA3d7054338D88D81593425247e261255
DEPLOYER_ALLOWLIST=0x11Bc25c9D373Eb52823cf068f84FaDf02906eD34
ALTBC_FACTORY=0xf98ec399Be2eDeA3aD58DE938460D5Cf5D4CADC4
You will also need to add the token address for the ERC-20 token you’re creating the pool with:
XTOKEN_ADDRESS=
4

Pool Initialization Parameters

You can learn more about these values on the Pool Initialization Params docs page. For the quickstart you can use these starting values:
LP_FEE_AMOUNT=0
PROTOCOL_FEE_AMOUNT=5
LOWER_PRICE_AMOUNT=1000000000000000000
XADD=1000000000000000000000000 # 1 million
XINACTIVE=0
XMIN=1000000000000000000
C=1000000000000000000
V=1000000000000000000
5

Add an RPC URL to the .env file

RPC_URL=https://sepolia.base.org
6

Create the pool

Now you’re ready to create your first pool! There is a script available in the liquidity-altbc repo for this purpose.
forge script script/deploy/deploy.s.sol:ALTBCPoolDeployment --ffi --broadcast --rpc-url $RPC_URL --gas-price $GAS_NUMBER
The above script will ultimately output the address for your trading pool. Take note of the pool address for later use.
7

Find your pool in our Swap UI

You should now be able to find your trading pool in our Swap UI! Go to the linked site, connect a wallet, select the Base Sepolia network, and you should be able to find your pool listed!
8

Make a swap

First, you’ll need to get some of the mock USDC token.
cast send $YTOKEN_ADDRESS "mint(address,uint256)" $DEPLOYMENT_OWNER 100000000 --rpc-url $RPC_URL --private-key $DEPLOYMENT_OWNER_KEY
That command will mint 100 USDC to the same wallet you used to deploy the pool. Now you can perform a swap in the UI to test everything out!