⚖️ Case 3: User Starts With Both Base and Quote Assets
Example: User Has Both XRP (Base) and USDT (Quote)
⚡ Scenario: The user starts with both XRP and USDT balances. The bot can therefore place buy and sell orders simultaneously, capturing profits in both directions as price fluctuates within the chosen range.
📘 Overview
This configuration represents the ideal setup for grid trading. Because the user holds both assets, the bot can place buy grids below and sell grids above the current market price — generating profit regardless of short-term direction.
⚙️ Initial Setup
Market Price
2.5 USDT / XRP
Grid Range
2.0 – 3.0 USDT
Total Grids
8
User Balance
XRP + USDT (both available)
🧩 Step 1 — Grid Allocation
The bot divides the 2.0 – 3.0 range into 8 equal levels.
Levels below 2.5 USDT → Buy orders (use USDT to buy XRP)
Levels above 2.5 USDT → Sell orders (use XRP to sell for USDT)
→ Active grids: 4 buy orders below and 4 sell orders above the current price.
When the price rises:
One or more sell orders are triggered.
The bot converts XRP → USDT at those levels.
For each filled sell, a buy-back order is placed 2 % below that sell price.
Example
Sell XRP
2.625
Buy back at 2.5725
Sell XRP
2.750
Buy back at 2.695
✅ If price retraces later, these buy-backs refill XRP and lock in profit.
When the price drops:
One or more buy orders are triggered.
The bot purchases XRP with USDT at those levels.
For each buy, a take-profit sell order is set 2 % above that buy price.
Example
Buy XRP
2.375
Sell at 2.4225
Buy XRP
2.250
Sell at 2.295
✅ If price rebounds, the TP sells realize profit and restore grid balance.
As long as price remains within 2.0 – 3.0 USDT, the bot simultaneously:
Executes buy → TP sell cycles on lower grids.
Executes sell → buy-back cycles on upper grids.
Re-places each order at its original level after completion.
Each grid level operates independently, allowing multiple overlapping profit loops.
💡 Result: Continuous, market-neutral profit generation.
If price falls below the lower limit:
All buy orders likely filled.
Each has a pending TP sell above.
If price keeps dropping without recovery:
The bot triggers Safety Exit — sells all XRP at market.
Realized loss is booked.
Trading halts.
🚨 Outcome: Loss contained and bot stops safely.
If price breaks above the upper limit:
All sell orders execute successfully.
All XRP converted to USDT.
Bot halts (trading range broken).
Result: Realized profit from completed grids.
📊 Summary Table
Price rises
Sell orders triggered + buy-backs below
Realized profit
Price falls
Buy orders triggered + TP sells above
Realized profit
Price drops below 2.0
Safety exit (sell all)
Realized loss
Price rises above 3.0
All sells filled → halt
Realized profit
🧮 Key Parameters Recap
Start Condition
Both XRP and USDT available
Grid Range
2.0 – 3.0 USDT
Current Price
2.5 USDT / XRP
Total Grids
8
Active Grids
4 buy + 4 sell
TP / Buy-Back per Grid
± 2 %
Safety Exit
Sell all if price < 2.0
Halt Conditions
Range broken (< 2.0 or > 3.0)
💡 Key Takeaways
Holding both assets allows full-spectrum profit (up & down moves).
Each grid is autonomous with its own cycle logic.
Dual liquidity ensures continuous operation in all market directions.
Safety exit still protects capital on extreme breakdowns.
The bot halts automatically once price exits the defined range.
Last updated