Follow the guide to install Node.js.
cp ormconfig.yml.example ormconfig.yml
cp .env.example .env
npm install
npm run start:watch
npm run start:config
npx cross-env NODE_ENV=development ts-node src/cli [sub-command]
# npx cross-env NODE_ENV=development ts-node src/cli config --url http://localhost:8115
Cli configuration is set in the src/cli
module
Pool service has two main jobs:
- Update liquidity orders;
- Match providing/extracting liquidity orders.
Orders service has two main jobs:
- Update ask/bid orders;
- Match ask/bid orders.
Tasks service handles cron jobs:
- Synchronize blocks and call other services to update database;
- Send transactions to match orders.
Config service is used to store configuration of the cli app, including:
- remote url: the url of perkins-tent service;
- token pairs: the target token pairs to match;
- fee rate: the fee rate used in matching;
- key file: the file storing private key which is used in sending transaction;
Deal Maker uses a Service Container src/container
to manage services and each service can be injected as follows:
class TasksService {
constructor(
@inject(new LazyServiceIdentifer(() => modules[PoolService.name])) poolService: PoolService,
@inject(new LazyServiceIdentifer(() => modules[OrdersService.name])) ordersService: OrdersService,
) {
this.#poolService = poolService
this.#ordersService = ordersService
}
}