# Delta

### Functions <a href="#functions" id="functions"></a>

#### combine <a href="#combine" id="combine"></a>

Combines two Delta instances by adding their delta values if skipCombine is false.

```solidity
function combine(Instance memory self, Instance memory delta) internal pure;
```

**Parameters**

| Name    | Type       | Description                                          |
| ------- | ---------- | ---------------------------------------------------- |
| `self`  | `Instance` | The first Delta instance.                            |
| `delta` | `Instance` | The second Delta instance to combine with the first. |

#### pastMaxTick <a href="#pastmaxtick" id="pastmaxtick"></a>

Checks if the activeTick is past the tickLimit for swapping to the maximum price.

```solidity
function pastMaxTick(Instance memory self, int32 activeTick) internal pure returns (bool);
```

**Parameters**

| Name         | Type       | Description              |
| ------------ | ---------- | ------------------------ |
| `self`       | `Instance` | The Delta instance.      |
| `activeTick` | `int32`    | The current active tick. |

**Returns**

| Name     | Type   | Description                                                    |
| -------- | ------ | -------------------------------------------------------------- |
| `<none>` | `bool` | true if the activeTick is past the tickLimit, false otherwise. |

### Structs <a href="#structs" id="structs"></a>

#### Instance <a href="#instance" id="instance"></a>

```solidity
struct Instance {
    uint256 deltaInBinInternal;
    uint256 deltaInErc;
    uint256 deltaOutErc;
    uint256 excess;
    bool tokenAIn;
    bool exactOutput;
    bool swappedToMaxPrice;
    bool skipCombine;
    int32 tickLimit;
    uint256 sqrtLowerTickPrice;
    uint256 sqrtUpperTickPrice;
    uint256 sqrtPrice;
    int64 fractionalPart;
}
```
