Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
y2kappa committed Sep 12, 2024
0 parents commit 7538146
Show file tree
Hide file tree
Showing 31 changed files with 11,297 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .env.localnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
APP=production
RPC_ENDPOINT=http://127.0.0.1:8899
SECRET_PATH=./liquidator-1702618174920-137832.json
BASE_TOKEN=SOL
MARKETS=HRD4EwVmvAsgiB9imVSBpwnartdcz4SaWYJWUzvNgR11
TARGETS=WSOL:1000
KAMINO_PROGRAM_ID=E6qbhrt4pFmCotNUSSEh6E5cRQCEJpMcd79Z56EG9KY
KAMINO_GLOBAL_CONFIG=GKnHiWh3RRrE1zsNzWxRkomymHc374TvJPSTv2wPeYdB
JLP_POOL=5BUwFW4nRbftYTDMbgxykoFWqWHPzahFSNAaaaJtVKsq
RAYDIUM_PROGRAM_ID=devi51mZmdwUJGU9hjN27vEz64Gps7uUefqxg27EAtH
SERVER=false
12 changes: 12 additions & 0 deletions .env.rust.mainnet-beta
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CLUSTER=https://mainnet.helius-rpc.com/?api-key=YOURKEY
KEYPAIR=./rust_liquidator.json
REBALANCE_PADDING_USD=0.2
RUST_BACKTRACE=1
#PROGRAM_ID=SLendK7ySfcEzyaFqy93gDnD3RtrpXJcnRwb6zFHJSh
RUST_LOG=info
LIQUIDATOR_LOOKUP_TABLE_FILE=.lookuptable.rust.mainnet-beta
BASE_CURRENCY=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
MIN_SOL_BALANCE=1.0
USDC_MINT=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
REBALANCE_SLIPPAGE_PCT=0.3
NON_SWAPPABLE_DUST_USD_VALUE=0.1
57 changes: 57 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Rust

on:
push:
branches:
- master
- 'release/**'
pull_request:
branches:
- master
- 'release/**'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
rust_fmt_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install essential
run: |
sudo apt-get update
sudo apt-get install -y pkg-config build-essential libudev-dev
- uses: dtolnay/rust-toolchain@1.73.0
with:
components: clippy
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "ts-tests"
- name: Set up SSH keys
uses: webfactory/ssh-agent@v0.7.0
with:
# Use hubbleprotocolbot's key:
# - docker+cargo fails when mounting multiple keys (https://github.com/docker/buildx/issues/341)
# - GitHub does not support reusing deploy keys
ssh-private-key: |
${{ secrets.HUBBLEPROTOCOLBOT_GITHUB_KEY }}
- uses: actions-rs/cargo@v1
name: Rust format
with:
toolchain: nightly
command: fmt
args: --all -- --check
- uses: actions-rs/clippy-check@v1
name: Clippy
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all -- --deny warnings
- name: Cargo test
run: |
cargo test
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# generated
**/node_modules
ts-tests/src/@codegen/jup-perps
.cargo

# production
/build
ts-tests/dist
.env
.env.production
.env.devnet
.env.mainnet-beta

# misc
id.json

.idea/

test-ledger/
yarn-error.log
tmp

helm/charts
liquidator.json
target/

/config/routing_config.json
rust_liquidator.json
1 change: 1 addition & 0 deletions .lookuptable.mainnet-beta
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5s85qJWKLZGBQ6dscpqXi5tP1TMuhrp7avvkF5AmPes9
1 change: 1 addition & 0 deletions .lookuptable.rust.mainnet-beta
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
EaXkVRPCmNJELmJuj2p78hEDMcmzbtnv6UucUjozRWx2
1 change: 1 addition & 0 deletions .lookuptable.staging
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6CrxyZKFfav5DvHWhyJvMnCc36pxurnHrQdanNAq1gv1
3 changes: 3 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
imports_granularity = "Crate"
reorder_imports = true
group_imports = "StdExternalCrate"
Loading

0 comments on commit 7538146

Please sign in to comment.