From 075e5ae191553137480801904c43982aa456cd15 Mon Sep 17 00:00:00 2001 From: smypmsa Date: Tue, 25 Mar 2025 16:25:12 +0000 Subject: [PATCH] chore: scaffold cleanup module and config for ATA closing feature --- src/cleanup/__init__.py | 0 src/cleanup/manager.py | 0 src/cleanup/modes.py | 0 src/config.py | 15 +++++++++++++++ 4 files changed, 15 insertions(+) create mode 100644 src/cleanup/__init__.py create mode 100644 src/cleanup/manager.py create mode 100644 src/cleanup/modes.py diff --git a/src/cleanup/__init__.py b/src/cleanup/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cleanup/manager.py b/src/cleanup/manager.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cleanup/modes.py b/src/cleanup/modes.py new file mode 100644 index 0000000..e69de29 diff --git a/src/config.py b/src/config.py index a2b8d15..21b26e5 100644 --- a/src/config.py +++ b/src/config.py @@ -48,6 +48,21 @@ WAIT_TIME_BEFORE_NEW_TOKEN: int | float = ( MAX_TOKEN_AGE: int | float = 0.1 +# Cleanup configuration + +# CLEANUP_MODE controls when to attempt closing token accounts (ATA) +# Options: +# - "disabled": no cleanup at all +# - "on_fail": close ATA only if a buy transaction fails +# - "after_sell": close ATA after selling, but only if token balance is zero +# - "post_session": clean up all empty ATA accounts at the end of trading session +CLEANUP_MODE: str = "disabled" + +# If True, cleanup transactions will skip priority fees (cheaper, slower confirmation) +# Set to False if you want faster confirmations (e.g. when racing for SOL reclaim) +CLEANUP_WITHOUT_PRIORITY_FEE: bool = True + + # Node provider configuration # Tested with Chainstack nodes (https://console.chainstack.com), but you can use any node provider # You can get a trader node https://docs.chainstack.com/docs/solana-trader-nodes