When it fires
POST /v1/trades refused a sell before sending it on, because all of these were true:
- This API key’s previous sell of the same
marketIdandoutcomeIndex, from the same account, failed because the account held nothing on that outcome. That earlier trade readsstatus: "failed"anderrorCode: "no_position"onGET /v1/trades/{id}, and its id is named indetail. - That failure is less than an hour old.
- Nothing has given the account a position on that outcome since: no buy of it has landed, through the API or any other Kash channel.
How to fix
- Do not re-send the same sell in a loop. It keeps getting this answer until something changes.
- Check what the account holds with
GET /v1/portfolio/positions. - Buy the outcome first. Once that buy has landed, a sell is accepted as usual.
- After an hour a sell is sent on again, and the account’s position is checked afresh.