swap

Get swap price estimate. (admin access required, mainnet only)

Get a swap price estimate from the SundaeSwap pool. Returns the conversion rate based on current pool reserves.

get/swap/estimate

Request

  • Base URL: ./../api/v1/ (relative, and the document was published on a file host, not at the API’s origin)
  • URL: ./../api/v1/swap/estimate
  • Auth: API key in header token

Query parameters

fromPolicyIdstring required

Policy ID of the source token. Use empty string "" for ADA

fromAssetNamestring required

Asset name (hex) of the source token. Use empty string "" for ADA

toPolicyIdstring required

Policy ID of the destination token. Use empty string "" for ADA

toAssetNamestring required

Asset name (hex) of the destination token. Use empty string "" for ADA

poolIdstring required

SundaeSwap pool identifier

Response

Swap estimate

ratenumber required

Estimated conversion rate (toToken per 1 fromToken, after pool fee)

feenumber required

Pool fee as a decimal (e.g. 0.003 for 0.3%)

fromDecimalsnumber required

Decimal places of the source token

toDecimalsnumber required

Decimal places of the destination token

Example response

{
  "rate": 2.45,
  "fee": 0.003,
  "fromDecimals": 6,
  "toDecimals": 6
}

Changes

No recorded changes to this operation across all 50 revisions of this API.