How to buy with Poloniex API? Hi I have a question about buy method. Recently I received successful message from Poloniex
I run once buy order method with option immediateOrCancel.
I get two trades instead of the expected one.

{'orderNumber': '269159954730', 'amountUnfilled': '0.00000000', 'resultingTrades': [{'total': '0.00323034', 'tradeID': '16775174', 'amount': '0.10364748', 'rate': '0.03116670', 'date': '2018-04-22 10:59:11', 'type': 'buy'}, {'total': '0.05271018', 'tradeID': '16775175', 'amount': '1.68942915', 'rate': '0.03120000', 'date': '2018-04-22 10:59:11', 'type': 'buy'}]}


Could someone help me with that or say why it's happend?
What was your purchase amount set at? 0.03120000??

It would appear that you tried to buy at 0.03120000

however as there was a sell order already placed at 0.03116670 you filled that order first, then completed your buy with the rest of the amount at the 0.03120000