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.
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.
-
Prepare the agent settings
tmp.agent-settings.json
exchangingFASSET
withFXRP
,FBTC
orFDOGE
according to which underlying network you want to work on:docker-compose --profile cli run agent-bot --fasset FASSET create --prepare
-
Choose a suffix for your agent's collateral pool and fill in the
poolTokenSuffix
field in thetmp.agent-settings.json
. ThepoolTokenSuffix
should only include uppercase letters, numbers, and the-
symbol. This suffix will be used for the FAsset Collateral Pool Token. For example, forFXRP
, if you useMY-ALPHA-AGENT-1
, it would beFCPT-XRP-MY-ALPHA-AGENT-1
. -
The
USDX
is used to back up the agent vault collateral. -
In the
secrets.json
file, theowner.XRP.address
,owner.BTC.address
, andowner.DOGE.address
fields represent the underlying accounts that will pay transaction fees for XRP, BTC, and DOGE, respectively. -
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
withFXRP
,FBTC
orFDOGE
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
-
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 theAMOUNT
field, as well exchangeFASSET
withFXRP
,FBTC
orFDOGE
according to which underlying network you are creating the agent.docker-compose --profile cli run agent-bot depositVaultCollateral AGENT_ADDRESS AMOUNT --fasset FASSET
-
Buy enough pool collateral for the agent specifying your agent's address in the
AGENT_ADDRESS
and the amount of the CFLR in theCFLR_AMOUNT
field, as well exchangeFASSET
withFXRP
,FBTC
orFDOGE
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.
-
Register your agent as available to the network by executing this command replacing the
AGENT_ADDRESS
with your agent address, as well exchangeFASSET
withFXRP
,FBTC
orFDOGE
according to which underlying network you are entering the agent:docker-compose --profile cli run agent-bot enter AGENT_ADDRESS --fasset FASSET
-
If you deposited enough collateral, you should see that your agent has at least one lot available by running the command replacing
FASSET
withFXRP
,FBTC
orFDOGE
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.
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.