Skip to content

Instantly share code, notes, and snippets.

View fengtality's full-sized avatar

Michael Feng fengtality

View GitHub Profile
@fengtality
fengtality / humidifi-swap-parser.js
Created December 4, 2025 04:36
HumidiFi Swap Parser - Decodes obfuscated swap data from HumidiFi transactions on Solana
#!/usr/bin/env node
/**
* HumidiFi Swap Parser
* Parses and decodes obfuscated swap data from HumidiFi transactions on Solana.
*
* HumidiFi obfuscates swap parameters using XOR encryption. This script decrypts
* the data and extracts: pool address, tokens involved, and swap amounts.
*
* Usage:
* node humidifi-swap-parser.js <transaction_signature>
@fengtality
fengtality / gist:5b50308455b77ac712246815397ad264
Created November 26, 2025 22:38
simple LP manager script
"""
lp_manage_position_simple.py
Simplified CLMM LP position manager that automatically rebalances positions.
This is a simpler version of lp_manage_position.py that:
- Monitors existing positions or creates new ones with user-specified token amounts
- Automatically rebalances when price moves out of position bounds
- Switches to single-sided liquidity after first rebalance for capital efficiency
{
"version": "0.1.0",
"name": "pump",
"instructions": [
{
"name": "initialize",
"docs": [
"Creates the global state."
],
"accounts": [
@fengtality
fengtality / simple_vwap_example_config.py
Created April 22, 2024 23:02
Configurable version of the Simple VWAP strategy
import logging
import os
import math
from decimal import Decimal
from typing import Dict
from pydantic import Field
from hummingbot.connector.utils import split_hb_trading_pair
from hummingbot.core.data_type.order_candidate import OrderCandidate
from hummingbot.core.event.events import OrderFilledEvent, OrderType, TradeType
@fengtality
fengtality / simple_vwap_challenge_solution.py
Last active April 22, 2024 23:40
Solution for challenge to extend simple_vwap_example_config.py
import logging
import os
import math
from decimal import Decimal
from typing import Dict
from pydantic import Field
from hummingbot.connector.utils import split_hb_trading_pair
from hummingbot.core.data_type.order_candidate import OrderCandidate
from hummingbot.core.event.events import OrderFilledEvent, OrderType, TradeType
@fengtality
fengtality / dman_v3_geometric-SOLUTION.py
Created April 17, 2024 23:47
Botcamp Challenge Solution: Using the Order Level Builder
from decimal import Decimal
from typing import Dict
from hummingbot.connector.connector_base import ConnectorBase
from hummingbot.core.data_type.common import OrderType, PositionSide, PositionAction
from hummingbot.data_feed.candles_feed.candles_factory import CandlesConfig
from hummingbot.smart_components.controllers.dman_v3 import DManV3, DManV3Config
from hummingbot.smart_components.strategy_frameworks.data_types import (
ExecutorHandlerStatus,
TripleBarrierConf,
@fengtality
fengtality / dman_v3_linear.py
Created April 17, 2024 23:44
Botcamp Challenge: Using the Order Level Builder
from decimal import Decimal
from typing import Dict
from hummingbot.connector.connector_base import ConnectorBase
from hummingbot.core.data_type.common import OrderType, PositionSide, PositionAction
from hummingbot.data_feed.candles_feed.candles_factory import CandlesConfig
from hummingbot.smart_components.controllers.dman_v3 import DManV3, DManV3Config
from hummingbot.smart_components.strategy_frameworks.data_types import (
ExecutorHandlerStatus,
TripleBarrierConf,
@fengtality
fengtality / dman_v2_std.py
Created April 17, 2024 23:38
Botcamp Challenge Solution: Customizing a Controller
import time
from decimal import Decimal
import pandas_ta as ta # noqa: F401
from hummingbot.core.data_type.common import TradeType
from hummingbot.smart_components.executors.position_executor.data_types import PositionConfig, TrailingStop
from hummingbot.smart_components.executors.position_executor.position_executor import PositionExecutor
from hummingbot.smart_components.strategy_frameworks.data_types import OrderLevel
from hummingbot.smart_components.strategy_frameworks.market_making.market_making_controller_base import (
@fengtality
fengtality / dman_v2.py
Created April 17, 2024 23:36
Botcamp Challenge: Customizing a Controller
import time
from decimal import Decimal
import pandas_ta as ta # noqa: F401
from hummingbot.core.data_type.common import TradeType
from hummingbot.smart_components.executors.position_executor.data_types import PositionConfig, TrailingStop
from hummingbot.smart_components.executors.position_executor.position_executor import PositionExecutor
from hummingbot.smart_components.strategy_frameworks.data_types import OrderLevel
from hummingbot.smart_components.strategy_frameworks.market_making.market_making_controller_base import (
@fengtality
fengtality / calc-metrics.py
Created October 12, 2023 17:03
calculate trade metrics
import pandas as pd
import os
def main():
"""
This script processes a Hummingbot trades CSV file containing trade data and generates metrics such as total volume,
buy/sell amount, average prices, and profitability for each symbol. The results are saved to a new CSV file and displayed.
"""
# Prompt the user for the file path