This repository has been archived by the owner on Oct 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first commit of open-source liquidator
- Loading branch information
Showing
29 changed files
with
23,890 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
module.exports = { | ||
root: true, | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint'], | ||
extends: [ | ||
'eslint:recommended', | ||
'airbnb-typescript', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
], | ||
env: { | ||
node: true, | ||
jest: true, | ||
es6: true, | ||
}, | ||
parserOptions: { | ||
project: ['./tsconfig.eslint.json', './tsconfig.json'], | ||
ecmaVersion: 2015, | ||
sourceType: 'module', | ||
tsconfigRootDir: __dirname, | ||
}, | ||
rules: { | ||
'no-shadow': 'off', | ||
'jest/no-focused-tests': 0, | ||
'class-methods-use-this': 0, | ||
'no-use-before-define': 0, | ||
'no-await-in-loop': 0, | ||
'no-underscore-dangle': 0, | ||
'no-trailing-spaces': ['error', { ignoreComments: true }], | ||
'import/prefer-default-export': 0, | ||
'global-require': 'warn', | ||
'no-restricted-imports': [ | ||
'error', | ||
{ | ||
patterns: ['..*'], | ||
}, | ||
], | ||
'@typescript-eslint/no-var-requires': 'warn', | ||
'@typescript-eslint/no-explicit-any': 0, | ||
'@typescript-eslint/explicit-module-boundary-types': 0, | ||
'@typescript-eslint/no-use-before-define': 0, | ||
'@typescript-eslint/naming-convention': [ | ||
'error', | ||
{ | ||
selector: 'variableLike', | ||
custom: { | ||
regex: '^([Aa]ny|[Nn]umber|[Ss]tring|[Bb]oolean|[Uu]ndefined)$', | ||
match: false, | ||
}, | ||
format: ['camelCase', 'PascalCase', 'UPPER_CASE'], | ||
leadingUnderscore: 'allow', | ||
trailingUnderscore: 'allow', | ||
}, | ||
{ | ||
selector: 'typeLike', | ||
custom: { | ||
regex: '^([Aa]ny|[Nn]umber|[Ss]tring|[Bb]oolean|[Uu]ndefined)$', | ||
match: false, | ||
}, | ||
format: ['PascalCase'], | ||
}, | ||
], | ||
'max-len': 'off', | ||
'no-console': 'off', | ||
}, | ||
settings: { | ||
'import/resolver': { | ||
node: { | ||
extensions: ['.js', '.jsx', '.d.ts', '.ts', '.tsx'], | ||
moduleDirectory: ['node_modules', 'src'], | ||
paths: 'src', | ||
}, | ||
}, | ||
// silence dumb react warning | ||
react: { version: '999.999.999' }, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# generated | ||
**/node_modules | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
id.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM node:16-alpine3.11 | ||
|
||
|
||
# Create Directory for the Container | ||
RUN mkdir -p /home/solend/app | ||
WORKDIR /home/solend/app | ||
|
||
# Increase heap size | ||
ENV NODE_OPTIONS=--max_old_space_size=4096 | ||
|
||
# Only copy the package.json file to work directory | ||
COPY package.json ./ | ||
# Install all Packages | ||
RUN npm install | ||
|
||
# Copy all other source code to work directory | ||
COPY src /home/solend/app/src | ||
COPY tsconfig.json /home/solend/app | ||
RUN npm run build | ||
|
||
# Start | ||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,49 @@ | ||
# solend-liquidator-bot | ||
open source version of a liquidation bot running against solend | ||
# Solend-liquidator-bot | ||
|
||
open-source version of a liquidation bot running against Solend | ||
|
||
## Overview | ||
|
||
The Solend liquidator bot identifies underwater obligations to liquidate. Solend awards liquidators a 5% bonus on each liquidation. See [Solend params](https://docs.solend.fi/protocol/parameters) for the most up-to-date parameters on each asset. This repo is intended as a starting point for the Solend community to build liquidator bots. | ||
|
||
## Usage | ||
|
||
1. Install [docker-compose](https://docs.docker.com/compose/install/) | ||
2. Verify you have docker-compose installed by running the following | ||
|
||
``` | ||
docker-compose --version | ||
``` | ||
|
||
3. Update [file system wallet](https://docs.solana.com/wallet-guide/file-system-wallet) path in docker-compose.yaml. | ||
|
||
``` | ||
version: "3.1" | ||
services: | ||
# The application image | ||
solend-liquidator: | ||
restart: unless-stopped | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
environment: | ||
- NETWORK=mainnet # solana network e.g mainnet, devnet | ||
- THROTTLE=600 # Throttle not avoid rate limiting | ||
secrets: | ||
- keypair # secret to encrypte wallet details in container | ||
secrets: | ||
keypair: | ||
file: <PATH TO KEYPAIR WALLET THAT WILL BE LIQUIDATING UNDERWATER OBLIGATIONS> | ||
``` | ||
|
||
4. Build and run service | ||
|
||
``` | ||
docker-compose up --build | ||
``` | ||
|
||
## Support | ||
|
||
PRs to improve this repo are welcomed! If you need help setting up your liquidator bot, feel free to post your questions in liquidator channel within [Solend's discord server](https://discord.gg/exscEFpB7s). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: "3.1" | ||
|
||
services: | ||
# The application image | ||
solend-liquidator: | ||
restart: unless-stopped | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
environment: | ||
- NETWORK=mainnet # solana network e.g mainnet, devnet | ||
- THROTTLE=700 # Throttle not avoid rate limiting | ||
secrets: | ||
- keypair # secret to encrypte wallet details in container | ||
|
||
secrets: | ||
keypair: | ||
file: ./id.json |
Oops, something went wrong.