33
44
55class ExecutorsRouter (BaseRouter ):
6- """Executors router for managing trading executors and position holds.
7-
8- Supported executor types:
9- - order_executor: Simple order execution with retry logic (MARKET, LIMIT, LIMIT_MAKER, LIMIT_CHASER)
10- - position_executor: Directional positions with stop-loss and take-profit
11- - dca_executor: Dollar-cost averaging over time
12- - grid_executor: Grid trading in ranging markets
13- - swap_executor: DEX token swaps via Gateway (Jupiter, Raydium)
14- - lp_executor: CLMM liquidity positions on DEXs (Meteora, Raydium)
15- """
6+ """Executors router for managing trading executors and position holds."""
167
178 # Executor CRUD Operations
189 async def create_executor (
@@ -24,64 +15,17 @@ async def create_executor(
2415 Create a new executor with the given configuration.
2516
2617 Args:
27- executor_config: Executor configuration dictionary containing:
28- - type: Executor type (order_executor, position_executor, dca_executor,
29- grid_executor, swap_executor, lp_executor)
30- - Other fields depend on executor type
31-
32- Common executor configs:
33-
34- swap_executor (DEX swaps):
35- {
36- "type": "swap_executor",
37- "connector_name": "jupiter/router",
38- "trading_pair": "TOKEN-SOL",
39- "side": 1, # 1=BUY, 2=SELL
40- "amount": "0.5" # or "$10" for USD amount
41- }
42-
43- lp_executor (CLMM LP positions):
44- {
45- "type": "lp_executor",
46- "connector_name": "meteora/clmm",
47- "trading_pair": "TOKEN-SOL",
48- "side": 0, # 0=double-sided, 1=base only, 2=quote only
49- "lower_price": 0.001,
50- "upper_price": 0.002,
51- "base_amount": 1000, # or quote_amount
52- }
53-
18+ executor_config: Executor configuration dictionary
5419 account_name: Account to run the executor on (optional)
5520
5621 Returns:
5722 Created executor information
5823
5924 Example:
60- # Create a DCA executor
6125 executor = await client.executors.create_executor(
62- {"type": "dca_executor ", "trading_pair": "BTC-USDT", ...},
26+ {"type": "dca ", "trading_pair": "BTC-USDT", ...},
6327 account_name="master_account"
6428 )
65-
66- # Create a swap executor
67- executor = await client.executors.create_executor({
68- "type": "swap_executor",
69- "connector_name": "jupiter/router",
70- "trading_pair": "WIF-SOL",
71- "side": 1,
72- "amount": "$5"
73- })
74-
75- # Create an LP executor
76- executor = await client.executors.create_executor({
77- "type": "lp_executor",
78- "connector_name": "meteora/clmm",
79- "trading_pair": "WIF-SOL",
80- "side": 0,
81- "lower_price": 0.5,
82- "upper_price": 1.5,
83- "base_amount": 100
84- })
8529 """
8630 body = {"executor_config" : executor_config }
8731 if account_name is not None :
0 commit comments