Skip to content
Open

V1 #1

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
08958e9
chore: remove template GitHub workflows and build artifacts from the …
Keyrxng Dec 1, 2025
72ea88b
feat: update GitHub workflow for UUSD Arbitrage Bot with new scheduli…
Keyrxng Dec 1, 2025
c67b2fb
chore: remove unused files and deps, refactor plugin structure, add e…
Keyrxng Dec 1, 2025
9413503
feat: enhance configuration and documentation for UUSD Arbitrage Bot,…
Keyrxng Dec 2, 2025
d4aded0
feat: add UUSD Peg Maintenance workflow with scheduled execution and …
Keyrxng Dec 2, 2025
e91df21
feat: add core types and configuration for UUSD Peg Maintenance Bot, …
Keyrxng Dec 2, 2025
8dd5054
feat: implement GeckoTerminal API client and types for UUSD price mon…
Keyrxng Dec 2, 2025
3509817
feat: add mock implementation of CurvePoolService for backtesting wit…
Keyrxng Dec 2, 2025
ad5b71c
feat: implement CurvePoolService for handling interactions with the C…
Keyrxng Dec 2, 2025
c3be9d0
feat: add GasEstimator class for estimating gas costs and ETH price r…
Keyrxng Dec 2, 2025
6068c56
feat: implement PriceMonitor class for UUSD/LUSD peg maintenance and …
Keyrxng Dec 2, 2025
4d744ec
feat: implement TradeCalculator for optimal trade size calculation to…
Keyrxng Dec 2, 2025
49a40e9
feat: implement TradeExecutor class for executing and simulating trad…
Keyrxng Dec 2, 2025
a917700
feat: add CLI for UUSD Arbitrage Bot with command handling and option…
Keyrxng Dec 2, 2025
b87a972
feat: enhance UUSD Peg Maintenance Bot with detailed logging and trad…
Keyrxng Dec 2, 2025
bd113ab
feat: add README documentation, update contract ABIs, and implement C…
Keyrxng Dec 2, 2025
e8500e3
feat(tests): add integration tests for Trade Executor and related ser…
Keyrxng Dec 2, 2025
24f528d
feat(tests): enhance Jest testing workflow with detailed reports and …
Keyrxng Dec 2, 2025
17adab1
feat: enhance bot configuration and environment validation with strat…
Keyrxng Dec 3, 2025
f1bf689
feat: enhance PriceMonitor and TradeCalculator with empirical formula…
Keyrxng Dec 3, 2025
c16048c
feat: update package scripts for improved execution and add validate-…
Keyrxng Dec 3, 2025
d9c46c1
feat: update integration tests to use TEST_PRIVATE_KEYS and enhance b…
Keyrxng Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@
"useGitignore": true,
"language": "en",
"words": [
"ision",
"stableswap",
"ptable",
"larg",
"tive",
"depeg",
"ohlcv",
"depegs",
"backtest",
"backtester",
"foundryup",
"backtesting",
"viem",
"twap",
"geckoterminal",
"uusd",
"lusd",
"Nektos",
"dataurl",
"devpool",
Expand Down
1 change: 0 additions & 1 deletion .dev.vars.example

This file was deleted.

24 changes: 23 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
MY_SECRET="MY_SECRET"
# UUSD Peg Maintenance Bot - Environment Variables

# Required: Private key for the hot wallet that executes trades
# Must be a valid Ethereum private key starting with 0x
# Below is Anvil Account[0] private key for dry runs and testing
HOT_WALLET_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

# Optional: Price deviation threshold to trigger action (default: 0.01 = 1%)
# Only trades if UUSD price deviates more than this from $1.00
DEVIATION_THRESHOLD=0.01

# Optional: Maximum gas price in gwei (default: 50)
# Skips trading if gas price exceeds this value
MAX_GAS_PRICE_GWEI=50

# Optional: Maximum slippage tolerance (default: 0.05 = 5%)
# Transaction will revert if actual slippage exceeds this
MAX_SLIPPAGE=0.01

# Optional: Enable trade execution (default: false)
# Set to "true" to actually execute trades
# Keep as "false" for dry-run/simulation mode
EXECUTE_ENABLED=false
3 changes: 1 addition & 2 deletions .github/knip.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { KnipConfig } from "knip";

const config: KnipConfig = {
entry: ["src/action.ts"],
project: ["src/**/*.ts", "tests/**/*.ts"],
ignore: ["src/types/config.ts", "**/__mocks__/**", "**/__fixtures__/**"],
ignoreExportsUsedInFile: true,
ignoreDependencies: ["ts-node"],
ignoreBinaries: ["tsx", "anvil"],
eslint: true,
};

Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/compute.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/deno-deploy.yml

This file was deleted.

40 changes: 35 additions & 5 deletions .github/workflows/jest-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,41 @@ jobs:
with:
fetch-depth: 0

- name: Jest With Coverage
- name: Install dependencies
run: bun install --frozen-lockfile

- name: Jest With Coverage (Unit Tests)
run: bun run test

- name: Save Unit Test Report
if: always()
run: |
echo "## Unit Tests" >> $GITHUB_STEP_SUMMARY
echo "$(cat test-dashboard.md)" >> $GITHUB_STEP_SUMMARY

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Start Anvil
run: bun run test:anvil &

- name: Wait for Anvil
run: |
bun install --frozen-lockfile
bun run test
for i in {1..30}
do
if curl -s http://127.0.0.1:8545; then
break
fi
sleep 1
done || exit 1

- name: Add Jest Report to Summary
- name: Jest Integration Tests
run: bun run test:integration

- name: Save Integration Test Report
if: always()
run: echo "$(cat test-dashboard.md)" >> $GITHUB_STEP_SUMMARY
run: |
echo "## Integration Tests" >> $GITHUB_STEP_SUMMARY
echo "$(cat test-dashboard.md)" >> $GITHUB_STEP_SUMMARY
51 changes: 51 additions & 0 deletions .github/workflows/peg-maintenance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: UUSD Peg Maintenance

on:
schedule:
# Run every 6 hours
- cron: "0 */6 * * *"
workflow_dispatch:
inputs:
dry_run:
description: "Dry run (don't execute trades)"
required: false
default: "true"
type: choice
options:
- "true"
- "false"

jobs:
maintain-peg:
name: Check and Maintain UUSD Peg
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Run Peg Maintenance
env:
HOT_WALLET_PRIVATE_KEY: ${{ secrets.HOT_WALLET_PRIVATE_KEY }}
DEVIATION_THRESHOLD: ${{ vars.DEVIATION_THRESHOLD || '0.01' }}
MAX_GAS_PRICE_GWEI: ${{ vars.MAX_GAS_PRICE_GWEI || '50' }}
MAX_SLIPPAGE: ${{ vars.MAX_SLIPPAGE || '0.01' }}
EXECUTE_ENABLED: ${{ github.event_name == 'schedule' && 'true' || github.event.inputs.dry_run != 'true' }}
run: bun run src/action.ts

- name: Upload logs
uses: actions/upload-artifact@v4
if: always()
with:
name: peg-maintenance-logs-${{ github.run_id }}
path: logs/
retention-days: 30
19 changes: 0 additions & 19 deletions .github/workflows/release-please.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/update-configuration.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/worker-delete.yml

This file was deleted.

Loading