Get quote

post

Retrieves a quote for a given account and input body.

Authorizations
Path parameters
accountNamestringRequired
  • The name of the account for which the quote is being retrieved.
Header parameters
AuthorizationstringRequired
  • The authorization token for the request.
Body
  • The input body containing the details for the quote request.
tostringOptional

The recipient address.

datastringOptional

The data to be sent.

valuestringOptional

The value to be sent.

gasLimitstringOptional

The gas limit for the transaction.

noncestringOptional

The nonce for the transaction.

simulatebooleanOptional

Whether to simulate the transaction.

gasstringOptional

The gas for the transaction.

gasPricestringOptional

The gas price for the transaction.

maxFeePerGasstringOptional

The maximum fee per gas.

maxPriorityFeePerGasstringOptional

The maximum priority fee per gas.

chain_idstringOptional

The chain ID.

encodingstringOptional

The encoding type.

typenumber · doubleOptional

The type of transaction.

blobGasstringOptional

The gas for blob transactions.

blobGasFeeCapstringOptional

The gas fee cap for blob transactions.

blobHashesstring[]Optional

The hashes for blob transactions.

dryrunbooleanOptional

Whether to perform a dry run.

inputstringOptional

The input data.

EOAbooleanOptional

Whether the transaction is from an externally owned account.

contract_addressstringOptional

The contract address.

token_idstringOptional

The token ID.

token_idsstringOptional

The token IDs.

approvedbooleanOptional

Whether the transaction is approved.

broadcastbooleanOptional

Whether to broadcast the transaction.

alwaysIncrementNoncebooleanOptional

Whether to always increment the nonce.

assetstringOptional

The asset involved in the transaction.

amountstringOptional

The amount involved in the transaction.

interestRateModenumber · doubleOptional

The interest rate mode.

referralCodenumber · doubleOptional

Referral code for the swap. Optional.

onBehalfOfstringOptional

The address on behalf of which the transaction is made.

receiverAddressstringOptional

The receiver address.

assetsstring[]Optional

The assets involved in the transaction.

amountsstring[]Optional

The amounts involved in the transaction.

modesnumber · double[]Optional

The modes of the transaction.

paramsstringOptional

Additional parameters.

rateModenumber · doubleOptional

The rate mode.

useAsCollateralbooleanOptional

Whether to use as collateral.

collateralAssetstringOptional

The collateral asset.

debtAssetstringOptional

The debt asset.

userstringOptional

The user involved in the transaction.

debtToCoverstringOptional

The debt to cover.

receiveATokenbooleanOptional

Whether to receive a token.

slippageLimitPercentnumber · doubleOptional

The maximum allowable slippage percentage for the swap. Optional.

minHealthFactorany ofOptional

The minimum health factor.

stringOptional
or
number · doubleOptional
premiumsany ofOptional

The premiums.

string[]Optional
or
number · double[]Optional
initiatorstringOptional

The initiator of the transaction.

rolestringOptional

The role of the user.

accountstringOptional

The account involved in the transaction.

initialDepositany ofOptional

The initial deposit.

stringOptional
or
number · doubleOptional
borrowAmountany ofOptional

The borrow amount.

stringOptional
or
number · doubleOptional
sourceBlackliststring[]Optional

A list of sources to be excluded from the swap. Optional.

sourceWhiteliststring[]Optional

A list of sources to be included in the swap. Optional.

poolBlackliststring[]Optional

A list of pools to be excluded from the swap. Optional.

pathVizbooleanOptional

Flag to enable path visualization. Optional.

pathVizImagebooleanOptional

Flag to enable path visualization image generation. Optional.

disableRFQsbooleanOptional

Flag to disable RFQs (Request for Quotes). Optional.

compactbooleanOptional

Flag to enable compact mode. Optional.

likeAssetbooleanOptional

Flag to indicate if the swap should be performed with like assets. Optional.

simplebooleanOptional

Flag to enable simple mode. Optional.

Responses
200
A promise that resolves to an OdosAPIResponse containing the result of the quote request.
application/json
post
POST //odos/{accountName}/get-quote HTTP/1.1
Host: beta.usemoon.ai
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 1407

{
  "to": "text",
  "data": "text",
  "value": "text",
  "gasLimit": "text",
  "nonce": "text",
  "simulate": true,
  "gas": "text",
  "gasPrice": "text",
  "maxFeePerGas": "text",
  "maxPriorityFeePerGas": "text",
  "chain_id": "text",
  "encoding": "text",
  "type": 1,
  "accessList": [
    {
      "address": "text",
      "storageKeys": [
        "text"
      ]
    }
  ],
  "blobGas": "text",
  "blobGasFeeCap": "text",
  "blobHashes": [
    "text"
  ],
  "dryrun": true,
  "input": "text",
  "EOA": true,
  "contract_address": "text",
  "token_id": "text",
  "token_ids": "text",
  "approved": true,
  "broadcast": true,
  "alwaysIncrementNonce": true,
  "asset": "text",
  "amount": "text",
  "interestRateMode": 1,
  "referralCode": 1,
  "onBehalfOf": "text",
  "receiverAddress": "text",
  "assets": [
    "text"
  ],
  "amounts": [
    "text"
  ],
  "modes": [
    1
  ],
  "params": "text",
  "rateMode": 1,
  "useAsCollateral": true,
  "collateralAsset": "text",
  "debtAsset": "text",
  "user": "text",
  "debtToCover": "text",
  "receiveAToken": true,
  "inputTokens": [
    {
      "tokenAddress": "text",
      "amount": "text"
    }
  ],
  "outputTokens": [
    {
      "tokenAddress": "text",
      "proportion": 1
    }
  ],
  "slippageLimitPercent": 1,
  "minHealthFactor": "text",
  "premiums": [
    "text"
  ],
  "initiator": "text",
  "role": "text",
  "account": "text",
  "initialDeposit": "text",
  "borrowAmount": "text",
  "sourceBlacklist": [
    "text"
  ],
  "sourceWhitelist": [
    "text"
  ],
  "poolBlacklist": [
    "text"
  ],
  "pathViz": true,
  "pathVizImage": true,
  "pathVizImageConfig": {
    "linkColors": [
      "text"
    ],
    "nodeColor": "text",
    "nodeTextColor": "text",
    "legendTextColor": "text",
    "width": 1,
    "height": 1
  },
  "disableRFQs": true,
  "compact": true,
  "likeAsset": true,
  "simple": true
}
200

A promise that resolves to an OdosAPIResponse containing the result of the quote request.

{
  "success": true,
  "message": "text",
  "data": {
    "approve": null,
    "broadcasted": {
      "success": true,
      "message": "text",
      "data": "text"
    },
    "odos": null,
    "message": "text",
    "success": true,
    "user_op": "text",
    "data": null,
    "params": [],
    "function": "text",
    "transaction": {
      "data": "text",
      "value": "text",
      "to": "text",
      "from": "text",
      "gasPrice": "text",
      "gasLimit": "text",
      "nonce": 1,
      "chainId": "text",
      "maxPriorityFeePerGas": "text",
      "maxFeePerGas": "text",
      "type": 1
    }
  }
}