Skip to content

RoscoeTheDog/ApolloXV1-Python-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

ApolloX V1 Python API

image

APX V1 is a great decentralized solution for trading strategies that require more frequent purchase orders, such as in a DCA strategy, due to its low transactions costs and fast speeds.

Currently there is no wrapper for depositing / withdrawing to and from a vault via hotstorage wallet. I may use web3 to implement this later. Users can deposit money on the front end of the platforms website for now.

Example usage:

    import apolloxv1
    import logging

    logger = logging.getLogger('root_logger')

    params = {
    	'api_key': 'api_key_val',
        'api_secret': 'api_secret_val',
    }
    
    APX = apolloxv1.ApolloXV1(kwargs=params)
    
    # if no price given, it will be a market order. Otherwise, limit order instead.
    request = APX.create_order(symbol='BTCUSDT', 'long', 100)	# $100 USDT purchase order
    
    # check order status
    receipt = APX.fetch_order(request.get('id'))
    order_status = receipt.get('status')
    
    # raise if key not found in receipt for whatever reason
    if order_status is None:
    	raise ValueError('order status None type')
    
    # do stuff dependent on state.
    order_status = str.upper(order_status)
    if order_status == 'CANCELED' or order_status == 'EXPIRED':
    	logger.warning('order status "canceled"')
    elif order_status == 'ACTIVE' or order_status == 'NEW':
    	logger.info('order status "active"')
    elif order_status == 'FILLED':
    	logger.info('order status "filled"')

Like my work? Buy me a drink! ☕🍺
****

About

A python wrapper for ApolloXV1 dex

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages