> For the complete documentation index, see [llms.txt](https://lavarage.gitbook.io/lavarage/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lavarage.gitbook.io/lavarage/platform/lavarage-api/lavaos-documentation/position-actions/take-profit.md).

# Take Profit

### <mark style="color:orange;">POST</mark> /positions/take-profit

Set automated take profit instruction for open positions.

#### Headers

<table><thead><tr><th width="175">Header</th><th width="110">Required</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>x-api-key</code></td><td>Yes</td><td>string</td><td>API key</td></tr></tbody></table>

#### Example Request

```http
POST https://lavarave.wtf/api/sdk/v1.0/positions/take-profit
```

#### Request Body Fields

<table><thead><tr><th width="192">Field</th><th width="110">Required</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>positionId</code></td><td>Yes</td><td>string</td><td>Address of the position.</td></tr><tr><td><code>quoteToken</code></td><td>Yes</td><td>string</td><td>Address of the token being borrowed.</td></tr><tr><td><code>targetPrice</code></td><td>Yes</td><td>number</td><td>Target price at which the take profit order will be triggered.<br><br>Must be ≥ 1 in smallest token units.</td></tr><tr><td><code>retriggerAt</code></td><td>Yes</td><td>number</td><td>Retrigger price at which the take profit order will be invalidated if the price moves in the opposite direction before execution.<br><br>Must be ≥ 1 in smallest token units.</td></tr><tr><td><code>partnerFeeMarkupBps</code></td><td>No</td><td>number</td><td>Partner fee markup in basis points. Only applies when <code>partnerFeeRecipient</code> is provided.<br><br>Range: 1-2000</td></tr><tr><td><code>partnerFeeRecipient</code></td><td>No</td><td>string</td><td>Partner wallet address to receive fees.</td></tr></tbody></table>

#### Response Fields

<table><thead><tr><th width="192">Field</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>transaction</code></td><td>string</td><td>Base58 encoded serialized transaction ready for signing.</td></tr></tbody></table>

#### Request Body Example

```json
{
  "positionId": "H6bY8DDoMpDNKQLJz3BDEaK3PfkBgKbSkfvU9N7ptahS",
  "quoteToken": "So11111111111111111111111111111111111111112",
  "targetPrice": 0.01,
  "retriggerAt": 0.01
}
```

#### Response Example

```json
{
  "success": true
}
```

***

### <mark style="color:purple;">PUT</mark> /positions/take-profit

Modifies existing take profit instrument for positions.

#### Headers

<table><thead><tr><th width="189">Header</th><th width="110">Required</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>x-api-key</code></td><td>Yes</td><td>string</td><td>API key</td></tr></tbody></table>

#### Example Request

```http
PUT https://lavarave.wtf/api/sdk/v1.0/positions/take-profit
```

#### Request Body Fields

<table><thead><tr><th width="193">Field</th><th width="110">Required</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>positionId</code></td><td>Yes</td><td>string</td><td>Address of the position.</td></tr><tr><td><code>quoteToken</code></td><td>Yes</td><td>string</td><td>Address of the token being borrowed.</td></tr><tr><td><code>targetPrice</code></td><td>Yes</td><td>number</td><td>Target price at which the take profit order will be triggered.<br><br>Must be ≥ 1 in smallest token units.</td></tr><tr><td><code>retriggerAt</code></td><td>Yes</td><td>number</td><td>Retrigger price at which the take profit order will be invalidated if the price moves in the opposite direction before execution, requiring the order to be retriggered.<br><br>Must be ≥ 1 in smallest token units.</td></tr><tr><td><code>partnerFeeMarkupBps</code></td><td>No</td><td>number</td><td>Partner fee markup in basis points. Only applies when <code>partnerFeeRecipient</code> is provided.<br><br>Range: 1-2000.</td></tr><tr><td><code>partnerFeeRecipient</code></td><td>No</td><td>string</td><td>Partner wallet address to receive fees.</td></tr></tbody></table>

#### Response Fields

<table><thead><tr><th width="175">Field</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>transaction</code></td><td>string</td><td>Base58 encoded serialized transaction ready for signing.</td></tr></tbody></table>

#### Request Body Example

```json
{
  "positionId": "H6bY8DDoMpDNKQLJz3BDEaK3PfkBgKbSkfvU9N7ptahS",
  "quoteToken": "So11111111111111111111111111111111111111112",
  "targetPrice": 0.01,
  "retriggerAt": 0.01
}
```

#### Response Example

```json
{
  "success": true
}
```

***

### <mark style="color:red;">DELETE</mark> /positions/take-profit

Removes automated take profit orders.

#### Headers

<table><thead><tr><th width="175">Header</th><th width="110">Required</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>x-api-key</code></td><td>Yes</td><td>string</td><td>API key</td></tr></tbody></table>

#### Example Request

```http
DELETE https://lavarave.wtf/api/sdk/v1.0/positions/take-profit
```

#### Request Body Fields

<table><thead><tr><th width="174">Field</th><th width="110">Required</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>positionId</code></td><td>Yes</td><td>string</td><td>Address of the position.</td></tr><tr><td><code>quoteToken</code></td><td>Yes</td><td>string</td><td>Address of the token being borrowed.</td></tr></tbody></table>

#### Response Fields

<table><thead><tr><th width="176">Field</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>transaction</code></td><td>string</td><td>Base58 encoded serialized transaction ready for signing.</td></tr></tbody></table>

#### Request Body Example

```json
{
  "positionId": "H6bY8DDoMpDNKQLJz3BDEaK3PfkBgKbSkfvU9N7ptahS",
  "quoteToken": "So11111111111111111111111111111111111111112"
}
```

#### Response Example

```json
{
  "success": true
}
```
