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 git@gitlab.com:flarenetwork/fasset-bots.git
cd fassets-bots
If you are beta tester, switch to branch private_beta_v.1.0
.
git checkout private_beta_v.1.0
Install fasset-bots
yarn && yarn build
Follow this step by step guide to setup 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-challenger
for Challenger. -
Run
yarn run-liquidator
for Liquidator. -
Run
yarn run-systemKeeper
for SystemKeeper. -
Run
yarn run-timeKeeper
for 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 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
proveAndUpdateUnderlyingBlock
before 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)
-
Coston
- https://faucet.flare.network - 100 CFLR per account per day