LavaOS Documentation
API Endpoints
Base URL
https://lavarave.wtf/api/sdk/v1.0
GET /offers/v2
Retrieves all available loan offers.
Query Parameters
includeTokens
No
boolean
Include detailed token metadata such as address
, name
, symbol
, decimals
, logoURI
, currentPrice
& currentPriceLastUpdated
. It's False by default.
inactiveOffers
No
boolean
Include inactive offers in the response. It's False by default.
includeRawData
No
boolean
Include raw on-chain offer account data. It's False by default.
tags
No
string
Specified tag for loan offers.
Headers
x-api-key
Yes
string
API key
Example Request
GET https://lavarave.wtf/api/sdk/v1.0/offers/v2?includeTokens=true&inactiveOffers=false&includeRawData=true
Response Fields
publicKey
string
Address of the loan offer.
programId
string
Identifier for the smart contract program managing the offer.
apr
number
Annual interest rate for this offer in percentage form, e.g. 169.
maxExposure
string
Maximum lending amount for this loan offer in quote token.
currentExposure
string
Current amount in quote token that is borrowed against this loan offer.
nodeWallet
string
Address of the lender for this loan offer.
active
boolean
Boolean indicating whether the offer is currently available for borrowing.
quoteToken
object
Metadata of the token being borrowed. This object is only included when includeTokens
query parameter is set to True.
Contains:
address
name
symbol
decimals
logoURI
currentPrice
currentPriceLastUpdated
collateralToken
object
Metadata of the collateral token. This object is only included when includeTokens
query parameter is set to True.
Contains:
address
name
symbol
decimals
logoURI
currentPrice
currentPriceLastUpdated
priceVsQuote
string
Current price of the collateral token denominated in the quote token.
maxLeverage
number
Maximum leverage multiplier available for this offer. Currently capped at 4x.
maxOpenPerTrade
string
Maximum amount that can be borrowed in a single trade from this offer.
availableForOpen
string
Current amount available for new positions from this offer.
tags
array
Specified tag for loan offers. Can be empty array if no tags are assigned.
openLTV
string
Maximum loan-to-value ratio at which new positions can be opened. This should be equivalent to 1 / maxLeverage
.
createdAt
string
ISO datetime when this offer was created.
updatedAt
number
UNIX timestamp when this offer was updated.
account
object
Account metadata. This object is only included when includeRawData
query parameter is set to True.
Contains:
apr
collateralType
maxBorrow
(This field is soon to be deprecated β οΈ)maxExposure
currentExposure
nodeWallet
maxBorrow
string
Should be ignored - this field is soon to be deprecated. β οΈ
Response Example
{
"publicKey": "EnweNn1hjL1UdX4Zm5fLqrxhas2ftyb91SYDxPPMhcWL",
"programId": "CRSeeBqjDnm3UPefJ9gxrtngTsnQRhEJiTA345Q83X3v",
"apr": 99,
"maxExposure": "407",
"currentExposure": "13.145187899",
"nodeWallet": "6riP1W6R3qzUPWYwLGtXEC23aTqmyAEdDtXzhntJquAh",
"active": true,
"quoteToken": {
"address": "So11111111111111111111111111111111111111112",
"name": "Wrapped SOL",
"symbol": "SOL",
"decimals": 9,
"logoURI": "https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png",
"currentPrice": "184.64688341",
"currentPriceLastUpdated": 1753028005752
},
"collateralToken": {
"address": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm",
"name": "dogwifhat",
"symbol": "$WIF",
"decimals": 6,
"logoURI": "https://bafkreibk3covs5ltyqxa272uodhculbr6kea6betidfwy3ajsav2vjzyum.ipfs.nftstorage.link",
"currentPrice": "1.27439217",
"currentPriceLastUpdated": 1753027971938
},
"priceVsQuote": "0.0069918507",
"maxLeverage": 3.196,
"maxOpenPerTrade": "10",
"availableForOpen": "10.000",
"tags": [],
"openLTV": "0.718400",
"createdAt": "2025-03-05T18:31:40.705Z",
"updatedAt": 1753027972217,
"account": {
"apr": "0.99",
"collateralType": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm",
"maxExposure": "407000000000",
"currentExposure": "13145187899",
"nodeWallet": "6riP1W6R3qzUPWYwLGtXEC23aTqmyAEdDtXzhntJquAh"
}
}
GET /offers/match
Retrieves all available loan offers for a specific quote-collateral token pair, including additional metadata to help identify the most suitable offer.
Query Parameters
quoteToken
Yes
string
Address of the token being borrowed.
collateralToken
Yes
string
Collateral token address
Headers
x-api-key
Yes
string
API key
Example Request
GET /offers/match?quoteToken=So11111111111111111111111111111111111111112&collateralToken=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Response Fields
publicKey
string
Address of the loan offer.
programId
string
Identifier for the smart contract program managing the offer.
apr
number
Annual interest rate for this offer in percentage form, e.g. 169.
maxExposure
string
Maximum lending amount for this loan offer in quote token.
currentExposure
string
Current amount in quote token that is currently borrowed against this loan offer.
nodeWallet
string
Address of the lender for this loan offer.
active
boolean
Boolean indicating whether the offer is currently available for borrowing.
quoteToken
string
Address of the token being borrowed.
collateralToken
string
Collateral token address
priceVsQuote
string
Current price of the collateral token denominated in the quote token.
maxLeverage
number
Maximum leverage multiplier available for this offer. Currently capped at 4x.
maxOpenPerTrade
string
Maximum amount that can be borrowed in a single trade from this offer.
availableForOpen
string
Current amount available for new positions from this offer.
tags
array
Specified tag for loan offers. Can be empty array if no tags are assigned.
openLTV
string
Maximum loan-to-value ratio at which new positions can be opened. This should be equivalent to 1 / maxLeverage
.
createdAt
string
ISO datetime when this offer was created.
updatedAt
number
UNIX timestamp when this offer was updated.
metadata
object
Metadata that could be shown to users when there are multiple loan offers for the same quote-collateral token pair. Contains:
lowestAPR
(the lowest APR amongst all offers)highestLTV
(the highestopenLTV
amongst all offers)highestAmountAvailable
(the amount of the loan offer with the highestavailableForOpen
)
maxBorrow
string
Should be ignored β οΈ - this field is soon to be deprecated.
Response Example
{
"offers": [
{
"publicKey": "GFJrBEkFqjmZ7GxWh34ikFAmG4Dzer18ZSDKUZNLNRSs",
"programId": "CRSeeBqjDnm3UPefJ9gxrtngTsnQRhEJiTA345Q83X3v",
"apr": 99,
"maxExposure": "407",
"currentExposure": "1.527",
"nodeWallet": "6riP1W6R3qzUPWYwLGtXEC23aTqmyAEdDtXzhntJquAh",
"active": true,
"quoteToken": "So11111111111111111111111111111111111111112",
"collateralToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"priceVsQuote": "0.0055515097",
"maxLeverage": 4,
"maxOpenPerTrade": "200.000",
"availableForOpen": "405.473",
"tags": [],
"openLTV": "0.776245",
"createdAt": "2025-03-05T18:31:40.705Z",
"updatedAt": 1754924550797
},
{
"publicKey": "J8QPJ5gzQNoRW2YNxPRF98arN7pju1jAZKNbfvkmCST8",
"programId": "CRSeeBqjDnm3UPefJ9gxrtngTsnQRhEJiTA345Q83X3v",
"apr": 59,
"maxExposure": "300",
"currentExposure": "0",
"nodeWallet": "FB3iLhuELvMys6LmS1RAz9a8Gn4Lqna8TdniGDcPprKL",
"active": true,
"quoteToken": "So11111111111111111111111111111111111111112",
"collateralToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"priceVsQuote": "0.0055515097",
"maxLeverage": 3.284,
"maxOpenPerTrade": "200.000",
"availableForOpen": "300.000",
"tags": [],
"openLTV": "0.725939",
"createdAt": "2025-06-03T03:03:49.002Z",
"updatedAt": 1754924550640
}
],
"metadata": {
"lowestAPR": "0.59",
"highestLTV": 0.7762445231789832,
"highestAmountAvailable": "200000000000.000"
}
}
GET /positions/v3
Provides real-time position monitoring. Supports filtering by status and includes transitional states.
Query Parameters
status
No
string
Filters by status of the position: open
, closed
, liquidated
or all
. It's All by default.
userPubKey
No
string
Wallet address of the trader.
includeInactionable
No
boolean
Include positions that cannot be acted upon. It's False by default.
createdAfter
No
string
Shows positions created after a specific datetime. For detailed information, refer to the Time-based Filtering section.
createdBefore
No
string
Shows positions created before a specific datetime. For detailed information, refer to the Time-based Filtering section.
Headers
x-api-key
Yes
string
API key
Example Request
GET https://lavarave.wtf/api/sdk/v1.0/positions/v3?status=all&userPubKey=3qE9X2RwUsauS39gjD7Ago7q5y1iwkHBDwMyihaGzxyy&includeInactionable=true
Response Fields
onChainStatus
string
Current on-chain status of the position transaction. For detailed information, refer to the Position Lifecycle section.
isActionable
boolean
Boolean indicating whether the position can be acted upon.
status
string
Current status of the position: active
, sold
, sold by take profit
, repaid
, liquidated
or failed
.
openTimestamp
string
ISO datetime when the position was opened.
closeTimestamp
string
ISO datetime when the position was closed. For open positions, this shows "1970-01-01T00:00:00.000Z".
quoteToken
object
Metadata of the token being borrowed. Contains:
address
name
symbol
decimals
collateralToken
object
Metadata for the collateral token.
Contains:
address
name
symbol
decimals
initialBorrowQuote
string
Amount borrowed when the position was opened in quote token.
initialMarginQuote
string
Initial margin provided by the user when opening the position in quote token.
apr
number
Annual interest rate for this offer in percentage form, e.g. 169.
lastInterestCollectTimestamp
string
ISO datetime of the last interest collection. Only present when auto-collect occurred, otherwise not included in the response.
initialPositionBase
string
The size of the position in collateral tokens when it was opened.
closePositionQuote
string
The size of the position in quote token when it was closed.
Only present for closed & liquidated positions. Shows "0" for active
and failed
positions.
currentPrice
string
When position = active
, this shows the current price of the collateral token in quote token terms.
When position = closed
or liquidated
, this shows the price at the time of closing.
positionLtv
number
Current Loan-to-Value ratio as decimal (e.g., 0.75 = 75%).
positionAddress
string
Address of the position.
offerAddress
string
Address of the loan offer.
traderAddress
string
Wallet address of the trader.
entryPrice
number
Price at which the position was opened.
interestAccrued
number
Total interest accrued on this position.
liquidationPrice
number
Price at which the lender may liquidate the position.
offerCreatedAt
string
ISO datetime when the original loan offer was created.
updatedAt
number
UNIX timestamp of the last update to this position record.
takeProfitPrice
string
Price at which the take profit order will attempt to sell the position. Only present when a take profit price is set for this position.
positionValue
(Beta)
object
Calculated position value object containing current valuation and PnL. This field is in beta testing and may change in future releases.
Response Example
{
"onChainStatus": "EXECUTED",
"isActionable": true,
"status": "active",
"openTimestamp": "2025-06-21T20:09:46.000Z",
"closeTimestamp": "1970-01-01T00:00:00.000Z",
"quoteToken": {
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6
},
"collateralToken": {
"address": "5UUH9RTDiSpq6HKS6bp4NdU9PNJpXRXuiw6ShBTBhgH2",
"name": "TROLL",
"symbol": "TROLL",
"decimals": 6
},
"initialBorrowQuote": "1983.75",
"initialMarginQuote": "1250",
"apr": 169,
"lastInterestCollectTimestamp": "2025-07-21T02:49:47.000Z",
"initialPositionBase": "216548.227914",
"closePositionQuote": "0",
"currentPrice": "0.0211537163",
"positionLtv": 0.4350626813191232,
"positionAddress": "Aq8fpvRW2qBURRcxyyJ99VUmDmJNxNhnbMuQMJFbBSMa",
"offerAddress": "EbvPQqzarjTUV5cTXuUz9MjQEHb8MMfpTsoRFH6YQREg",
"traderAddress": "5zX5TajSP6qM36FTgsxapYJKniGi19cV3ztPEG4zSUSJ",
"entryPrice": 0.014933163070188006,
"interestAccrued": 9.185034246575343,
"liquidationPrice": 0.010225769481491157,
"offerCreatedAt": "2025-04-21T03:55:52.248Z",
"updatedAt": "2025-06-21T20:09:46.000Z",
"positionValue": {
"valueInQuoteToken": 4580.799778560497,
"pnlInQuoteToken": 1337.8647443139216
}
}
Position Lifecycle
The onChainStatus
field tracks the lifecycle of a position. This field provides critical information about the current state of positions to understand and respond appropriately to position transitions.
Status Types
NEW
Position created in API, but transaction not yet submitted (auto-fails after 90 seconds)
SUBMITTED
Transaction submitted to blockchain, but not confirmed (auto-fails after 90 seconds)
ONCHAIN
Transaction confirmed on blockchain, but position details not fully synchronized
EXECUTED
Position fully synchronized and active
CLOSED
User initiated closing, transaction in progress (transitional state)
CLOSED_EXECUTED
Position successfully closed and synchronized
FAILED
Position creation failed
Error Flow
NEW
βFAILED
(if not submitted within 90 seconds)SUBMITTED
βFAILED
(if not confirmed within 90 seconds)
Actionable Positions
A position is considered "actionable" if it is in one of the following states:
ONCHAIN
EXECUTED
Actionable positions are those that:
Are confirmed on the blockchain
Can have operations performed on them (sell, repay, etc.)
Time-based Filtering
You can filter your position queries by creation date (i.e. openTimestamp
) to retrieve positions from specific time periods.
Supported formats for these parameters:
ISO date, e.g.
2025-07-31
ORISO datetime, e.g.
2025-07-31T12:01:05.000Z
ORRelative period labels:
1d
,1w
,1m
,3m
,6m
,1y
whered
= day,w
= week,m
= month,y
= yearThese labels will be converted into datetime on the server side, e.g.
1w
would be the datetime equal to the time now minus 1 week
Examples:
Get all positions created on a specific date, July 30th, 2025:
createdAfter=2025-07-30&createdBefore=2025-07-31
Get all positions created within 1 day from now:
createdAfter=1d
Get all positions created more than 1 month ago:
createdBefore=1m
POST /positions/open
Open new spot margin position.
Headers
x-api-key
Yes
string
API key
Example Request
POST https://lavarave.wtf/api/sdk/v1.0/positions/open
Request Body Fields
offerId
Yes
string
Address of the loan offer.
marginSOL
Yes
number
Amount of collateral being deposited. SOL in lamports and USDC in micro-units.
leverage
Yes
number
Leverage multiplier.
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.
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. 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. 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
{
"offerId": "GjKds3RantjgzWn9gBPUTty9wSCxEKsPke1PL4bscDVP",
"marginSOL": 50000000,
"leverage": 2,
"partnerFeeRecipient": "6JfTobDvwuwZxZP6FR5JPmjdvQ4h4MovkEVH2FPsMSrF",
"partnerFeeMarkupBps": 200,
"quoteToken": "So11111111111111111111111111111111111111112",
"slippage": 1000,
"userPubKey": "Ahtpvhub1Z2z3y1RUYPDb7iUkv2J9fYByWWaitPeQXVp"
}
Response Example
{
"transaction": "base58_encoded_serialized_transaction"
}
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/sell
Request 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"
}
POST /positions/partial-repay
Reduces leverage and liquidation risk by partially repaying loan obligations.
Headers
x-api-key
Yes
string
API key
Example Request
POST https://lavarave.wtf/api/sdk/v1.0/positions/partial-repay
Request Body Fields
positionId
Yes
string
Address of the position.
repaymentBps
Yes
number
Percentage in basis points of the position to be repaid. Range: 100-9900
quoteToken
Yes
string
Address of the token being borrowed.
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. β οΈ
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": "u29ftYd7vfAAxHSk2hbLRsHcdC3SfcgFUdh2HxmVU1m",
"partnerFeeRecipient": "6JfTobDvwuwZxZP6FR5JPmjdvQ4h4MovkEVH2FPsMSrF",
"repaymentBps": 5000,
"quoteToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"userPubKey": "Ahtpvhub1Z2z3y1RUYPDb7iUkv2J9fYByWWaitPeQXVp"
}
Response Example
{
"transaction": "base58_encoded_serialized_transaction"
}
POST /positions/repay
Closes positions by repaying loan and receiving collateral tokens.
Headers
x-api-key
Yes
string
API key
Example Request
POST https://lavarave.wtf/api/sdk/v1.0/positions/repay
Request Body Fields
positionId
Yes
string
Address of the position.
quoteToken
Yes
string
Address of the token being borrowed.
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.
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": "u29ftYd7vfAAxHSk2hbLRsHcdC3SfcgFUdh2HxmVU1m",
"partnerFeeRecipient": "6JfTobDvwuwZxZP6FR5JPmjdvQ4h4MovkEVH2FPsMSrF",
"quoteToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"userPubKey": "Ahtpvhub1Z2z3y1RUYPDb7iUkv2J9fYByWWaitPeQXVp"
}
Response Example
{
"transaction": "base58_encoded_serialized_transaction"
}
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
x-api-key
Yes
string
API key
Example Request
POST https://lavarave.wtf/api/sdk/v1.0/positions/split
Request Body Fields
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
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"
}
POST /positions/take-profit
Set automated take profit instruction for open positions.
Headers
x-api-key
Yes
string
API key
Example Request
POST https://lavarave.wtf/api/sdk/v1.0/positions/take-profit
Request Body Fields
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
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
x-api-key
Yes
string
API key
Example Request
PUT https://lavarave.wtf/api/sdk/v1.0/positions/take-profit
Request Body Fields
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
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
x-api-key
Yes
string
API key
Example Request
DELETE https://lavarave.wtf/api/sdk/v1.0/positions/take-profit
Request Body Fields
positionId
Yes
string
Address of the position.
quoteToken
Yes
string
Address of the token being borrowed.
Response Fields
transaction
string
Base58 encoded serialized transaction ready for signing.
Request Body Example
{
"positionId": "H6bY8DDoMpDNKQLJz3BDEaK3PfkBgKbSkfvU9N7ptahS",
"quoteToken": "So11111111111111111111111111111111111111112"
}
Response Example
{
"success": true
}
POST /lender/offers/create
Generate a transaction to create a new loan offer for a specific collateral token.
Headers
x-api-key
Yes
string
API key
Content-Type
Yes
string
application/json
Example Request
POST https://lavarave.wtf/api/sdk/v1.0/lender/offers/create
Request Body Fields
collateralToken
Yes
string
Collateral token address
quoteToken
Yes
string
Address of the token being borrowed.
maxExposure
Yes
number
Maximum total exposure the lender is willing to take
interestRate
Yes
number
Annual interest rate for this offer in percentage form, e.g. 169.
userWallet
Yes
string
User wallet address.
nodeWallet
Yes
string
Address of the node providing liquidity for this offer.
Response Fields
success
boolean
Boolean indicating whether the offer operation was successful
transaction
string
Base58 encoded serialized transaction ready for signing.
message
string
Human-readable message describing the operation result.
Request Body Example
{
"nodeWallet": "8Pfbw51h5gVdxzTpXN4FFtV6vHe3g63ohrrfmYVEqjSx",
"userWallet": "Ahtpvhub1Z2z3y1RUYPDb7iUkv2J9fYByWWaitPeQXVp",
"collateralToken": "87bZzcXXHnQRjB4AmYQWCCdRaeGUSiaA7DgUEBYqpump",
"quoteToken": "So11111111111111111111111111111111111111112",
"maxExposure": 3000000000,
"interestRate": 88
}
Response Example
{
"success": true,
"transaction": "9Bj7JpYHDjMvbCM3jD559VAExahDDU7x6ji22z4XygRJ8zbvtuAYpy1SNPHrzxJyLjtR6zwjxfQbYVAmgr4uKEbNrQXZ24RmDPmPNHK4PK9BtznMpk5bXtc3XJiiG15BUkVg1L9wYSbH9XvsFrpH8a3QQJPYmf6hBnwApBAYWtt11ziaES5qXzrEuzd6zJpSBpzVukYw9A7zUoCAnJue4J1UpXaH8ugX1eEw6kvhnVT8Z79u8tTaJxb2rFWsbwZNsHGed6G2kvf5kRiif8zQv61agJziBQ46NtR3nxx2PbzP5545zf86NHt1GQphiXVP2Sqm4abeKqi2rjdYkUAgkrWynMKFKjFJKtazrGZzSvzBsHtSGhEz7V32MoAJJrACheLR3hv16oR77dKnc3JPSFkHmb6ddu6DnyGBaF6q1dxa6REc8JQ7bbyxm2XdKkfrZjNgDfN6hi9bftw4Li4L1kjUb",
"message": "Offer creation transaction generated. Sign and submit to create offer."
}
PUT /lender/offers/update
Generate a transaction to update a loan offer.
Headers
x-api-key
Yes
string
API key
Content-Type
Yes
string
application/json
Example Request
POST https://lavarave.wtf/api/sdk/v1.0/lender/offers/update
Request Body Fields
collateralToken
Yes
string
Collateral token address
quoteToken
Yes
string
Address of the token being borrowed.
maxExposure
Yes
number
Maximum total exposure the lender is willing to take
interestRate
Yes
number
Annual interest rate for this offer in percentage form, e.g. 169.
userWallet
Yes
string
User wallet address.
nodeWallet
Yes
string
Address of the node providing liquidity for this offer.
Response Fields
success
boolean
Boolean indicating whether the offer operation was successful
transaction
string
Base58 encoded serialized transaction ready for signing.
message
string
Human-readable message describing the operation result.
Request Body Example
{
"nodeWallet": "8Pfbw51h5gVdxzTpXN4FFtV6vHe3g63ohrrfmYVEqjSx",
"userWallet": "Ahtpvhub1Z2z3y1RUYPDb7iUkv2J9fYByWWaitPeQXVp",
"collateralToken": "87bZzcXXHnQRjB4AmYQWCCdRaeGUSiaA7DgUEBYqpump",
"quoteToken": "So11111111111111111111111111111111111111112",
"maxExposure": 3000000000,
"interestRate": 88
}
Response Example
{
"success": true,
"transaction": "9Bj7JpYHDjMvbCM3jD559VAExahDDU7x6ji22z4XygRJ8zbvtuAYpy1SNPHrzxJyLjtR6zwjxfQbYVAmgr4uKEbNrQXZ24RmDPmPNHK4PK9BtznMpk5bXtc3XJiiG15BUkVg1L9wYSbH9XvsFrpH8a3QQJPYmf6hBnwApBAYWtt11ziaES5qXzrEuzd6zJpSBpzVukYw9A7zUoCAnJue4J1UpXaH8ugX1eEw6kvhnVT8Z79u8tTaJxb2rFWsbwZNsHGed6G2kvf5kRiif8zQv61agJziBQ46NtR3nxx2PbzP5545zf86NHt1GQphiXVP2Sqm4abeKqi2rjdYkUAgkrWynMKFKjFJKtazrGZzSvzBsHtSGhEz7V32MoAJJrACheLR3hv16oR77dKnc3JPSFkHmb6ddu6DnyGBaF6q1dxa6REc8JQ7bbyxm2XdKkfrZjNgDfN6hi9bftw4Li4L1kjUb",
"message": "Offer update transaction generated. Sign and submit to update offer."
}
PUT /lender/offers/changeLTV
Change the LTV of an offer.
Headers
x-api-key
Yes
string
API key
Content-Type
Yes
string
application/json
Example Request
PUT https://lavarave.wtf/api/sdk/v1.0/lender/offers/changeLTV
Request Body Fields
offerAddress
Yes
string
Address of the loan offer.
signature
Yes
string
Signature of the change request.
newLTV
Yes
number
New LTV ratio as a decimal value. Setting LTV to 0 closes the offer. Range: 0 to 0.8
Response Fields
success
boolean
Boolean indicating whether the LTV change was successful.
transaction
string
Base58 encoded serialized transaction ready for signing (empty for LTV changes).
message
string
Confirms the new LTV value that was applied to the offer.
Request Body Example
{
"offerAddress": "2UeBsPFcfeVq4thdeCaXpLw3gPh4HhbKbye6SukhCCzJ",
"signature": "WJbFzTRxLMcS5ETtD4vaepNBMu6L8nfiLuDac8Eqk6KEjiRP94kEB3t7iSE1p6XYuguStPcqatqgZV1L6SkoQVu",
"newLTV": 0.8
}
Response Example
{
"success": true,
"transaction": "",
"message": "LTV updated to 0.8"
}
GET /lender/offers
Retrieves all available lender loan offers.
Query Parameters
lenderWallet
Yes
string
Lender wallet address.
inactiveOffers
No
boolean
Include inactive offers in the response. It's False by default.
includeRawData
No
boolean
Include raw on-chain offer account data. It's False by default.
chain
No
string
Chain to use for the offers.
tags
No
string
Specified tag for loan offers.
Headers
x-api-key
Yes
string
API key
Example Request
GET https://lavarave.wtf/api/sdk/v1.0/lender/offers?lenderWallet=Ahtpvhub1Z2z3y1RUYPDb7iUkv2J9fYByWWaitPeQXVp&inactiveOffers=false&includeRawData=true
Response Fields
publicKey
string
Address of the loan offer.
programId
string
Identifier for the smart contract program managing the offer.
apr
number
Annual interest rate for this offer in percentage form, e.g. 169.
maxExposure
string
Maximum lending amount for this loan offer in quote token.
currentExposure
string
Current amount in quote token that is currently borrowed against this loan offer.
nodeWallet
string
Address of the lender for this loan offer.
active
boolean
Boolean indicating whether the offer is currently available for borrowing.
quoteToken
object
Metadata of the token being borrowed. This object is only included when includeTokens
query parameter is set to True.
Contains:
address
name
symbol
decimals
logoURI
currentPrice
currentPriceLastUpdated
collateralToken
object
Metadata of the collateral token. This object is only included when includeTokens
query parameter is set to True.
Contains:
address
name
symbol
decimals
logoURI
currentPrice
currentPriceLastUpdated
priceVsQuote
string
Current price of the collateral token denominated in the quote token.
maxLeverage
number
Maximum leverage multiplier available for this offer. Currently capped at 4x.
maxOpenPerTrade
string
Maximum amount that can be borrowed in a single trade from this offer.
availableForOpen
string
Current amount available for new positions from this offer.
tags
array
Specified tag for loan offers. Can be empty array if no tags are assigned.
openLTV
string
Maximum loan-to-value ratio at which new positions can be opened. This should be equivalent to 1 / maxLeverage
.
createdAt
string
ISO datetime when this offer was created.
updatedAt
number
UNIX timestamp when this offer was updated.
account
object
Account metadata. This object is only included when includeRawData
query parameter is set to True.
Contains:
apr
collateralType
maxBorrow
(This field is soon to be deprecated β οΈ)maxExposure
currentExposure
nodeWallet
maxBorrow
string
Should be ignored β οΈ - this field is soon to be deprecated.
Response Example
{
"publicKey": "EnweNn1hjL1UdX4Zm5fLqrxhas2ftyb91SYDxPPMhcWL",
"programId": "CRSeeBqjDnm3UPefJ9gxrtngTsnQRhEJiTA345Q83X3v",
"apr": 99,
"maxExposure": "407",
"currentExposure": "13.145187899",
"nodeWallet": "6riP1W6R3qzUPWYwLGtXEC23aTqmyAEdDtXzhntJquAh",
"active": true,
"quoteToken": {
"address": "So11111111111111111111111111111111111111112",
"name": "Wrapped SOL",
"symbol": "SOL",
"decimals": 9,
"logoURI": "https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png",
"currentPrice": "184.64688341",
"currentPriceLastUpdated": 1753028005752
},
"collateralToken": {
"address": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm",
"name": "dogwifhat",
"symbol": "$WIF",
"decimals": 6,
"logoURI": "https://bafkreibk3covs5ltyqxa272uodhculbr6kea6betidfwy3ajsav2vjzyum.ipfs.nftstorage.link",
"currentPrice": "1.27439217",
"currentPriceLastUpdated": 1753027971938
},
"priceVsQuote": "0.0069918507",
"maxLeverage": 3.196,
"maxOpenPerTrade": "10",
"availableForOpen": "10.000",
"tags": [],
"openLTV": "0.718400",
"createdAt": "2025-03-05T18:31:40.705Z",
"updatedAt": 1753027972217,
"account": {
"apr": "0.99",
"collateralType": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm",
"maxExposure": "407000000000",
"currentExposure": "13145187899",
"nodeWallet": "6riP1W6R3qzUPWYwLGtXEC23aTqmyAEdDtXzhntJquAh"
}
}
POST /lender/pools/deposit
Generate a transaction to deposit funds to a lending pool.
Headers
x-api-key
Yes
string
API key
Content-Type
Yes
string
application/json
Example Request
POST https://lavarave.wtf/api/sdk/v1.0/lender/pools/deposit
Request Body Fields
amount
Yes
number
Amount to deposit (in smallest token units).
quoteToken
Yes
string
Address of the token being borrowed.
userWallet
Yes
string
User wallet address.
authorizedWallet
No
string
Assigned authorized wallet address through the /lender/withdrawal-access/add
endpoint. Can be revoked and defaulted to the original lenderWallet
by using the /lender/withdrawal-access/remove
endpoint.
Response Fields
success
boolean
Boolean indicating whether the transaction generation was successful.
transaction
string
Base58 encoded serialized transaction ready for signing.
message
string
Human-readable message describing the operation.
Request Body Example
{
"amount": 170000000,
"quoteToken": "So11111111111111111111111111111111111111112",
"userWallet": "Ahtpvhub1Z2z3y1RUYPDb7iUkv2J9fYByWWaitPeQXVp"
}
Response Example
{
"success": true,
"transaction": "G219h4XBGMwZQmb5akLTinHZ2pZeoauwzRGQp92MjQ9MRSSHe38ir9NbHgAwXZnFLHW9s77CdHGpWEedXMM5ktZNCFduP89AexCUE1rjzs2nvfUwBJ6VtF3WJ6DXmHGLE7vC6U27D7kFGgoU6QBPvLrFAg18CYpGWxwd1XLXeN1a9im2zAZq85uxEdZYGvz5yyMKCeD5rnTNtsuTxmhd9Rt5oB32NoWUb9mMSUe8ngpJCNUTgQELMBEpdVGCUg9T7S36oU1GaxPoGNxTzCBQaB4JpaJaNBZFR9DF5dzs5RhqRvETfmHsNw9FoVRU6vwFuqqPfEGoHzP7MdM5k9c55e4rRgo7p5BYnZAH8susFkxMK8oUJkcyxijWVBvi5ozvHJL4UNMusnsV4Dmt2zaKqNpE7qSBz4k39r5Az5TUX9oi6HNeGs8JUduMACpnP3Y8ckF",
"message": "Deposit transaction generated. Sign and submit to complete deposit."
}
POST /lender/pools/withdraw
Generate a transaction to withdraw funds from a lending pool.
Headers
x-api-key
Yes
string
API key
Content-Type
Yes
string
application/json
Example Request
POST https://lavarave.wtf/api/sdk/v1.0/lender/pools/withdraw
Request Body Fields
amount
Yes
number
Amount to withdraw (in smallest token units).
quoteToken
Yes
string
Address of the token being borrowed.
userWallet
Yes
string
User wallet address.
authorizedWallet
No
string
Assigned authorized wallet address through the /lender/withdrawal-access/add
endpoint. Can be revoked and defaulted to the original lenderWallet
by using the /lender/withdrawal-access/remove
endpoint.
Response Fields
success
boolean
Boolean indicating whether the transaction generation was successful.
transaction
string
Base58 encoded serialized transaction ready for signing.
message
string
Human-readable message describing the operation.
Request Body Example
{
"amount": 170000000,
"quoteToken": "So11111111111111111111111111111111111111112",
"userWallet": "Ahtpvhub1Z2z3y1RUYPDb7iUkv2J9fYByWWaitPeQXVp"
}
Response Example
{
"success": true,
"transaction": "G219h4XBGMwZQmb5akLTinHZ2pZeoauwzRGQp92MjQ9MRSSHe38ir9NbHgAwXZnFLHW9s77CdHGpWEedXMM5ktZNCFduP89AexCUE1rjzs2nvfUwBJ6VtF3WJ6DXmHGLE7vC6U27D7kFGgoU6QBPvLrFAg18CYpGWxwd1XLXeN1a9im2zAZq85uxEdZYGvz5yyMKCeD5rnTNtsuTxmhd9Rt5oB32NoWUb9mMSUe8ngpJCNUTgQELMBEpdVGCUg9T7S36oU1GaxPoGNxTzCBQaB4JpaJaNBZFR9DF5dzs5RhqRvETfmHsNw9FoVRU6vwFuqqPfEGoHzP7MdM5k9c55e4rRgo7p5BYnZAH8susFkxMK8oUJkcyxijWVBvi5ozvHJL4UNMusnsV4Dmt2zaKqNpE7qSBz4k39r5Az5TUX9oj6HNeGs8JUduMACpnP3Y8ckF",
"message": "Withdrawal transaction generated. Sign and submit to complete withdrawal."
}
GET /lender/pools/balance
Balance information for lending pools
Query Parameters
userWallet
Yes
string
User wallet address
quoteToken
Yes
string
Address of the token being borrowed.
Headers
x-api-key
Yes
string
API key
Content-Type
Yes
string
application/json
Example Request
GET https://lavarave.wtf/api/sdk/v1.0/lender/pools/balance?userWallet=7xK8L9pVaLuZKfXzJtWd3QtyKhjGfBHoX7h8rzZfFyGx"eToken=So11111111111111111111111111111111111111112
Response Fields
quoteToken
string
Address of the token being borrowed.
nodeWallet
string
Node wallet address associated with this lending pool.
balances
object
Object containing detailed balance information. Contains:
total
(Total pool balance - available + deployed)available
(Available balance that can be withdrawn or lent out)deployed
(Currently lent out to active positions)
Response Example
{
"quoteToken": "So11111111111111111111111111111111111111112",
"nodeWallet": "9yMzL8pVaLuZKfXzJtWd3QtyKhjGfBHoX7h8rzZfFyGx",
"balances": {
"total": 1000.5,
"available": 750.3,
"deployed": 250.2
}
}
GET /lender/positions
Provides real-time position monitoring
Query Parameters
lenderWallet
Yes
string
Lender wallet address.
status
No
string
Filters by status of the position: open
, closed
, liquidated
or all
. Itβs All by default.
includeInactionable
No
boolean
Include positions that cannot be acted upon. Itβs False by default.
Headers
x-api-key
Yes
string
API key
Content-Type
Yes
string
application/json
Request Example
GET https://lavarave.wtf/api/sdk/v1.0/lender/positions?lenderWallet=Ahtpvhub1Z2z3y1RUYPDb7iUkv2J9fYByWWaitPeQXVp&status=open
Response Fields
onChainStatus
string
Current on-chain status of the position transaction. For detailed information, refer to the Position Lifecycle section.
isActionable
boolean
Boolean indicating whether the position can be acted upon.
status
string
Current status of the position: active
, sold
, sold by take profit
, repaid
, liquidated
or failed
.
openTimestamp
string
ISO datetime when the position was opened.
closeTimestamp
string
ISO datetime when the position was closed. For open positions, this shows "1970-01-01T00:00:00.000Z".
quoteToken
object
Metadata of the token being borrowed.
Contains:
address
name
symbol
decimals
collateralToken
object
Metadata for the collateral token.
Contains:
address
name
symbol
decimals
initialBorrowQuote
string
Amount borrowed when the position was opened in quote token.
initialMarginQuote
string
Initial margin provided by the user when opening the position in quote token.
apr
number
Annual interest rate for this offer in percentage form, e.g. 169.
lastInterestCollectTimestamp
string
ISO datetime of the last interest collection. Only present when auto-collect occurred, otherwise not included in the response.
initialPositionBase
string
The size of the position in collateral tokens when it was opened.
closePositionQuote
string
The size of the position in quote token when it was closed.
Only present for closed & liquidated positions. Shows "0" for active
and failed
positions.
currentPrice
string
When position = active
, this shows the current price of the collateral token in quote token terms.
When position = closed
, this shows the price at the time of closing.
positionLtv
number
Current Loan-to-Value ratio as decimal (e.g., 0.75 = 75%).
positionAddress
string
Address of the position.
offerAddress
string
Address of the loan offer.
traderAddress
string
Wallet address of the trader.
entryPrice
number
Price at which the position was opened.
interestAccrued
number
Total interest accrued on this position.
liquidationPrice
number
Price at which the lender may liquidate the position.
offerCreatedAt
string
ISO datetime when the original loan offer was created.
updatedAt
number
UNIX timestamp of the last update to this position record.
takeProfitPrice
string
Price at which the take profit order will attempt to sell the position. Only present when a take profit price is set for this position.
positionValue
(Beta)
object
Calculated position value object containing current valuation and PnL. This field is in beta testing and may change in future releases.
Response Example
{
"onChainStatus": "EXECUTED",
"isActionable": true,
"status": "active",
"openTimestamp": "2025-06-21T20:09:46.000Z",
"closeTimestamp": "1970-01-01T00:00:00.000Z",
"quoteToken": {
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6
},
"collateralToken": {
"address": "5UUH9RTDiSpq6HKS6bp4NdU9PNJpXRXuiw6ShBTBhgH2",
"name": "TROLL",
"symbol": "TROLL",
"decimals": 6
},
"initialBorrowQuote": "1983.75",
"initialMarginQuote": "1250",
"apr": 169,
"lastInterestCollectTimestamp": "2025-07-21T02:49:47.000Z",
"initialPositionBase": "216548.227914",
"closePositionQuote": "0",
"currentPrice": "0.0211537163",
"positionLtv": 0.4350626813191232,
"positionAddress": "Aq8fpvRW2qBURRcxyyJ99VUmDmJNxNhnbMuQMJFbBSMa",
"offerAddress": "EbvPQqzarjTUV5cTXuUz9MjQEHb8MMfpTsoRFH6YQREg",
"traderAddress": "5zX5TajSP6qM36FTgsxapYJKniGi19cV3ztPEG4zSUSJ",
"entryPrice": 0.014933163070188006,
"interestAccrued": 9.185034246575343,
"liquidationPrice": 0.010225769481491157,
"offerCreatedAt": "2025-04-21T03:55:52.248Z",
"updatedAt": "2025-06-21T20:09:46.000Z",
"positionValue": {
"valueInQuoteToken": 4580.799778560497,
"pnlInQuoteToken": 1337.8647443139216
}
}
Last updated