Skip to content

services/horizon: strict-receive path conversions are occasionally inaccurate #113

@sreuland

Description

@sreuland

What version are you using?

22.0.2

What did you do?

invoked the Horizon paths/strict-receive

curl -L \
'https://horizon.stellar.org/paths/strict-receive?destination_asset_type=credit_alphanum4&destination_asset_code=USDC&destination_asset_issuer=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN&destination_amount=100&source_assets=native' \
-H 'Accept: application/json' | jq
 
{
  "_embedded": {
    "records": [
      {
        "source_asset_type": "native",
        "source_amount": "263.7802723",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "USDC",
        "destination_asset_issuer": "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
        "destination_amount": "100.0000000",
        "path": [
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "SGB",
            "asset_issuer": "GAME5YNKHIPRSMN2BI3HLS3OYD4NE6FQ2WKUUJPYYM6GU4MRDUBPHN6B"
          },
          {
            "asset_type": "credit_alphanum4",
            "asset_code": "AQUA",
            "asset_issuer": "GBNZILSTVQZ4R7IKQDGHYGY2QXL5QOFJYQMXPKWRRM5PAV7Y4M67AQUA"
          }
        ]
      },
      {
        "source_asset_type": "native",
        "source_amount": "374.5692800",
        "destination_asset_type": "credit_alphanum4",
        "destination_asset_code": "USDC",
        "destination_asset_issuer": "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
        "destination_amount": "100.0000000",
        "path": []
      }
    ]
  }
}

What did you expect to see?

a conversion rate for source->destination that is more accurate to mid of order book on dex

What did you see instead?

a conversion rate for source->destination that was a couple orders of magnitude away from midpoint of order book

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    To Do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions