> ## Documentation Index
> Fetch the complete documentation index at: https://satoshiapp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# IBasePositionManager

> Interface for the BasePositionManager contract

# IBasePositionManager Interface

The `IBasePositionManager` interface defines the functions available in the BasePositionManager contract, which provides core position management functionality for the Satoshi Perps protocol.

## Position Management

```solidity theme={null}
function increasePosition(
    address[] memory _path,
    address _indexToken,
    uint256 _amountIn,
    uint256 _minOut,
    uint256 _sizeDelta,
    bool _isLong,
    uint256 _price
) external;
```

Increases a position with the specified parameters.

```solidity theme={null}
function decreasePosition(
    address _collateralToken,
    address _indexToken,
    uint256 _collateralDelta,
    uint256 _sizeDelta,
    bool _isLong,
    address _receiver,
    uint256 _price
) external;
```

Decreases a position with the specified parameters.

## Global Size Limits

```solidity theme={null}
function setMaxGlobalSizes(
    address[] memory _tokens,
    uint256[] memory _longSizes,
    uint256[] memory _shortSizes
) external;
```

Sets the maximum global long and short sizes for a list of tokens.

```solidity theme={null}
function maxGlobalLongSizes(address _token) external view returns (uint256);
```

Returns the maximum global long size for a token.

```solidity theme={null}
function maxGlobalShortSizes(address _token) external view returns (uint256);
```

Returns the maximum global short size for a token.

## Fee Configuration

```solidity theme={null}
function setDepositFee(uint256 _depositFee) external;
```

Sets the deposit fee basis points.

```solidity theme={null}
function depositFee() external view returns (uint256);
```

Returns the current deposit fee basis points.

## Token Management

```solidity theme={null}
function transferIn(address _token) external returns (uint256);
```

Transfers tokens from the sender to the contract.

```solidity theme={null}
function transferOut(
    address _token,
    uint256 _amount,
    address _receiver
) external;
```

Transfers tokens from the contract to a receiver.

```solidity theme={null}
function swap(
    address[] memory _path,
    uint256 _amountIn,
    uint256 _minOut,
    address _receiver
) external returns (uint256);
```

Executes a token swap through the Router.

## Fee Collection

```solidity theme={null}
function feeReserves(address _token) external view returns (uint256);
```

Returns the amount of fees collected for a token.

```solidity theme={null}
function collectFees(
    address _token,
    address _receiver
) external returns (uint256);
```

Collects accumulated fees for a token and sends them to the specified receiver.

## Contract References

```solidity theme={null}
function vault() external view returns (address);
```

Returns the address of the Vault contract.

```solidity theme={null}
function router() external view returns (address);
```

Returns the address of the Router contract.

```solidity theme={null}
function shortsTracker() external view returns (address);
```

Returns the address of the ShortsTracker contract.

```solidity theme={null}
function weth() external view returns (address);
```

Returns the address of the WETH token.

## ETH Handling

```solidity theme={null}
function receiveETH() external payable;
```

Receives ETH sent to the contract.

## Usage Notes

* The BasePositionManager is an abstract contract designed to be inherited by concrete implementations like PositionManager.
* It provides core functionality for position management but lacks user-facing methods.
* The contract implements safety checks such as global position size limits.
* Fee collection is handled automatically when positions are adjusted.

## Security Considerations

* Functions are protected by various access controls in implementing contracts
* Global size limits help prevent excessive risk concentration in specific tokens
* Deposit fees may be charged to prevent abuse of zero-fee swaps
