Skip to content

Commit adfe7ad

Browse files
committed
Revert "feat: make pool_address optional, add swap/lp executor docs"
This reverts commit 870c9ad.
1 parent 870c9ad commit adfe7ad

2 files changed

Lines changed: 9 additions & 73 deletions

File tree

hummingbot_api_client/routers/executors.py

Lines changed: 3 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,7 @@
33

44

55
class 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:

hummingbot_api_client/routers/gateway_clmm.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -248,29 +248,22 @@ async def get_positions_owned(
248248
self,
249249
connector: str,
250250
network: str,
251-
pool_address: Optional[str] = None,
251+
pool_address: str,
252252
wallet_address: Optional[str] = None
253253
) -> List[Dict[str, Any]]:
254254
"""
255-
Get all liquidity positions owned by a wallet.
255+
Get all liquidity positions owned by a wallet for a specific pool.
256256
257257
Args:
258258
connector: CLMM connector (e.g., 'meteora')
259259
network: Network ID in format 'chain-network' (e.g., 'solana-mainnet-beta')
260-
pool_address: Pool contract address (optional - if not provided, returns all positions)
260+
pool_address: Pool contract address
261261
wallet_address: Wallet address (uses default if not provided)
262262
263263
Returns:
264-
List of position information
264+
List of position information for the specified pool
265265
266266
Example:
267-
# Get all positions for a wallet
268-
positions = await client.gateway_clmm.get_positions_owned(
269-
connector='meteora',
270-
network='solana-mainnet-beta'
271-
)
272-
273-
# Get positions for a specific pool
274267
positions = await client.gateway_clmm.get_positions_owned(
275268
connector='meteora',
276269
network='solana-mainnet-beta',
@@ -281,10 +274,9 @@ async def get_positions_owned(
281274
"""
282275
request_data = {
283276
"connector": connector,
284-
"network": network
277+
"network": network,
278+
"pool_address": pool_address
285279
}
286-
if pool_address:
287-
request_data["pool_address"] = pool_address
288280
if wallet_address:
289281
request_data["wallet_address"] = wallet_address
290282

0 commit comments

Comments
 (0)