POST /dex/last-price

Changed on

Gets the swap prices for the given liquidity pool and asset pairs. Operation "mean" is not AVG from the last values, but the remaining amount of assets on the pool output

Request

  • Base URL
    / (relative, and the document was published on a file host, not at the API’s origin)
  • URL
    /dex/last-price
  • Auth
    none required

Request body

type'buy' | 'sell' | 'mean' required

Example request

{
  "assetPairs": [
    {
      "asset2": {
        "assetName": "42657272794e617679",
        "policyId": "b863bc7369f46136ac1048adb2fa7dae3af944c3bbb2be2f216a8d4f"
      },
      "asset1": {
        "assetName": "42657272794e617679",
        "policyId": "b863bc7369f46136ac1048adb2fa7dae3af944c3bbb2be2f216a8d4f"
      }
    }
  ]
}

Response

Example response

{
  "lastPrice": [
    {
      "amount2": "2042352568679",
      "amount1": "2042352568679",
      "asset2": {
        "assetName": "42657272794e617679",
        "policyId": "b863bc7369f46136ac1048adb2fa7dae3af944c3bbb2be2f216a8d4f"
      },
      "asset1": {
        "assetName": "42657272794e617679",
        "policyId": "b863bc7369f46136ac1048adb2fa7dae3af944c3bbb2be2f216a8d4f"
      }
    }
  ]
}

Changes