The FAsset system is a protocol that bridges assets from non-smart contract chains to Flare/Songbird. It includes bots that automate actions for various roles (agent, challenger, liquidator) in response to events that need quick reactions, such as collateral reservation, minting, redemption, low collateral ratio, and price changes.
- Agent: The main player in the FAsset system.
- Challenger: Ensures the health of the FAsset system.
- Liquidator: Liquidates bad agents.
- SystemKeeper: Keeps the FAsset system in order by opening and closing liquidations.
- TimeKeeper: Maintains the underlying block by proving and updating it to prevent the current block from being too outdated, which would otherwise shorten the time for minting or redemption payments.
Clone this repository fasset-bots and enter the fasset-bots directory.
git clone [email protected]:flarenetwork/fasset-bots.git
cd fassets-bots
If you are an open beta participant, switch to the open_beta branch.
git checkout open_beta
Install fasset-bots
yarn && yarn build
Install mysql and create a user by following this guide
- Create
.envfile containing MySQL username and password for Docker:FASSET_DB_USER="fassetbot" FASSET_DB_PASSWORD="9owYgVNocTXmRLUGPmcg" - Start the setup process by executing this Docker command:
docker compose --profile setup up - Wait until the MySQL and setup services start-up and in another terminal, connect to service to set it up:
docker compose exec setup bash - Continue with agent setup using Official Docs https://docs.flare.network/infra/fassets/deploying-agent/#configure-the-access-keys
Once you are finished with setting up the agent, stop the current docker containers and execute the command:
docker compose --profile run-agent up
Follow this guide on how to set up an Agent Bot for XRP on Testnet.
Run yarn run-agent.
The script will create AgentBotRunner. The runner will initiate needed context and connect to native network. Then it will constantly check if any active agent stored in persistent state should handle any incoming events.
In order to create new agent, deposit funds and do other manual operations, command line interface is provided agent-bot. You can access it with opening another terminal and run command yarn agent-bot [command].
Other bots can be run using ActorBaseRunner. The runner will initiate needed context and create desired actor via method async create(config: TrackedStateConfig, address: string, kind: ActorBaseKind), where ActorBaseKind determines which actor should be created.
Example for such scripts:
-
Run
yarn run-challengerfor Challenger. -
Run
yarn run-liquidatorfor Liquidator. -
Run
yarn run-systemKeeperfor SystemKeeper. -
Run
yarn run-timeKeeperfor TimeKeeper.
Helpers: In order to efficiently run Challenger, Liquidation, SystemKeeper some non-persistent state is being tracked with TrackedState and TrackedAgentState. See here.
Command line interface is provided for Agent bot, User bot and for key/password generation. For more see here.
More information about the user bot can be found here.
- How to create secrets file for agent?
- How to encrypt secrets file for agent?
- How to decrypt secrets file for agent?
- How to create agent bot and make it available?
- How to list and change agent settings?
- How to withdraw underlying?
- How to create underlying account?
- How to create wallet encryption password?
- How to list available agents?
- How to mint fassets?
- How to redeem fassets?
- How to list system info?
- How to list agent info?
Same commands as in cli agent-bot can be run via REST APIs. For more see here.
Log files are created every hour and can be found in packages/fasset-bots-core/log/.
- Run TimeKeeper or manually run
proveAndUpdateUnderlyingBlockbefore reserving collateral, before redeeming, ... - Newly created testnet XRP account should get initial deposit of at least 10 XRP. Otherwise payment to this account will be rejected by
tecNO_DST_INSUF_XRP.
-
Please reach out to our Team Members on Telegram for TestUSDC/TestUSDT tokens
-
Testnet XRP
- https://faucet.tequ.dev
- https://test.bithomp.com/faucet
- https://xrpl.org/xrp-testnet-faucet.html - 1000 XRP (not really a faucet, because it generates new address each time)
-
Testnet BTC
-
Testnet DOGE
-
Coston
- https://faucet.flare.network - 100 CFLR per account per day