gateio / gateapi-python

243 stars 91 forks source link

Facing problem while using price trigger API #144

Open akashc-25 opened 1 year ago

akashc-25 commented 1 year ago

I'm using the POST /spot/price_orders API to create the price trigger order. When I hit the API, it creates an open order in gate.io, but when the last price of the crypto crosses the trigger order price, the status of that order fails (Status in gate.io's Order history tab). I don't know why it's going to fail.

I've attached the snippet of my code below.

spot_price_trigger_order = SpotPriceTriggeredOrder(
        trigger={
            "price": "0.041290", # Trigger amount
            "rule": '<=',
            "expiration": 2592000
        },
        put={
            "type": 'limit',
            "side": "sell",
            "price": "0.041290", # Trigger amount
            "amount": "5", # Amount that I want to sell
            "account": "normal",
            "time_in_force": "gtc"
        },
        market="DOT5S_USDT"
    )
api_response = api_instance.create_spot_price_triggered_order(spot_price_trigger_order)

Here, I've set the price to "0.041290."  When the last price became "0.041260,"  it was failing, but here our condition is true.

Any help will be appreciated.

akashc-25 commented 1 year ago

Can anyone please help?

revilwang commented 1 year ago

Can you please provide your user ID and price trigger order ID and send the details to dev@gate.io so we can have a deeper check.

akashc-25 commented 1 year ago

I've share details on provided mail.

revilwang commented 1 year ago

Message received. We'll have a check

revilwang commented 1 year ago

The trigger order's value is less than 1 USDT, which didn't satisfy the minimum order amount in DOT5S_USDT. The server right now is adding more input check to reject such request to inform the client beforehand instead of delaying to the trigger time(deployment time is not certain at the moment).

akashc-25 commented 1 year ago

Okay, Thanks for your update. I'll try this