Poloniex

CryptoExchangeAPIs.Poloniex.PoloniexClientType
PoloniexClient <: AbstractAPIsClient

Client info.

Required fields

  • base_url::String: Base URL for the client.

Optional fields

  • public_key::String: Public key for authentication.
  • secret_key::String: Secret key for authentication.
  • interface::String: Interface for the client.
  • proxy::String: Proxy information for the client.
  • account_name::String: Account name associated with the client.
  • description::String: Description of the client.
source

Spot

CryptoExchangeAPIs.Poloniex.Spot.Candle.candleFunction
candle(client::PoloniexClient, query::CandleQuery)
candle(client::PoloniexClient = Poloniex.Spot.public_client; kw...)

Get latest trade price for all symbols.

GET markets/{symbol}/price

Parameters:

ParameterTypeRequiredDescription
intervalTimeIntervaltruem1 m5 m10 m15 m30 h1 h2 h4 h6 h12 d1 d3 w1 M1
symbolStringfalse
startTimeDateTimefalse
endTimeDateTimefalse
limitInt64false

Code samples:

using Serde
using CryptoExchangeAPIs.Poloniex

result = Poloniex.Spot.candle(;
    symbol = "BTC_USDT",
    interval = CryptoExchangeAPIs.Poloniex.Spot.Candle.m5,
    startTime = now(UTC) - Minute(100),
    endTime = now(UTC) - Hour(1),
)

to_pretty_json(result.result)

Result:

[
  {
    "low":65575.65,
    "high":65691.47,
    "open":65691.47,
    "close":65646.11,
    "amount":136992.38,
    "quantity":2.086813,
    "buyTakerAmount":70208.28,
    "buyTakerQuantity":1.069507,
    "tradeCount":117,
    "ts":1715873094983,
    "weightedAverage":65646.71,
    "interval":"MINUTE_5",
    "startTime":"2024-05-16T15:20:00",
    "closeTime":"2024-05-16T15:24:59.999000064"
  },
  ...
]
source
CryptoExchangeAPIs.Poloniex.Spot.Currency.currencyFunction
currency(client::PoloniexClient, query::CurrencyQuery)
currency(client::PoloniexClient = Poloniex.Spot.public_client; kw...)

Get all supported currencies.

GET v2/currencies

Code samples:

using Serde
using CryptoExchangeAPIs.Poloniex

result = Poloniex.Spot.currency()

to_pretty_json(result.result)

Result:

[
  {
    "id":446,
    "coin":"AAVE",
    "delisted":false,
    "tradeEnable":true,
    "name":"Aave",
    "networkList":[
      {
        "id":446,
        "coin":"AAVE",
        "name":"Ethereum",
        "currencyType":"address",
        "blockchain":"ETH",
        "withdrawalEnable":true,
        "depositEnable":true,
        "depositAddress":null,
        "withdrawMin":-1.0,
        "decimals":8.0,
        "withdrawFee":0.0946982,
        "minConfirm":64
      }
    ],
    "supportCollateral":false,
    "supportBorrow":false
  },
  ...
]
source
CryptoExchangeAPIs.Poloniex.Spot.Market.marketFunction
market(client::PoloniexClient, query::MarketQuery)
market(client::PoloniexClient = Poloniex.Spot.public_client; kw...)

Get all symbols and their tradeLimit info.

GET markets/{symbol}

Parameters:

ParameterTypeRequiredDescription
symbolStringfalse

Code samples:

using Serde
using CryptoExchangeAPIs.Poloniex

result = Poloniex.Spot.market(;
    symbol = "BTC_USDT",
)

to_pretty_json(result.result)

Result:

[
  {
    "symbol":"BTC_USDT",
    "baseCurrencyName":"BTC",
    "quoteCurrencyName":"USDT",
    "displayName":"BTC/USDT",
    "state":"NORMAL",
    "visibleStartTime":"2022-07-28T14:33:39.512",
    "tradableStartTime":"2022-07-28T14:33:39.512",
    "symbolTradeLimit":{
      "symbol":"BTC_USDT",
      "amountScale":2,
      "highestBid":0.0,
      "lowestAsk":0.0,
      "minAmount":1.0,
      "minQuantity":1.0e-6,
      "priceScale":2,
      "quantityScale":6
    },
        "crossMargin":{
      "maxLeverage":3,
      "supportCrossMargin":true
    }
  }
]
source
CryptoExchangeAPIs.Poloniex.Spot.OrderBook.order_bookFunction
order_book(client::PoloniexClient, query::OrderBookQuery)
order_book(client::PoloniexClient = Poloniex.Spot.public_client; kw...)

Get the order book for a given symbol.

GET markets/{symbol}/orderBook

Parameters:

ParameterTypeRequiredDescription
symbolStringfalse
limitOrderBookLimitfalseFIVE (5), TEN (10), TWENTY (20), FIFTY (50), HUNDRED (100), HUNDRED_FIFTY (150)
scaleInt64false

Code samples:

using Serde
using CryptoExchangeAPIs.Poloniex

result = Poloniex.Spot.order_book(;
    symbol = "BTC_USDT",
    limit = CryptoExchangeAPIs.Poloniex.Spot.OrderBook.FIVE,
)

to_pretty_json(result.result)

Result:

{
  "asks":[
    65281.6,
    0.047754,
    65289.99,
    0.034131,
    ...
  ],
  "bids":[
    65220.41,
    0.140174,
    65220.4,
    0.004296,
    ...
  ],
  "scale":0.01,
  "time":"2024-05-16T17:07:48.972999936",
  "ts":"2024-05-16T17:07:48.987000064"
}
source
CryptoExchangeAPIs.Poloniex.Spot.Ticker.tickerFunction
ticker(client::PoloniexClient, query::TickerQuery)
ticker(client::PoloniexClient = Poloniex.Spot.public_client; kw...)

Retrieve ticker in last 24 hours for all symbols.

GET markets/{symbol}/ticker24h

Parameters:

ParameterTypeRequiredDescription
symbolStringfalse

Code samples:

using Serde
using CryptoExchangeAPIs.Poloniex

result = Poloniex.Spot.ticker(;
    symbol = "BTC_USDT",
)

to_pretty_json(result.result)

Result:

{
  "symbol":"BTC_USDT",
  "displayName":"BTC/USDT",
  "amount":7.911171301524143e7,
  "ask":65322.3,
  "askQuantity":0.047754,
  "bid":65265.21,
  "bidQuantity":0.000457,
  "close":65294.16,
  "closeTime":"2024-05-16T17:09:07.225999872",
  "dailyChange":0.0062,
  "high":66664.38,
  "low":64757.87,
  "markPrice":65327.98,
  "open":64894.14,
  "quantity":1200.477812,
  "startTime":"2024-05-15T17:09:00",
  "tradeCount":61923,
  "ts":"2024-05-16T17:09:14.984"
}
source