# @tracer-protocol/trs-keepers

> A collection of keeper bots for Tracer's Total Return Swaps

Latest version **0.0.4** (published 2022-08-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tracer-protocol/trs-keepers
pnpm add @tracer-protocol/trs-keepers
yarn add @tracer-protocol/trs-keepers
bun add @tracer-protocol/trs-keepers
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2022-08-16 |
| First published | 2022-06-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 146.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | CalabashSquash |
| Maintainers | dospore, ray_lionsmane, scaredibis |

## Links

- npm: https://www.npmjs.com/package/@tracer-protocol/trs-keepers
- Repository: https://github.com/tracer-protocol/TRS-Keepers
- npm.io page: https://npm.io/package/@tracer-protocol/trs-keepers

## Dependencies (9)

- [bn.js](https://npm.io/package/bn.js.md) ^5.2.1
- [dotenv](https://npm.io/package/dotenv.md) ^16.0.1
- [ethers](https://npm.io/package/ethers.md) ^5.6.8
- [express](https://npm.io/package/express.md) ^4.18.1
- [winston](https://npm.io/package/winston.md) ^3.8.0
- [node-fetch](https://npm.io/package/node-fetch.md) 2.6
- [prom-client](https://npm.io/package/prom-client.md) ^14.0.1
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^9.0.2
- [@types/node-fetch](https://npm.io/package/@types/node-fetch.md) ^2.6.1

## Recent versions

- 0.0.4 (latest) — 2022-08-16
- 0.0.3 — 2022-08-03
- 0.0.2 — 2022-08-03
- 0.0.1 — 2022-06-15

## README

# TRS-Keepers
## Setup
## Install and Build
```
yarn
yarn run build
```

### Watcher Specific Variables.
These variables are specific to the Watcher. If you don't set them, defaults are in place.
```
WATCHER_STALE_THRESHOLD = Time in seconds before the Median price is considered stale in the watcher. Default = 5s
WATCHER_PRICE_DIFF_THRESHOLD = Percent (in 10^18 units) deviation that is acceptable between the median price and keeper price. Default = 5% (0.05×10^18)
```

# Docker
Make sure you have docker installed on your machine or environment.
You can check you have docker by running `docker -v` in your terminal of choice.

Create a trs-keepers docker image with `npm run docker:build-keepers` or `yarn docker:build-keepers`. This images starts a `PriceKeeper` and `PositionKeeper`.
Create a watcher docker image with `npm run docker:build-watcher` or `yarn docker:build-watcher`.

The created image does not include the required env variables OR any of the optional watcher variables.
- RPC_URL - Network RPC (required)
- SIGNING_PRIVATE_KEY - permissioned account to call updatePrices (required)
- PRICE_FEED - price feed contract address (required)
- POSITION_ROUTER - position router contract address (required only for trs-keepers)

## Run the image
Start running the `PriceKeeper` and `PositionKeeper`
- on Arbitrum `docker run -p 9111:9111 -e ARBITRUM_RPC="https://arb1.arbitrum.io/rpc" -e SIGNING_PRIVATE_KEY="A_PERMISSIONED_PRIVATE_KEY" -e PRICE_FEED="priceFeed address" -e POSITION_ROUTER="positionRouter address" trs-keepers`
- on Arbitrum rinkeby `docker run -p 9111:9111 -e ARBITRUM_TESTNET_RPC="https://rinkeby.arbitrum.io/rpc" -e SIGNING_PRIVATE_KEY="A_PERMISSIONED_PRIVATE_KEY" -e PRICE_FEED="priceFeed address" POSITION_ROUTER="positionRouter address" trs-keepers`

Start running the `Watcher`
- on Arbitrum `docker run -e NETWORK="42161" -e ARBITRUM_RPC="https://arb1.arbitrum.io/rpc" -e SIGNING_PRIVATE_KEY="<A_PERMISSIONED_PRIVATE_KEY>" trs-watcher`
- on Arbitrum rinkeby `docker run -e NETWORK="421611" -e ARBITRUM_TESTNET_RPC="https://rinkeby.arbitrum.io/rpc" -e SIGNING_PRIVATE_KEY="<A_PERMISSIONED_PRIVATE_KEY>" trs-watcher`

There is also the option of using a custom/private RPC in place of the public ones used here.

---
_Source: https://npm.io/package/@tracer-protocol/trs-keepers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
