question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GDAX create limit buy and sell orders

See original GitHub issue
  • OS: Ubuntu 16.04.3 LTS
  • Programming Language version: Python 3.5.1
  • CCXT version: 1.10.749
  • Exchange: GDAX
  • Method: exchange.create_limit_buy_order and exchange.create_limit_sell_order

When trying to post a buy order i receive the following error: ccxt.base.errors.ExchangeError: gdax {"message":"Insufficient funds"}

I’m fetching the first bid and truncating to get the amount without float rounding to 8 decimals with the following code: price = exchange.fetch_l2_order_book(symbol)['bids'][0][0] amount = math.trunc(pow(10.0, 8) * (quote_balance / price)) / pow(10.0, 8)

Lowering the bid price buy 10 also causes the same error.

As for the limit sell order the order was filled as taker instead of maker so the fees were applied. Is there a way to force maker orders always?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
wannesdemaeghtcommented, Jan 20, 2018

maker or taker is only defined by the price. If you post a limit SELL order equal or higher to lowest ask, it’s a maker order. If you post a limit BUY order equal or lower to highest bid, it’s a maker order.

Basically, if you post a trade which will get filled immediately, you’re a taker.

0reactions
kz0commented, Jan 20, 2018

Problem of insufficient funds is because of this: quote_balance / price

That is only for the buying amount. If i had 10 ETH to sell my order amount would be my base balance.

Try exchange.create_limit_buy_order(symbol, amount, price, { ‘post_only’: true }). Hope it helps.

I’ve tested with the string first and it works, going to change it to bool to see if it works too. Thank you for your help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 Limit orders as makers | Trading on Coinbase Pro - GDAX
In this video, let's look at the next two limit order configurations. We are ready to move to the buy - buy and...
Read more >
Stop-limit order | How to set the limit | Coinbase Pro - GDAX
How to choose a limit price for a stop order. Let's take a look. See the full GDAX playlist here: VIDEO SECTIONS 00:00...
Read more >
4 Limit orders as takers | Trading on Coinbase Pro - GDAX
In this video, we are going to keep talking about order types and parameters. We looked at market orders in the previous video...
Read more >
8 Stop-Limit orders | Trading on Coinbase Pro - GDAX
Market, Limit, Stop, Stop- Limit | Order type summary explanation · Moving average explained | EMA12 and EMA26 on Coinbase Pro - GDAX...
Read more >
Buy as a MAKER (LOWER FEE) on Coinbase Pro | Limit Order
How to trade Bitcoin on GDAX and pay 0% trading fees by placing a buy order at the top of the order book...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found