Take Profit

POST /positions/take-profit

Set automated take profit instruction for open positions.

Headers

Header
Required
Type
Description

x-api-key

Yes

string

API key

Example Request

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

Request Body Fields

Field
Required
Type
Description

positionId

Yes

string

Address of the position.

quoteToken

Yes

string

Address of the token being borrowed.

targetPrice

Yes

number

Target price at which the take profit order will be triggered. Must be ≥ 1 in smallest token units.

retriggerAt

Yes

number

Retrigger price at which the take profit order will be invalidated if the price moves in the opposite direction before execution. Must be ≥ 1 in smallest token units.

partnerFeeMarkupBps

No

number

Partner fee markup in basis points. Only applies when partnerFeeRecipient is provided. Range: 1-2000

partnerFeeRecipient

No

string

Partner wallet address to receive fees.

Response Fields

Field
Type
Description

transaction

string

Base58 encoded serialized transaction ready for signing.

Request Body Example

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

Response Example

{
  "success": true
}

PUT /positions/take-profit

Modifies existing take profit instrument for positions.

Headers

Header
Required
Type
Description

x-api-key

Yes

string

API key

Example Request

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

Request Body Fields

Field
Required
Type
Description

positionId

Yes

string

Address of the position.

quoteToken

Yes

string

Address of the token being borrowed.

targetPrice

Yes

number

Target price at which the take profit order will be triggered. Must be ≥ 1 in smallest token units.

retriggerAt

Yes

number

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. Must be ≥ 1 in smallest token units.

partnerFeeMarkupBps

No

number

Partner fee markup in basis points. Only applies when partnerFeeRecipient is provided. Range: 1-2000.

partnerFeeRecipient

No

string

Partner wallet address to receive fees.

Response Fields

Field
Type
Description

transaction

string

Base58 encoded serialized transaction ready for signing.

Request Body Example

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

Response Example

{
  "success": true
}

DELETE /positions/take-profit

Removes automated take profit orders.

Headers

Header
Required
Type
Description

x-api-key

Yes

string

API key

Example Request

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

Request Body Fields

Field
Required
Type
Description

positionId

Yes

string

Address of the position.

quoteToken

Yes

string

Address of the token being borrowed.

Response Fields

Field
Type
Description

transaction

string

Base58 encoded serialized transaction ready for signing.

Request Body Example

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

Response Example

{
  "success": true
}

Last updated