0

Let assets are A,B,C,D,E,F

I have created few orders like
A->B B->C C->D D->E E->F

Now, i have created an order where user1 is selling "F" to a destination user2 and the receiving Asset is "A"

After calling finding path methods it is showing me below output (Where the first letter of each asset represent the Asset i have mentioned above means "AXY" is "A").

    {
    "source_asset_type": "credit_alphanum4",
    "source_asset_code": "EXY",
    "source_asset_issuer": "GA24WKNRNMEMKK3PYE4GPFCNFWRP75MUYDBYJEGRMEZE3EKCSRBEYSBK",
    "source_amount": "96.0000000",
    "destination_asset_type": "credit_alphanum4",
    "destination_asset_code": "AXY",
    "destination_asset_issuer": "GBQF24JXLPXRWGTCGHWMXECOEE3VFYXJUWFRHIVNEF7GE6TQK2H3FXE4",
    "destination_amount": "1.0000000",
    "path": [
      {
        "asset_type": "credit_alphanum4",
        "asset_code": "DXY",
        "asset_issuer": "GCJ3ODETXMRTNCRD6BHHYUFLBVIQJHZVBYBVES6QDNRMJAF3ACZC47B6"
      },
      {
        "asset_type": "credit_alphanum4",
        "asset_code": "CLM",
        "asset_issuer": "GA5ZB6DSHSOBNEYSCXH3ULEIYT5V2WOJRCWQE4ANZ56B6BVZF6XSSIQX"
      },
      {
        "asset_type": "credit_alphanum4",
        "asset_code": "BCZ",
        "asset_issuer": "GC5DKZTNXPMLRYSBB7QRH2QWTMEP56USAXJHA5LMTYOTXJO6CDVIHQRD"
      }
    ]
  }

So, total 4 hops it is showing, BUT stellar mention in their document that upto 6 hops it can accept. Already mentioned that my order exist from "E" to "F" also. My horizon version is v0.23.0. What could be the possible reason?

1 Answer 1

1

Horizon always returns the optimal path. The E->F part is redundant in this particular case as you requested payment path from E to A. And that's what we clearly see here: EXY->DXY->CLM->BCZ->AXY.

1
  • This is the output of "server.paths(source_account, destination_account, destination_asset, destination_amount)" which gives all possibilities. This is the last excerpt from the output having maximum hops. In the above case, user 1st wants to send "F"(source_asset_code) to the user 2nd where receiving asset is "A"(destination_asset_code). So again, why this is not working?
    – Suman Raj
    Commented Jan 3, 2020 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.