ftdemo
This crate combines the SQLite implementation of fts-sqlite with the REST API of fts-server to product a binary suitable for interactive demonstration of flow trading functionality. As suggested by the name, correctness and simplicity are prioritized over performance, though the use of SQLite nevertheless enables very fast operations.
It is recommended to pair this binary with a frontend client, such as this one. The client provides a graphical, administrative interface for familiarizing oneself with the primitives and operations of flow trading and how a forward market might be built upon this foundation.
Configuration
Run the binary with the --help flag to see the available CLI arguments.
# Build and run the binary in one step
# OR,
# (1) build the binary...
# ... and (2) run the binary
This output is duplicated below:
)
As suggested by this output, a .env file may alternatively be provided to specify these configuration options (useful for container-based deployments).
Note that --trade-rate / TRADE_RATE is specified as a string that can be parsed by humantime, e.g. 1h or 30min. This value provides the units for auths and costs, e.g. if an auth specifies a max_rate of 5 and the server was configured with --trade-rate 1h, then this means the authorization allows for trading the associated portfolio at a rate not exceeding 5 units per hour.
For convenience, a compile-time feature (disabled by default) is available, that when enabled, adds a --test N flag which will print JWT tokens to stdout for 1 admin user and N randomly generated bidders, valid for 1 day, for use in external tooling and testing scenarios. Use with the appropriate care. To enable support, build with the testmode feature: