How to use our api
Endpoint for Manual Trading
Method: POST
URL: https://api-prod.wl.bot/api/portfolio/handle/execute
This endpoint allows you to manually buy or sell tokens in the system.
π€ Request Body Parameters
token_address
string
β Yes
The address of the token you want to operate with.
token_pool
string
β No
The liquidity pool address. If omitted, the system will select the most liquid one automatically.
amount
float/int
β Yes
For BUY: the amount in SOL. For SELL: percentage from 1 to 100.
type
string
β Yes
The operation type. Use BUY
for purchases or SELL_PERCENTAGE
for selling a percentage of your holdings.
π Example: Buy Token
Request:
POST https://api-prod.wl.bot/api/portfolio/handle/execute
Headers:
Authorization: Bearer jwttoken.example...
Content-Type: application/json
Body:
{
"token_address": "J3NKxxXZcnNiMjKw9hYb2K4LUxgwB6t1FtPtQVsv3KFr",
"amount": 0.00001,
"type": "BUY"
}
Description:
This request buys the token J3NKxxXZcnNiMjKw9hYb2K4LUxgwB6t1FtPtQVsv3KFr
for 0.00001 SOL
.
πΈ Example: Sell Token
Request:
POST https://api-prod.wl.bot/api/portfolio/handle/execute
Headers:
Authorization: Bearer jwttoken.example...
Content-Type: application/json
Body:
{
"token_address": "J3NKxxXZcnNiMjKw9hYb2K4LUxgwB6t1FtPtQVsv3KFr",
"amount": 50,
"type": "SELL_PERCENTAGE"
}
Description:
This request sells 50%
of the held amount of the token J3NKxxXZcnNiMjKw9hYb2K4LUxgwB6t1FtPtQVsv3KFr
.
β οΈ Important Notes
When buying, the
amount
must be in SOL.When selling, the
amount
must be a percentage between 1 and 100.
π JWT Token Refresh
When your current JWT token expires, you must obtain a new one using the token refresh endpoint.
π Token Refresh Endpoint
Method: GET
URL: https://api-prod.wl.bot/api/auth/token/refresh
Headers:
Authorization: Bearer your_current_jwt_token
β
Example Request
GET https://api-prod.wl.bot/api/auth/token/refresh
Authorization: Bearer jwttoken.example...
π’ Example Response
{
"token": "new_valid.jwt.token"
}
β οΈ Warning
If you do not refresh your token in time, you will receive a 401 Unauthorized
error when making requests.
Last updated
Was this helpful?