DCAv2Earn/test.py

97 lines
2.6 KiB
Python

import libraries.balance_accounts as balance_accounts
from libraries.wrappers import earn_binance
from libraries.wrappers import earn_kucoin
from libraries.wrappers import earn_okx
from libraries.wrappers import earn_gateio
import json
kucoin = earn_kucoin.kucoin_earn()
binance = earn_binance.binance_earn()
okx = earn_okx.okx_earn()
gateio = earn_gateio.gateio_earn()
if __name__=="__main__":
'''
DONE:
1. Unified get_position
2. Unified get_available_products
TODO:
1. subscription and redeem returns unification
2. Gate.io returns 204 code if subscription or redemption were successful (What were they thinking?)
'''
'''
Subscribe workflow in Binance:
1. Get product id
2. Subscribe
Redeem workflow in Binance
1. Redeem with the same product id
'''
#print(binance.get_available_products("USDT"))
#print(binance.subscribe_product("USDT001", "10", auto_subscribe=False))
#print(binance.get_position("USDT"))
#print(binance.redeem_product("USDT001", amount="10.00003989"))
'''
Subscribe workflow in Kucoin
1. Get product id
2. Subscribe
Redeem workflow in Kucoin
1. Get ORDER id (the order id of the position)
2. Redeem
'''
#print(kucoin.get_available_products("USDT"))
#print(kucoin.subscribe_product("2152", "10"))
#print(kucoin.get_position("USDT"))
#print(kucoin.redeem_product(order_id="2987632", amount="10"))
'''
Subscribe workflow in OKX
1. Transfer funds to funding account
2. Confirm transfer via transfer_id
3. Subscribe
Redeem workflow in OKX
1. Reddem product (with coin, no id is required)
2. Transfer funds to trading account
3. Confirm transfer via transfer_id
'''
#print(okx.get_available_products("USDT"))
#print(okx.transfer_to_funding("USDT","10"))
#print(okx.get_transfer_state("1064007151"))
#print(okx.subscribe_product("USDT", "10"))
#print(okx.get_position("USDT"))
#print(okx.redeem_product("USDT", "10"))
#print(okx.transfer_to_trading("USDT", "10"))
#print(okx.get_transfer_state("1064541068"))
'''
Subscribe workflow in Gate.io
1. Get minimum rate
2. Subscribe product
3. Use get_account to confirm (request returns error?)
Redeem workflow in Gate.io
1. Reddem product
2. Use get_account to confirm (request returns error?)
'''
#print(gateio.get_min_rate("USDT"))
#print(gateio.subscribe_product("USDT", "10", "0.00000452"))
#print(gateio.get_position("USDT"))
#print(gateio.redeem_product("USDT", "10"))
pass