# getPositionConfig

Retrieves and parses the position configuration for a given index token and position type (long or short).

#### Function Signature

```typescript
getPositionConfig(
  indexToken: string
  long: boolean
): Promise<IPositionConfig>
```

#### Parameters

* `indexToken` (string): The token for which to retrieve the position configuration.
* `long` (boolean): Indicates whether to retrieve the configuration for a long (true) or short (false) position.

#### Return Value

Returns a `Promise` that resolves to an `IPositionConfig` object. The object contains parsed position configuration, including:

```typescript
interface IPositionConfig {
    decreaseFeeBps: number;
    liquidationBonus: number;
    liquidationThreshold: number;
    maxLeverage: number;
    minHoldingDuration: number;
    openFeeBps: number;
    maxReservedMultiplier: number;
    minCollateralValue: number;
}
```

#### Description

This method fetches the position configuration data from the blockchain for a specified index token and position type. It performs the following steps:

#### Usage Example

```typescript
const sudoAPI = new SudoAPI(provider);

try {
  const positionConfig = await sudoAPI.getPositionConfig('BTC', true);
  console.log("Fetched position config:", positionConfig);
} catch (error) {
  console.error("Error fetching position config:", error);
}
```


---

# Agent Instructions: 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:

```
GET https://docs.sudo.finance/sudo-sdk/v0.0.6/api-reference/sudoapi/getpositionconfig.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
