Deals List

This endpoint retrieves all the deals of the specified user

Get List of All Deals for a User

GET https://api.aitrade.com/api/deals

To obtain deals associated with a specific bot, provide the bot_id

Query Params

Name
Type
Required
Description

bot_id

integer

Filters deals related to the specified bot id.

status

string

Filter the list by status, options are open or close

page_size

integer

maximum number of items returned per request

page

integer

Current page number for pagination

Responses:

  • Success (200): Returns the list of deals created by the bots and other specific settings of the deal.

  • Failure (401): Unauthenticated, indicating you're not logged in or lack permission to carry out the request.


{
    "code": 200,
    "message": "Success",
    "deals": {
        "current_page": 1,
        "data": [
            {
                "id": 37515,
                "deleted_at": null,
                "bot_id": 7443,
                "status": "working",
                "status_key": "in_progress",
                "strategy": "Long",
                "exchange_pair_id": 2,
                "profit": 1.48,
                "stop_loss": 10,
                "updated_at": "2024-01-31 14:54:09",
                "created_at": "2024-01-31 14:54:05",
                "exit_price": 0,
                "user_id": 1,
                "exchange_id": 0,
                "pair_id": 1,
                "note": null,
                "apy_rate": null,
                "meta": null,
                "pair": {
                    "id": 1,
                    "from": "AAPL",
                    "to": "USD",
                    "name": "AAPL-USD",
                    "kline_exchange_id": 16,
                    "quote_image": "https://yourdomain/path_to_image_file",
                    "base_image": "https://yourdomain/path_to_image_file"
                },
                "bot_name": "Test Extra params Rent",
                "bot_rent_id": 49,
                "bot_type": "",
                "pair_name": "AAPL/USD",
                "base_name": "USD",
                "quote_name": "AAPL",
                "exchange_image": "https://yourdomain/path_to_image_file",
                "tp_price": 0,
                "stop_loss_price": 166.61,
                "current_price": "172.84",
                "average_cost": 185.12,
                "base_order_price": 185.25,
                "lo_price": "172.84",
                "executed_vol": 370.24,
                "quantity": 2,
                "net_profit": -24.560000000000002,
                "profit_value": -6.633535004321521,
                "profit_value_abs": 0,
                "closed_orders": [
                    {
                        "name": "EO",
                        "quantity": 1,
                        "side": "BUY",
                        "description": "Buy 1 AAPL @ 184.99 USD",
                        "date": "2024-01-31 15:36",
                        "average": 184.99,
                        "exchange_pair": {
                            "id": 2,
                            "exchange_id": 0,
                            "pair_id": 1,
                            "name": "AAPL/USD",
                            "price_precision": 2,
                            "amount_precision": 0,
                            "pair": {
                                "id": 1,
                                "from": "AAPL",
                                "to": "USD",
                                "name": "AAPL-USD",
                                "kline_exchange_id": 16,
                                "quote_image": "https://yourdomain/path_to_image_file",
                                "base_image": "https://yourdomain/path_to_image_file"
                            }
                        }
                    }
                ],
                "open_orders": [],
                "position": null,
                "status_name": "Deal In Progress"
            }
        ],
        "first_page_url": "https://api.stockhero.ai/api/deals?page=1",
        "from": 1,
        "last_page": 1,
        "last_page_url": "https://api.stockhero.ai/api/deals?page=1",
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "https://api.stockhero.ai/api/deals?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next »",
                "active": false
            }
        ],
        "next_page_url": null,
        "path": "https://api.stockhero.ai/api/deals",
        "per_page": 10,
        "prev_page_url": null,
        "to": 2,
        "total": 2
    }
}

Last updated