Module: Bitfinex::Funding

Included in:
Client
Defined in:
lib/bitfinex/api/funding.rb

Instance Method Summary collapse

Instance Method Details

#funding_cancel_all_offers(currency = "USD") ⇒ Object



37
38
39
40
41
42
# File 'lib/bitfinex/api/funding.rb', line 37

def funding_cancel_all_offers(currency = "USD")
  res = request("auth/w/funding/offer/cancel/all", {
    currency: currency,
  }).body
  return JSON.parse(res)
end

#funding_cancel_offer(id) ⇒ Object



29
30
31
32
33
34
# File 'lib/bitfinex/api/funding.rb', line 29

def funding_cancel_offer(id)
  res = request("auth/w/funding/offer/cancel", {
    id: id,
  }).body
  return JSON.parse(res)
end

#funding_create_offer(currency, amount, rate, period, type = "LIMIT", is_hidden = false) ⇒ Object

掛單docs.bitfinex.com/reference#submit-funding-offer type = LIMIT, FRRDELTAVAR, FRRDELTAFIX)



47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/bitfinex/api/funding.rb', line 47

def funding_create_offer(currency, amount, rate, period, type = "LIMIT", is_hidden = false)
  flag = is_hidden ? 64 : 0
  # auth/w/funding/offer/submit
  res = request("auth/w/funding/offer/submit", {
    type: type,
    symbol: currency, #fUSD
    amount: amount, #借款要是負的
    rate: rate,
    period: period,
    flags: flag,
  }).body
  res = JSON.parse(res)
  return res
end

#funding_credit(currency = "fUSD") ⇒ Object



77
78
79
80
# File 'lib/bitfinex/api/funding.rb', line 77

def funding_credit(currency = "fUSD")
  res = request("auth/r/funding/credits/#{currency}").body
  return JSON.parse(res)
end

#funding_credit_allObject

所有正在借款列表Ratelimit: 45 req/min docs.bitfinex.com/reference#rest-auth-funding-credits



72
73
74
75
# File 'lib/bitfinex/api/funding.rb', line 72

def funding_credit_all
  res = request("auth/r/funding/credits").body
  return JSON.parse(res)
end

#funding_info(currency = "fUSD") ⇒ Object

列出放貸總績效Ratelimit: 45 req/min docs.bitfinex.com/reference#rest-auth-info-funding



6
7
8
9
# File 'lib/bitfinex/api/funding.rb', line 6

def funding_info(currency = "fUSD")
  res = request("auth/r/info/funding/#{currency}").body
  return JSON.parse(res)
end

#funding_loans(currency = "fUSD") ⇒ Object



82
83
84
85
# File 'lib/bitfinex/api/funding.rb', line 82

def funding_loans(currency = "fUSD")
  res = request("auth/r/funding/loans/#{currency}").body
  return JSON.parse(res)
end

#funding_new_offer(params) ⇒ Object



63
64
65
66
67
# File 'lib/bitfinex/api/funding.rb', line 63

def funding_new_offer(params)
  res = v1_request("offer/new", params)
  res = JSON.parse(res)
  return res
end

#funding_offers(currency = "fUSD") ⇒ Object

列出currency掛單Ratelimit: 45 req/min docs.bitfinex.com/reference#rest-auth-funding-offers



22
23
24
25
# File 'lib/bitfinex/api/funding.rb', line 22

def funding_offers(currency = "fUSD")
  res = request("auth/r/funding/offers/#{currency}").body
  return JSON.parse(res)
end

#funding_offers_allObject

列出所有正在掛單Ratelimit: 45 req/min docs.bitfinex.com/reference#rest-auth-funding-offers



14
15
16
17
# File 'lib/bitfinex/api/funding.rb', line 14

def funding_offers_all
  res = request("auth/r/funding/offers").body
  return JSON.parse(res)
end