strat new¶
Create a new strategy from template.
This scaffolds a strategy project with:
- strategy.py: Main strategy with decide() method
- config.json: Runtime configuration
- tests/: Test scaffolding
Templates:
blank Minimal starting point for custom implementations
ta_swap Technical analysis swap (RSI, Bollinger, or combined)
dynamic_lp Price-based LP range management
lending_loop Supply/borrow leverage loop (Aave V3)
basis_trade Spot+perp funding rate arbitrage (GMX V2)
vault_yield Vault deposit/redeem yield farming (MetaMorpho)
copy_trader Copy trading from leader wallets
perps Perpetual futures with TP/SL (GMX V2)
multi_step Atomic multi-step via IntentSequence
staking Liquid staking (Lido)
Usage¶
Arguments¶
Options¶
-
name:- Type: STRING
- Default:
None - Usage:
--name -nName for the new strategy. If not provided, will prompt interactively.
-
working_dir:- Type:
Path - Default:
None - Usage:
--working-dir -oOutput directory for the new strategy. Defaults to current directory.
- Type:
-
template:- Type: Choice(['blank', 'ta_swap', 'dynamic_lp', 'lending_loop', 'basis_trade', 'vault_yield', 'copy_trader', 'perps', 'multi_step', 'staking'])
- Default:
blank - Usage:
--template -tStrategy template to use (default: blank)
-
chain:- Type: Choice(['arbitrum', 'avalanche', 'base', 'berachain', 'blast', 'bsc', 'ethereum', 'linea', 'mantle', 'monad', 'optimism', 'plasma', 'polygon', 'solana', 'sonic', 'xlayer', 'zerog'])
- Default:
arbitrum - Usage:
--chain -cTarget blockchain network (default: arbitrum)
-
help:- Type: BOOL
- Default:
False - Usage:
--helpShow this message and exit.
CLI Help¶
Usage: almanak strat new [OPTIONS]
Create a new strategy from template.
This scaffolds a strategy project with:
- strategy.py: Main strategy with decide() method
- config.json: Runtime configuration
- tests/: Test scaffolding
Templates:
blank Minimal starting point for custom implementations
ta_swap Technical analysis swap (RSI, Bollinger, or combined)
dynamic_lp Price-based LP range management
lending_loop Supply/borrow leverage loop (Aave V3)
basis_trade Spot+perp funding rate arbitrage (GMX V2)
vault_yield Vault deposit/redeem yield farming (MetaMorpho)
copy_trader Copy trading from leader wallets
perps Perpetual futures with TP/SL (GMX V2)
multi_step Atomic multi-step via IntentSequence
staking Liquid staking (Lido)
Options:
-n, --name TEXT Name for the new strategy. If not provided,
will prompt interactively.
-o, --working-dir PATH Output directory for the new strategy.
Defaults to current directory.
-t, --template [blank|ta_swap|dynamic_lp|lending_loop|basis_trade|vault_yield|copy_trader|perps|multi_step|staking]
Strategy template to use (default: blank)
-c, --chain [arbitrum|avalanche|base|berachain|blast|bsc|ethereum|linea|mantle|monad|optimism|plasma|polygon|solana|sonic|xlayer|zerog]
Target blockchain network (default:
arbitrum)
--help Show this message and exit.