I believe there is some bugs in the Lending API of bitfinex. I was unable to make a new lending offer by POST method to
https://api.bitfinex.com/v1/offer/new. Here are the situations.
1. The API documentation stated that insurance_option is optional. However, when this parameter is omitted, HTTP 500 error is returned.
2. I can get a response with insurance_option specified, but the response is always "Invalid offer: not enough balance". I have checked using the wallet balances API to make sure there is enough balance and also make sure that the amount is greater than the minimum lending amount (100USD).
Any updates on this? I have contacted
support@bitfinex.com 2 times on this issue and so far no response for a few weeks.
The insurance option was set up after the April 10th crash in order to give full protection to liquidity providers (LP).
An LP that buys insurance pays an extra 20% commission ( 30% instead of 10%) but will be refunded also in case of a "black swan" event.
Should the BTC price collapse from the actual value to 0 within an eyeblink, insured LP will still get refunded in full.
Unfortunately the total amount is limited to about 55,000 usd ( it grows as 15% of the extra 20% taken as commission is re-invested in the fund, 5% goes to the person that set up the fund).
55,000 usd has to be considered in total, not per person.
First in, first served.
No need to say that this amount is always taken in full 99% of the time.
That is why you get the response "not enough balance".
The API documentation states that insurance is optional, not that the parameter can be omitted.
I hope this helps
Have a good day
Giancarlo
Bitfinex Team
Thanks for the reply.
I know that insurance can be optional. But from the documentation, it states the parameter is optional (Also it had a default value, which means when the parameter is omitted, default value is used instead).
New Offer
insurance_option (optional, integer): 0 for "No insurance", 1 for "Insurance if available", 2 for "Always insure" (default is 0)
Similar to the get the lendbook API, I can get the lendbook without any parameters since they are all optional .
limit_bids (int): Optional. Limit the number of bids (loan demands) returned. May be 0 in which case the array of bids is empty. Default is 50.
limit_asks (int): Optional. Limit the number of asks (loan offers) returned. May be 0 in which case the array of asks is empty. Default is 50.
Actually the above is not important, I do not care about the insurance parameter is optional or not as long as the API works.
I always feed in the insurance_option = 0 which means "No insurance", but still return "not enough balance" all the time.
That's why I have no choice, and need ask for help in email and this forum. I know the bug in API is not the top priority of your bitfinex team, but I just need the API to finish the last puzzle of my program.
Thanks for the time. I know it is Christmas now and your team is still working hard in answering questions. Wish you a Merry Christmas.