-
Notifications
You must be signed in to change notification settings - Fork 0
Description
I am experiencing an issue where every time I use my script to purchase SOLO with XRP on the XRPL DEX, my order appears to execute correctly, but then immediately sells the SOLO back for XRP—often at a loss. This issue persists even though I have ensured that my trust line is set correctly and I have sufficient XRP balance.
Expected Behavior:
- The script should successfully buy SOLO using XRP.
- SOLO should be credited to my account without an immediate sellback.
Actual Behavior:
- The script places an order to buy SOLO with XRP.
- The transaction appears to succeed with a
tesSUCCESSstatus. - However, instead of retaining the SOLO, my account ends up selling it back.
- This results in an unexpected loop where SOLO is not retained, and repeated transactions lead to fee losses.
Steps to Reproduce:
-
Trust Line Verification:
- I have set up a trust line for SOLO with the issuer
rsoLo2S1kiGeCcn6hCUXVrCpGMWLrRrLZz. account_linesconfirms my trust line is active withbalance: 0andlimit: 100000.
- I have set up a trust line for SOLO with the issuer
-
Buying SOLO with XRP:
- I submit an
OfferCreatetransaction to buy SOLO with XRP. - The transaction details include:
{ "TransactionType": "OfferCreate", "Account": "rB5grw3ZcWyLgBZsk4yiWBDxEHFGaQLYtP", "TakerPays": "3000000", // 3 XRP "TakerGets": { "currency": "534F4C4F00000000000000000000000000000000", "issuer": "rsoLo2S1kiGeCcn6hCUXVrCpGMWLrRrLZz", "value": "19.8" // Expecting to receive 19.8 SOLO }, "Flags": 524288, // tfSell "Fee": "12" } - The transaction succeeds and returns a valid transaction hash.
- I submit an
-
Unexpected SOLO Sellback:
- Shortly after, another
OfferCreatetransaction appears to be executed, selling the acquired SOLO back for XRP. - This results in loss due to unfavorable price shifts and fees.
- Shortly after, another
Debugging Steps Taken: ✔️ Trust Line Set Correctly: Verified using account_lines API. ✔️ Sufficient XRP Balance: Checked before transaction execution. ✔️ Correct Order Book Prices: Extracted from book_offers API before placing an order. ✔️ Flags Adjustments: Used tfSell, tfImmediateOrCancel, and tfFillOrKill to test behavior. ✔️ Checked Open Orders: Verified no conflicting open orders before execution.
Transaction Hashes for Reference:
- Buy SOLO:
0641A7D78A083442BF6F2F0FBEC73B3708C656B825E18BFA0C9E4B63A48266DA - Unexpected Sellback:
93385492FF26AB275C6E7487CAC5282328CA25FACB84C8EE4C2C3A3DB0BE55DF
Questions for XRPL Team:
- Why does an automatic SOLO sellback occur after buying with XRP?
- Does the trust line need to be funded before SOLO can be acquired via
OfferCreate? - Could there be a ledger behavior causing the order book logic to misinterpret the buy order as a sell order?
- Are there any recommended transaction flags that could prevent this behavior?
- Is there a specific sequence required when setting the trust line and placing orders?
- XRPL Client:
xrpl.js - Node.js Version:
v20.15.1 - XRPL Network: Mainnet
I appreciate any guidance on resolving this issue as I am working on an arbitrage trading bot and need to ensure reliable behavior for DEX transactions.
Thank you for your assistance!