Skip to content

Commit a54479e

Browse files
authored
Merge branch 'main' into add-tests
2 parents 04fdbdf + 89f0b32 commit a54479e

File tree

2 files changed

+241
-1
lines changed

2 files changed

+241
-1
lines changed

docs/fassets/reference/agent-bot.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ keywords: [fassets, xrp, bitcoin, dogecoin, flare-network]
66

77
Command line reference for managing and interacting with FAssets agent bots.
88

9-
Sourced from `agent-bot.ts` on [GitHub](https://github.com/flare-labs-ltd/fasset-bots/blob/songbird-release/packages/fasset-bots-cli/src/cli/agent-bot.ts).
9+
Sourced from `agent-bot.ts` on [GitHub](https://github.com/flare-labs-ltd/fasset-bots/blob/main/packages/fasset-bots-cli/src/cli/agent-bot.ts).
1010

1111
## Setup
1212

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
---
2+
title: User Bot CLI Reference
3+
description: FAssets User Bot command line interface reference.
4+
keywords: [fassets, xrp, bitcoin, dogecoin, flare-network]
5+
---
6+
7+
Command line reference for managing and interacting with FAssets user bot. It allows users to mint and redeem FAssets, manage collateral pools, and query system information.
8+
9+
Sourced from `user-bot.ts` on [GitHub](https://github.com/flare-labs-ltd/fasset-bots/blob/main/packages/fasset-bots-cli/src/cli/user-bot.ts).
10+
11+
## Setup
12+
13+
Before running user-bot, ensure it is properly set up using the [FAsset agent deploy](/fassets/guides/deploy-fassets-agent) with Docker and then learn [how to execute the command line commands](/fassets/guides/deploy-fassets-agent#execute-fasset-bot-commands).
14+
15+
## Usage
16+
17+
To run the user-bot command line interface, use the `yarn user-bot` command with the desired command and arguments and add the `--fasset` flag with the FAsset symbol.
18+
19+
```bash
20+
yarn user-bot [command] <args> --fasset [fAssetSymbol]
21+
```
22+
23+
To list all available commands:
24+
25+
```bash
26+
yarn user-bot help
27+
```
28+
29+
To execute a specific command using the [Docker container](/fassets/guides/deploy-fassets-agent#execute-fasset-bot-commands) change `yarn user-bot` with `docker compose --profile cli run user-bot`:
30+
31+
```bash
32+
docker compose --profile cli run user-bot [command] <args> --fasset [fAssetSymbol]
33+
```
34+
35+
## General Commands
36+
37+
## System Info
38+
39+
Display information about the FAssets system.
40+
41+
```bash
42+
yarn user-bot info
43+
```
44+
45+
### List Agents
46+
47+
List available FAssets agents.
48+
49+
```bash
50+
yarn user-bot agents
51+
```
52+
53+
### Agent Information
54+
55+
Display information about a specific FAssets agent by providing the agent vault address.
56+
57+
```bash
58+
yarn user-bot agentInfo <agentVaultAddress>
59+
```
60+
61+
### Minting
62+
63+
### Mint
64+
65+
Mint the specified number of FAsset lots, specifying the number of lots to mint.
66+
67+
```bash
68+
yarn user-bot mint <numberOfLots>
69+
```
70+
71+
When executing the `mint` command, the following custom flags can be specified:
72+
73+
- **`-a <agentVaultAddress>`**
74+
Specifies the agent for minting. If omitted, the bot automatically selects the agent with the lowest fee and sufficient capacity.
75+
76+
- **`--executor <executorAddress>`** _(Optional)_
77+
Specifies the executor's native address.
78+
79+
- **`--executorFee <executorFee>`** _(Optional)_
80+
Specifies the executor's fee in NAT.
81+
82+
- **`--noWait`**
83+
Reserves and pays for minting without waiting for proof.
84+
85+
### Mint Execute
86+
87+
The `mintExecute` function is essential for completing the minting process.
88+
It handles the minting of FAssets, distributes fees, and unlocks collateral.
89+
90+
This function ensures the following:
91+
92+
- The minter receives their minted FAssets after payment is confirmed.
93+
- Agents and collateral providers are compensated for their involvement.
94+
- System stability is maintained by requiring proof of underlying payments.
95+
96+
Using this function need to specify the `requestId` of the minting request.
97+
98+
```bash
99+
yarn user-bot mintExecute <requestId>
100+
```
101+
102+
### Mint Status
103+
104+
The `mintStatus` function provides information about the current state of a minting request.
105+
It helps to track the progress of the minting process.
106+
107+
```bash
108+
yarn user-bot mintStatus
109+
```
110+
111+
### Update Mintings
112+
113+
The `updateMintings` function updates the status of all open minting requests in the FAsset system.
114+
It ensures that the system remains up-to-date by resolving minting requests based on their current state or conditions, such as time expiration or payment verification.
115+
116+
```bash
117+
yarn user-bot updateMintings
118+
```
119+
120+
## Redemption
121+
122+
### Redeem
123+
124+
The `redeem` function enables FAsset holders to burn their FAssets in exchange for the equivalent amount of the underlying asset.
125+
This ensures that FAssets can be converted to their original value on the underlying blockchain.
126+
To redeem, specify the number of FAsset lots you wish to exchange.
127+
128+
```bash
129+
yarn user-bot redeem <numberOfLots>
130+
```
131+
132+
When executing the `redeem` command, the following custom flags can be specified:
133+
134+
- **`--executor <executorAddress>`** _(Optional)_
135+
Specifies the executor's native address.
136+
137+
- **`--executorFee <executorFee>`** _(Optional)_
138+
Specifies the executor's fee in NAT.
139+
140+
### Redemption Default
141+
142+
The `redemptionDefault` function is invoked when an agent fails to fulfill their obligation to deliver the underlying asset during a redemption process.
143+
This function ensures that the redeemer is compensated, system integrity is maintained, and the agent is penalized for failing to meet their commitment.
144+
145+
Specify the `requestId` of the redemption request.
146+
147+
```bash
148+
yarn user-bot redemptionDefault <requestId>
149+
```
150+
151+
Additionally the custom flag can be specified:
152+
153+
- **`--noWait`\***
154+
Does not wait for non-payment proof. don't wait for non-payment proof, but immediately exit with exitcode 10 if the proof isn't available
155+
156+
### Redemption Status
157+
158+
The `redemptionStatus` function provides information about the current state of a redemption request in the FAsset system.
159+
160+
```bash
161+
yarn user-bot redemptionStatus
162+
```
163+
164+
### Update Redemptions
165+
166+
The `updateRedemptions` function updates the status of one or more open redemption requests. It ensures that these requests are processed efficiently and appropriately addresses any unresolved or overdue requests. This function is essential for automating the entire redemption lifecycle.
167+
168+
```bash
169+
yarn user-bot updateRedemptions
170+
```
171+
172+
## Collateral Pool Management
173+
174+
### List Collateral Pools
175+
176+
Lists all available collateral pools, including:
177+
178+
- Pool address
179+
- Token symbol
180+
- Token price (CFLR)
181+
- Collateral (CFLR)
182+
- Fees (FXRP)
183+
- Collateral Ratio
184+
185+
```bash
186+
yarn user-bot pools
187+
```
188+
189+
### Pool Holdings
190+
191+
The 'poolHoldings' function provides detailed information about the pools that user has holdings, listing:
192+
193+
- Pool address
194+
- Token symbol
195+
- Pool tokens
196+
197+
```bash
198+
yarn user-bot poolHoldings
199+
```
200+
201+
### Enter Pool
202+
203+
The `enterPool` function allows users to deposit collateral into a specific collateral pool and become a participant by specifying the collateral pool ID and collateral amount.
204+
205+
```bash
206+
yarn user-bot enterPool <poolId> <collateralAmount>
207+
```
208+
209+
### Exit Pool
210+
211+
The `exitPool` function allows participants to withdraw their share of collateral from a collateral pool by burning their Collateral Pool Tokens (CPTs) and receiving collateral. Specify the pool ID and the amount of collateral to withdraw.
212+
213+
```bash
214+
yarn user-bot exitPool <poolId> <amount|all>
215+
```
216+
217+
## Balance Management
218+
219+
## Balance
220+
221+
Displays balance for relevant tokens like FAssets, underlying, native, wrapped native, and vault collateral.
222+
223+
```bash
224+
yarn user-bot balance
225+
```
226+
227+
## Secrets Management
228+
229+
### Generate Secrets
230+
231+
The function `generateSecrets' generates a secret JSON file for user addresses and private keys.
232+
233+
```bash
234+
yarn user-bot generateSecrets --user
235+
```
236+
237+
When executing the `generateSecrets` command, the following custom flag can be specified:
238+
239+
- **`-o <filename>`** (Optional)
240+
Saves the secrets to a specified file; otherwise, they are printed to the console.

0 commit comments

Comments
 (0)