Skip to main content

Create FAssets Agent via CLI

The FAssets Bots Command Line Interface (CLI) allows you to create and manage FAssets agent bots and user tools directly from the command line. It also allows you to monitor the agent bot, create FAssets agent vaults, and interact with the FAssets system efficiently.

You can access the FAssets Agent CLI after you follow the guide on how to set up the FAssets agent.

info

Learn how to use the FAssets Agent CLI as Docker service.

Configure the Agent

You need to set up your agent's parameters like name, collateral, and fund with underlying assets.

  1. Prepare the agent settings tmp.agent-settings.json exchanging FASSET with FXRP, FBTC or FDOGE according to which underlying network you want to work on:

    docker-compose --profile cli run agent-bot --fasset FASSET create --prepare
  2. Choose a suffix for your agent's collateral pool and fill in the poolTokenSuffix field in the tmp.agent-settings.json. The poolTokenSuffix should only include uppercase letters, numbers, and the - symbol. This suffix will be used for the FAsset Collateral Pool Token. For example, for FXRP, if you use MY-ALPHA-AGENT-1, it would be FCPT-XRP-MY-ALPHA-AGENT-1.

  3. The USDX is used to back up the agent vault collateral.

  4. In the secrets.json file, the owner.XRP.address, owner.BTC.address, and owner.DOGE.address fields represent the underlying accounts that will pay transaction fees for XRP, BTC, and DOGE, respectively.

  5. Create the agent by specifying the FAsset and agent settings, noting that this operation can take up to 10 minutes because the FAssets verifies the underlying assets. This command will print out your agent's address. Exchange FASSET with FXRP, FBTC or FDOGE according to which underlying network you are creating the agent.

    docker-compose --profile cli run agent-bot --fasset FASSET create tmp.agent-settings.json

Deposit Collateral

To make your newly created agent public, it must hold enough collateral to mint one lot. This means its agent vault contract needs to be funded with the two collaterals (CFLR and a USDX) held by your owner.native.address.

You have two options: either deposit the vault collateral and buy pool collateral separately or use the system function to calculate the needed collateral for you.

Deposit Collaterals Together

To deposit both vault and pool collateral together and let the tool calculate the minimum required collateral to back the lots, you can use the depositCollateral function to the agent, specifying your created agent address in the AGENT_ADDRESS and lot size in the LOTS, as well exchange FASSET with FXRP, FBTC or FDOGE according to which underlying network you are creating the agent:

docker-compose --profile cli run agent-bot depositCollaterals AGENT_ADDRESS LOTS --fasset FASSET

Deposit Collateral Separately

  1. Deposit enough vault collateral to the agent specifying your created agent address in the AGENT_ADDRESS and the amount of the stablecoin or wrapped ETH in the AMOUNT field, as well exchange FASSET with FXRP, FBTC or FDOGE according to which underlying network you are creating the agent.

    docker-compose --profile cli run agent-bot depositVaultCollateral AGENT_ADDRESS AMOUNT --fasset FASSET
  2. Buy enough pool collateral for the agent specifying your agent's address in the AGENT_ADDRESS and the amount of the CFLR in the CFLR_AMOUNT field, as well exchange FASSET with FXRP, FBTC or FDOGE according to which underlying network you are creating the agent.

    docker-compose --profile cli run agent-bot buyPoolCollateral AGENT_ADDRESS CFLR_AMOUNT --fasset FASSET

Register the Agent as Available

You need to make your agent available to mint and redeem FAssets.

  1. Register your agent as available to the network by executing this command replacing the AGENT_ADDRESS with your agent address, as well exchange FASSET with FXRP, FBTC or FDOGE according to which underlying network you are entering the agent:

    docker-compose --profile cli run agent-bot enter AGENT_ADDRESS --fasset FASSET
  2. If you deposited enough collateral, you should see that your agent has at least one lot available by running the command replacing FASSET with FXRP, FBTC or FDOGE according to which underlying network you are running the agent.

    docker-compose --profile cli run user-bot agents --fasset FASSET

If you don't have available lots, check if the vault and pool collaterals are enough.

What's next

You can use the FAssets Agent UI to manage your agent vaults, monitor the agent bot, and perform various actions related to the FAssets agent.