> For the complete documentation index, see [llms.txt](https://developers.lfj.gg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.lfj.gg/contracts/libraries/constants.md).

# Constants

[Git Source](https://github.com/traderjoe-xyz/joe-v2/blob/16f011d25e6bf6d0a0c479974345b623d491104f/src/libraries/Constants.sol)

**Author:**\
Trader Joe

Set of constants for Liquidity Book contracts

## State Variables

### SCALE\_OFFSET

```solidity
uint8 internal constant SCALE_OFFSET = 128;
```

### SCALE

```solidity
uint256 internal constant SCALE = 1 << SCALE_OFFSET;
```

### PRECISION

```solidity
uint256 internal constant PRECISION = 1e18;
```

### SQUARED\_PRECISION

```solidity
uint256 internal constant SQUARED_PRECISION = PRECISION * PRECISION;
```

### MAX\_FEE

```solidity
uint256 internal constant MAX_FEE = 0.1e18;
```

### MAX\_PROTOCOL\_SHARE

```solidity
uint256 internal constant MAX_PROTOCOL_SHARE = 2_500;
```

### BASIS\_POINT\_MAX

```solidity
uint256 internal constant BASIS_POINT_MAX = 10_000;
```

### MAX\_LIQUIDITY\_PER\_BIN

```solidity
uint256 internal constant MAX_LIQUIDITY_PER_BIN =
    65251743116719673010965625540244653191619923014385985379600384103134737;
```

### CALLBACK\_SUCCESS

*The expected return after a successful flash loan*

```solidity
bytes32 internal constant CALLBACK_SUCCESS = keccak256("LBPair.onFlashLoan");
```


---

# 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://developers.lfj.gg/contracts/libraries/constants.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.
