> ## Documentation Index
> Fetch the complete documentation index at: https://pay-docs.holdstation.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Estimate Outcome

> Calculate the estimated outcome amount for a given input amount and order type.

## Overview

Partners can calculate the final amount for a given input amount and order type. Set `reverse=true` to calculate the required input amount for a desired outcome.

<ParamField body="amount" type="string" required>
  Input amount to calculate. In VND for deposit orders, USD for withdrawal orders.
</ParamField>

<ParamField body="order_type" type="integer" required>
  Type of the order. `1` = Deposit, `2` = Withdrawal.
</ParamField>

<ParamField body="chain_id" type="integer" required>
  Blockchain network ID. See [List Tokens](/api-reference/tokens/list-tokens).
</ParamField>

<ParamField body="token_address" type="string" required>
  Token contract address. See [List Tokens](/api-reference/tokens/list-tokens).
</ParamField>

<ParamField body="reverse" type="boolean" required>
  If `true`, calculates the required input amount to achieve a desired outcome.
</ParamField>

<ParamField body="buffer" type="number" required>
  Optional buffer rate override (fractional). Effective buffer = max(override, configured). Example: `0.005` = 0.5%.
</ParamField>

<RequestExample>
  ```json theme={null}
  {
    "amount": "2575000",
    "order_type": 1,
    "chain_id": 56,
    "token_address": "0x55d398326f99059ff775485246999027b3197955",
    "reverse": false,
    "buffer": 0.005
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "message": "success",
    "data": {
      "outcome": "100",
      "rate": 25750,
      "fee_vnd": 5000,
      "fees": {
        "service_fee": 5000,
        "min_fee": 2000
      }
    }
  }
  ```

  ```json 400 theme={null}
  {
    "error": "invalid request",
    "error_code": "BAD_REQUEST",
    "message": "Invalid parameters"
  }
  ```
</ResponseExample>
