Closed VLEFF closed 2 days ago
For Swaps with the same currency code, you should specify the Paths field.
Why that? Is that a feature or a bug? Since issuers are different, it should be treated as different currencies
It is a very long-standing process and I don't know about it. It may be a check that is necessary when considering the Rippling.
Ok, at least there is a solution! I'm still curious about the exact reason, if someone with this knowledge passes by
@tequdev How should the path be built?
I tried many combination with what I found on https://xrpl.org/docs/concepts/tokens/fungible-tokens/paths/ and https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/ripple_path_find/
But I always end up with either a temBAD_PATH, temBAD_PATH_LOOP or tecPATH_DRY (trustlines are set, and partial payment flag is on).
I didn't find anything about paths for AMM, maybe it's different?
The only path accepted by rippled engine that threw tecPATH_DRY is this one :
[
{
"account": "<my-account>"
},
{
"account": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq"
},
{
"currency": "USD",
"issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq"
},
{
"currency": "USD",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
{
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
{
"account": "<my-account>"
}
]
EDIT:
ripple-path-find method don't return any path
{
"method": "ripple_path_find",
"params": [
{
"destination_account": "<my-account>",
"source_account": "<my-account>",
"destination_amount": {
"currency": "USD",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value": "0.001"
},
"source_currencies": [
{
"currency": "USD",
"issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq"
}
]
}
]
}
{
"result": {
"alternatives": [],
"destination_account": "<my-account>",
"destination_amount": {
"currency": "USD",
"issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq",
"value": "0.001"
},
"destination_currencies": [
"MAG",
"EUR",
"ELS",
"5845504500000000000000000000000000000000",
"5553444300000000000000000000000000000000",
"USD",
"RPR",
"434F524500000000000000000000000000000000",
"XLM",
"XDX",
"ARK",
"XRP"
],
"full_reply": true,
"source_account": "<my-account>",
"status": "success"
}
}
it would work with the following Paths field
"Paths": [
[
{
"currency":"XRP"
},
{
"currency":"USD"
"issuer":"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
]
]
When specifying both destination_amount and source_amount in path_find, the amount you want to send should be specified in source_amount, and the value of destination_amount should be "-1". https://github.com/XRPLF/rippled/blob/c88166e055e4378f78fb0236e0bf347d6544e517/src/ripple/app/paths/PathRequest.cpp#L177-L182
Your code is incorrect, so it is not making the expected path_find result.
I'll try the path later,
for the path request, I'm not using source_amount, this is not the problem (I'm not getting the amount malformed exception)
I just tried your path, and it works!
I was asking myself "why add XRP in the path since XRP is not involved?" But after trying to remove it and only use :
"Paths": [
[
{
"currency":"USD"
"issuer":"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
]
]
It works too. As simple as that.
Thx for the help ;)
Closing this issue as it appears resolved.
Issue Description
When executing a swap transaction between Gatehub USD and Bitstamp USD, a temREDUNDANT error is thrown by the rippled engine.
Same currency with different issuer is the only reason I can see behind this bug, since it only appears for this swap pair.
Steps to Reproduce