Position Split

POST /positions/split

Split a position into 2 positions. Can be used in conjunction with the sell endpoint to partially sell a position by splitting it into two separate positions and selling one.

Headers

Header
Required
Type
Description

x-api-key

Yes

string

API key

Example Request

POST https://lavarave.wtf/api/sdk/v1.0/positions/split

Request Body Fields

Field
Required
Type
Description

positionId

Yes

string

Address of the position.

userPubKey

Yes

string

Wallet address of the trader.

splitRatioBps

Yes

number

Split ratio in basis points determining how the position will be divided. Range: 100-9900.

quoteToken

Yes

string

Address of the token being borrowed.

Response Fields

Field
Type
Description

transaction

string

Base58 encoded serialized transaction ready for signing.

quoteResponse (Beta)

object

Additional quote information. Should be ignored for now - this field is not currently used in integration.

Request Body Example

{
  "positionId": "9sFqWGuymEtJurxeovE5MvPs63UAN3WFzipdPmyBFBti",
  "userPubKey": "Ahtpvhub1Z2z3y1RUYPDb7iUkv2J9fYByWWaitPeQXVp",
  "splitRatioBps": 5000,
  "quoteToken": "So11111111111111111111111111111111111111112"
}

Response Example

{
  "transaction": "NEsDDJYJ7WPMvSPfRetUPPjsNKFmPPvxY7gpxs9nDV66YAwMpkrT9D1SUUra5joYm9Nc32SYSzBYPtryudq5HoHGxKkboZvej85KmVJiusvfqWKRQtqpt5iRxfwD74axwBNShTPDkzFqYwMc23vn7JuZacawoRoqz2RigH54Xfhk9M19LvaqqYGDK4EDbQKHSStkkp19SHZZjCsPnBJUqWacjAFJfbg9YV5FMdzfGxd2AeppeA6KsgY5kN64YPUKJdqc4F6nccx6VYmRzyFASxtoUrQTP1QwEyQBhWcFoWc7DLJGHkqRLiUzghEsvdHXDnRcA4fdekZv81Q2D8esGNK17jfs94aXMVNoXF5W4ikxvYKFSu2NaYdzo7abwzeLo4kPzXzWTZBbpxx4rR1FZSqkqZv56bwMHWJuUzRCDNiV1P1EGFuUyxrVe8eTnFQs67FzDBo4CWB4yG1QjTvYYnhNohBj8RnmUpo4ja3BFkcJbFNWUrzWgDakMmEJRbMbFShG3VdNXh5TSEefuo35KFHAyAKMoXJTheA7x7WqrG9W7u6NNjFHTYbuWB1vg1wquecmjphkQJFERqfZ6QQ3NneoSb8ki2UgY7pTyL566zrSUWtmfcDZUoRRfWqg7gdnu1LLLavRbV4TgHvHyTFHrvtJWimdwrFXBkydQPanf9PX3FMSd4ygsyHYtGa4114ATnR6eAgE2s3nX7y3QVoeRa5rsRuLX9NqH6GAQQBED72z6TmAAq3M8LiAsXftStgHjrUQSGYGVsxcqYnCjs68nAxMgVMZ9KNKkTQE6KZg5ae73STuHNtTRWxVoEQxYxgLeLpUhxDt6fq4vymFwqPVD4VJt1ffQrEK5ENCFxUYQa6AB"
}

Last updated