> For the complete documentation index, see [llms.txt](https://docs.vulpefi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vulpefi.com/aggregation-protocol/limit-order-protocol/smart-contracts/helpers/amountcalculator.md).

# AmountCalculator

A helper contract for calculations related to order amounts

## Functions[​](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/AmountCalculator#functions) <a href="#functions" id="functions"></a>

### getMakingAmount[​](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/AmountCalculator#getmakingamount) <a href="#getmakingamount" id="getmakingamount"></a>

```javascript
function getMakingAmount(
  uint256 orderMakerAmount,
  uint256 orderTakerAmount,
  uint256 swapTakerAmount
) public returns (uint256)
```

Calculates maker amount

**Parameters:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/AmountCalculator#parameters)

| Name               | Type    | Description |
| ------------------ | ------- | ----------- |
| `orderMakerAmount` | uint256 |             |
| `orderTakerAmount` | uint256 |             |
| `swapTakerAmount`  | uint256 |             |

**Return Values:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/AmountCalculator#return-values)

| Name     | Type    | Description          |
| -------- | ------- | -------------------- |
| `Result` | uint256 | Floored maker amount |

### getTakingAmount[​](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/AmountCalculator#gettakingamount) <a href="#gettakingamount" id="gettakingamount"></a>

```javascript
function getTakingAmount(
  uint256 orderMakerAmount,
  uint256 orderTakerAmount,
  uint256 swapMakerAmount
) public returns (uint256)
```

Calculates taker amount

**Parameters:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/AmountCalculator#parameters-1)

| Name               | Type    | Description |
| ------------------ | ------- | ----------- |
| `orderMakerAmount` | uint256 |             |
| `orderTakerAmount` | uint256 |             |
| `swapMakerAmount`  | uint256 |             |

**Return Values:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/AmountCalculator#return-values-1)

| Name     | Type    | Description         |
| -------- | ------- | ------------------- |
| `Result` | uint256 | Ceiled taker amount |

### arbitraryStaticCall[​](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/AmountCalculator#arbitrarystaticcall) <a href="#arbitrarystaticcall" id="arbitrarystaticcall"></a>

```javascript
function arbitraryStaticCall(
  address target,
  bytes data
) external returns (uint256)
```

Performs an arbitrary call to target with data

**Parameters:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/AmountCalculator#parameters-2)

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| `target` | address |             |
| `data`   | bytes   |             |

**Return Values:**[**​**](https://docs.1inch.io/docs/limit-order-protocol/smart-contract/helpers/AmountCalculator#return-values-2)

| Name     | Type    | Description                 |
| -------- | ------- | --------------------------- |
| `Result` | uint256 | Bytes transmuted to uint256 |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.vulpefi.com/aggregation-protocol/limit-order-protocol/smart-contracts/helpers/amountcalculator.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
