Class: Cryptohopper::Resources::Arbitrage

Inherits:
Object
  • Object
show all
Defined in:
lib/cryptohopper/resources/arbitrage.rb

Overview

‘client.arbitrage` — exchange + market arbitrage + shared backlog.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Arbitrage

Returns a new instance of Arbitrage.



7
8
9
# File 'lib/cryptohopper/resources/arbitrage.rb', line 7

def initialize(client)
  @client = client
end

Instance Method Details

#backlog(backlog_id) ⇒ Object



66
67
68
69
# File 'lib/cryptohopper/resources/arbitrage.rb', line 66

def backlog(backlog_id)
  @client._request("GET", "/arbitrage/get-backlog",
                   params: { backlog_id: backlog_id })
end

#backlogs(**params) ⇒ Object

─── Backlog (shared) ─────────────────────────────────────────────



61
62
63
64
# File 'lib/cryptohopper/resources/arbitrage.rb', line 61

def backlogs(**params)
  @client._request("GET", "/arbitrage/get-backlogs",
                   params: params.empty? ? nil : params)
end

#delete_backlog(backlog_id) ⇒ Object



71
72
73
74
# File 'lib/cryptohopper/resources/arbitrage.rb', line 71

def delete_backlog(backlog_id)
  @client._request("POST", "/arbitrage/delete-backlog",
                   body: { backlog_id: backlog_id })
end

#exchange_cancel(data = {}) ⇒ Object



17
18
19
# File 'lib/cryptohopper/resources/arbitrage.rb', line 17

def exchange_cancel(data = {})
  @client._request("POST", "/arbitrage/cancel", body: data)
end

#exchange_history(**params) ⇒ Object



26
27
28
29
# File 'lib/cryptohopper/resources/arbitrage.rb', line 26

def exchange_history(**params)
  @client._request("GET", "/arbitrage/history",
                   params: params.empty? ? nil : params)
end

#exchange_reset_totalObject



35
36
37
# File 'lib/cryptohopper/resources/arbitrage.rb', line 35

def exchange_reset_total
  @client._request("POST", "/arbitrage/resettotal", body: {})
end

#exchange_results(**params) ⇒ Object



21
22
23
24
# File 'lib/cryptohopper/resources/arbitrage.rb', line 21

def exchange_results(**params)
  @client._request("GET", "/arbitrage/results",
                   params: params.empty? ? nil : params)
end

#exchange_start(data) ⇒ Object

─── Cross-exchange arbitrage ─────────────────────────────────────



13
14
15
# File 'lib/cryptohopper/resources/arbitrage.rb', line 13

def exchange_start(data)
  @client._request("POST", "/arbitrage/exchange", body: data)
end

#exchange_totalObject



31
32
33
# File 'lib/cryptohopper/resources/arbitrage.rb', line 31

def exchange_total
  @client._request("GET", "/arbitrage/total")
end

#market_cancel(data = {}) ⇒ Object



45
46
47
# File 'lib/cryptohopper/resources/arbitrage.rb', line 45

def market_cancel(data = {})
  @client._request("POST", "/arbitrage/market-cancel", body: data)
end

#market_history(**params) ⇒ Object



54
55
56
57
# File 'lib/cryptohopper/resources/arbitrage.rb', line 54

def market_history(**params)
  @client._request("GET", "/arbitrage/market-history",
                   params: params.empty? ? nil : params)
end

#market_result(**params) ⇒ Object



49
50
51
52
# File 'lib/cryptohopper/resources/arbitrage.rb', line 49

def market_result(**params)
  @client._request("GET", "/arbitrage/market-result",
                   params: params.empty? ? nil : params)
end

#market_start(data) ⇒ Object

─── Intra-exchange market arbitrage ──────────────────────────────



41
42
43
# File 'lib/cryptohopper/resources/arbitrage.rb', line 41

def market_start(data)
  @client._request("POST", "/arbitrage/market", body: data)
end