Market Endpoints

class idex.client.Client(api_key, address=None, private_key=None)[source]
get_tickers()[source]

Get all market tickers

Please note: If any field is unavailable due to a lack of trade history or a lack of 24hr data, the field will be set to ‘N/A’. percentChange, baseVolume, and quoteVolume will never be ‘N/A’ but may be 0.

https://github.com/AuroraDAO/idex-api-docs#returnticker

tickers = client.get_tickers()
Returns:API Response
{
    ETH_SAN:  {
        last: '0.000981',
        high: '0.0010763',
        low: '0.0009777',
        lowestAsk: '0.00098151',
        highestBid: '0.0007853',
        percentChange: '-1.83619353',
        baseVolume: '7.3922603247161',
        quoteVolume: '7462.998433'
    },
    ETH_LINK: {
        last: '0.001',
        high: '0.0014',
        low: '0.001',
        lowestAsk: '0.002',
        highestBid: '0.001',
        percentChange: '-28.57142857',
        baseVolume: '13.651606265667369466',
        quoteVolume: '9765.891979953083752189'
    }
    # all possible markets follow ...
}
Raises:IdexResponseException, IdexAPIException
get_ticker(market)[source]

Get ticker for selected market

Please note: If any field is unavailable due to a lack of trade history or a lack of 24hr data, the field will be set to ‘N/A’. percentChange, baseVolume, and quoteVolume will never be ‘N/A’ but may be 0.

https://github.com/AuroraDAO/idex-api-docs#returnticker

Parameters:market (string) – Name of market e.g. ETH_SAN
ticker = client.get_ticker('ETH_SAN')
Returns:API Response
{
    last: '0.000981',
    high: '0.0010763',
    low: '0.0009777',
    lowestAsk: '0.00098151',
    highestBid: '0.0007853',
    percentChange: '-1.83619353',
    baseVolume: '7.3922603247161',
    quoteVolume: '7462.998433'
}
Raises:IdexResponseException, IdexAPIException
get_24hr_volume()[source]

Get all market tickers

https://github.com/AuroraDAO/idex-api-docs#return24volume

volume = client.get_24hr_volume()
Returns:API Response
{
    ETH_REP: {
        ETH: '1.3429046745',
        REP: '105.29046745'
    },
    ETH_DVIP: {
        ETH: '4',
        DVIP: '4'
    },
    totalETH: '5.3429046745'
}
Raises:IdexResponseException, IdexAPIException
get_order_book(market, count=1)[source]

Get order book for selected market

Each market returned will have an asks and bids property containing all the sell orders and buy orders sorted by best price. Order objects will contain a price amount total and orderHash property but also a params property which will contain additional data about the order useful for filling or verifying it.

https://github.com/AuroraDAO/idex-api-docs#returnorderbook

Parameters:
  • market (string) – Name of market e.g. ETH_SAN
  • count (int) – Number of items to return
orderbook = client.get_order_book('ETH_SAN')
Returns:API Response
{
    asks: [
        {
            price: '2',
            amount: '1',
            total: '2',
            orderHash: '0x6aee6591def621a435dd86eafa32dfc534d4baa38d715988d6f23f3e2f20a29a',
            params: {
                tokenBuy: '0x0000000000000000000000000000000000000000',
                buySymbol: 'ETH',
                buyPrecision: 18,
                amountBuy: '2000000000000000000',
                tokenSell: '0xf59fad2879fb8380ffa6049a48abf9c9959b3b5c',
                sellSymbol: 'DVIP',
                sellPrecision: 8,
                amountSell: '100000000',
                expires: 190000,
                nonce: 164,
                user: '0xca82b7b95604f70b3ff5c6ede797a28b11b47d63'
            }
        }
    ],
    bids: [
        {
            price: '1',
            amount: '2',
            total: '2',
            orderHash: '0x9ba97cfc6d8e0f9a72e9d26c377be6632f79eaf4d87ac52a2b3d715003b6536e',
            params: {
                tokenBuy: '0xf59fad2879fb8380ffa6049a48abf9c9959b3b5c',
                buySymbol: 'DVIP',
                buyPrecision: 8,
                amountBuy: '200000000',
                tokenSell: '0x0000000000000000000000000000000000000000',
                sellSymbol: 'ETH',
                sellPrecision: 18,
                amountSell: '2000000000000000000',
                expires: 190000,
                nonce: 151,
                user: '0xca82b7b95604f70b3ff5c6ede797a28b11b47d63'
            }
        }
    ]
}
Raises:IdexResponseException, IdexAPIException