Position Sell
POST /positions/sell
Closes positions by liquidating collateral at market price to repay loans.
Headers
x-api-key
Yes
string
API key
Example Request
POST https://lavarave.wtf/api/sdk/v1.0/positions/sellRequest Body Fields
positionId
Yes
string
Address of the position.
offerId
Yes
string
Address of the loan offer.
quoteToken
Yes
string
Address of the token being borrowed.
slippage
Yes
number
Maximum acceptable price slippage in basis points.
userPubKey
Yes
string
Wallet address of the trader.
partnerFeeRecipient
No
string
Partner wallet address to receive fees.
profitFeeMarkup
No
string
This field is outdated and should be avoided. ⚠️
partnerFeeMarkupBps
No
number
Partner fee markup in basis points. Only applies when partnerFeeRecipient is provided. Range: 1-2000.
priorityFeeMicroLamports
No
number
Priority fee in microlamports.
platformFeeBps
No
number
Swap platform fee in basis points. If not provided, it will not be applied. It is suggested to not set anything as not every platform under the protocol can charge a fee.
platformFeeReceiver
No
string
Platform fee receiver account (token account). Used only when platformFeeBps is applied.
Response Fields
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": "GjKds3RantjgzWn9gBPUTty9wSCxEKsPke1PL4bscDVP",
"offerId": "7oHv3kSZYNufHsSBczGe6wFqZ92y4dYL6eYDHeeY3WH8",
"partnerFeeRecipient": "6JfTobDvwuwZxZP6FR5JPmjdvQ4h4MovkEVH2FPsMSrF",
"partnerFeeMarkupBps": 200,
"quoteToken": "So11111111111111111111111111111111111111112",
"slippage": 1000,
"userPubKey": "Ahtpvhub1Z2z3y1RUYPDb7iUkv2J9fYByWWaitPeQXVp"
}Response Example
{
"transaction": "base58_encoded_serialized_transaction"
}Last updated