Module: Bitfinex::RESTv1MarginFunding
- Included in:
- RESTv1
- Defined in:
- lib/rest/v1/margin_funding.rb
Instance Method Summary collapse
-
#cancel_offer(offer_id) ⇒ Hash
Cancel an offer.
-
#close_funding(swap_id) ⇒ Hash
Allow you to close an unused or used taken fund.
-
#credits ⇒ Array
View your funds currently taken (active credits).
-
#new_offer(currency, amount, rate, period, direction, frrdelta = false) ⇒ Hash
Submit a new offer.
-
#offer_status(offer_id) ⇒ Hash
Get the status of an offer.
-
#offers ⇒ Array
View your active offers.
-
#taken_funds ⇒ Array
View your funding currently borrowed and used in a margin position.
-
#total_taken_funds ⇒ Array
View the total of your active funding used in your position(s).
-
#unused_taken_funds ⇒ Array
View your funding currently borrowed and not used (available for a new margin position).
Instance Method Details
#cancel_offer(offer_id) ⇒ Hash
Cancel an offer
@example:
client.cancel_offer(1000)
33 34 35 |
# File 'lib/rest/v1/margin_funding.rb', line 33 def cancel_offer(offer_id) authenticated_post("offer/cancel", params: {offer_id: offer_id.to_i}).body end |
#close_funding(swap_id) ⇒ Hash
Allow you to close an unused or used taken fund
@example:
client.close_funding(1000)
98 99 100 |
# File 'lib/rest/v1/margin_funding.rb', line 98 def close_funding(swap_id) authenticated_post("funding/close", params: {swap_id: swap_id.to_i}).body end |
#credits ⇒ Array
View your funds currently taken (active credits)
@example:
client.credits
52 53 54 |
# File 'lib/rest/v1/margin_funding.rb', line 52 def credits authenticated_post("credits").body end |
#new_offer(currency, amount, rate, period, direction, frrdelta = false) ⇒ Hash
Submit a new offer
@example:
client.new_offer("btc", 10.0, 20, 365, "lend")
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rest/v1/margin_funding.rb', line 15 def new_offer(currency, amount, rate, period, direction, frrdelta=false) params = { currency: currency, amount: amount.to_s, rate: rate.to_s, period: period.to_i, direction: direction, frrdelta: !!frrdelta } authenticated_post("offer/new", params: params).body end |
#offer_status(offer_id) ⇒ Hash
Get the status of an offer. Is it active? Was it cancelled? To what extent has it been executed? etc.
@example:
client.offer_status(1000)
43 44 45 |
# File 'lib/rest/v1/margin_funding.rb', line 43 def offer_status(offer_id) authenticated_post("offer/status", params: {offer_id: offer_id.to_i}).body end |
#offers ⇒ Array
View your active offers
@example:
client.offers
61 62 63 |
# File 'lib/rest/v1/margin_funding.rb', line 61 def offers authenticated_post("offers").body end |
#taken_funds ⇒ Array
View your funding currently borrowed and used in a margin position
@example:
client.taken_funds
70 71 72 |
# File 'lib/rest/v1/margin_funding.rb', line 70 def taken_funds authenticated_post("taken_funds").body end |
#total_taken_funds ⇒ Array
View the total of your active funding used in your position(s).
@example:
client.total_taken_funds
88 89 90 |
# File 'lib/rest/v1/margin_funding.rb', line 88 def total_taken_funds authenticated_post("total_taken_funds").body end |
#unused_taken_funds ⇒ Array
View your funding currently borrowed and not used (available for a new margin position).
@example:
client.unused_taken_funds
79 80 81 |
# File 'lib/rest/v1/margin_funding.rb', line 79 def unused_taken_funds authenticated_post("unused_taken_funds").body end |