Closed surangap closed 2 years ago
@surangap: Thanks for opening an issue, it is currently awaiting triage.
The triage/accepted label can be added by foundation members by writing /triage accepted in a comment.
It seems like CPoolSwap::CalculateSwaps / CalculatePoolPaths doesn't look for a direct path.
Just curious, which of the following are we looking to achieve for testpoolswap
?
What happened:
testpoolswap
from CAT -> DFI withpath = auto
,verbose = true
pools
field.{ path: 'auto', pools: [ '2', '2', '2' ], amount: '48.48437068@0' }
The above should be a direct swap since
CAT-DFI
pool is present. RCA even incompositeswap
check for a direct swap is done first and then goes to theCalculateSwaps()
andcompositeswap()
ref -> https://github.com/DeFiCh/ain/blob/c0a25f727f32c1b2c32a5120059276ec97e38bd2/src/masternodes/rpc_poolpair.cpp#L919but in the scenario mentioned above, it will call
CalculateSwaps()
straight. ref -> https://github.com/DeFiCh/ain/blob/c0a25f727f32c1b2c32a5120059276ec97e38bd2/src/masternodes/rpc_poolpair.cpp#L1091it could be that the
CalculateSwaps()
is unable to handle this scenario well. But simply adding a check for a direct swap first should solve the issue(same as thecompositeswap
flow. ). https://github.com/DeFiCh/ain/blob/c0a25f727f32c1b2c32a5120059276ec97e38bd2/src/masternodes/rpc_poolpair.cpp#L1091What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
What are your environment parameters:
Anything else we need to know?: