/swift-trader

A Swift package for connecting and trading on crypto exchanges such as Kucoin and Binance.

Primary LanguageSwiftMIT LicenseMIT

swift-version swift-package-manager platforms platforms license

swift-trader

A Swift package for connecting and trading on crypto exchanges such as Kucoin and Binance.

💰 It can calculate the stop and limit prices for a trailing stop strategy based on a set of given input parameters.
Refer to SwiftTrader+TrailingStop.swift

🤖 Supports being deployed to Heroku (Linux). Tested with Vapor. This means trading automation by using webhooks and scripts such as the Profit Percentage Tracker (TradingView). #ka-ching!

📖 List of working APIs:

Kucoin

Kucoin Futures Explanation API Documentation
SwiftTrader.kucoinFuturesAccountOverview Retrieves the overview of a Kucoin Futures account. https://docs.kucoin.com/futures/#account
SwiftTrader.kucoinFuturesStopOrderList Retrieves the list of un-triggered stop orders. https://docs.kucoin.com/futures/#get-untriggered-stop-order-list
SwiftTrader.kucoinFuturesOrderList Retrieves the list of active Futures orders. https://docs.kucoin.com/futures/#get-order-list
SwiftTrader.kucoinFuturesPlaceStopLimitOrder Places a Futures stop limit order. https://docs.kucoin.com/futures/#place-an-order
SwiftTrader.kucoinFuturesCancelStopOrders Cancels all untriggered Futures stop orders of a given symbol (contract). https://docs.kucoin.com/futures/#stop-order-mass-cancelation
SwiftTrader.kucoinFuturesPositionList Lists open Futures positions. https://docs.kucoin.com/futures/#get-position-list
Kucoin Spot Explanation API Documentation
SwiftTrader.kucoinSpotListAccounts Gets the list of accounts. https://docs.kucoin.com/#list-accounts
SwiftTrader.kucoinSpotGetAccount Retrieves information for a single account. https://docs.kucoin.com/#get-an-account
SwiftTrader.kucoinSpotGetTransferable Returns the transferable balance of a specified account. https://docs.kucoin.com/#get-the-transferable
SwiftTrader.kucoinSpotPlaceStopLimitOrder Places a spot stop limit order. https://docs.kucoin.com/#place-a-new-order
SwiftTrader.kucoinSpotOrderList Lists active Spot orders. https://docs.kucoin.com/#list-orders
SwiftTrader.kucoinSpotStopOrderList Lists active Spot stop orders. https://docs.kucoin.com/#list-stop-orders
SwiftTrader.kucoinSpotCancelStopOrders Cancels all untriggered stop orders of a given symbol (contract). https://docs.kucoin.com/#cancel-orders

Binance

Binance Spot Explanation API Documentation
SwiftTrader.binanceSpotNewOrder Send in a new order. Currently only MARKET orders are supported (but this can be easily changed). https://binance-docs.github.io/apidocs/spot/en/#new-order-trade

FTX

⚠️👮🏻 FTX won't work anymore, because its CEO is in jail. Great job! 👮🏻⚠️

FTX Explanation API Documentation
SwiftTrader.ftxTriggerOrdersList Retrieves the list of open trigger orders. https://docs.ftx.com/?python#get-open-trigger-orders
SwiftTrader.ftxPositions Lists open positions. https://docs.ftx.com/#get-positions
SwiftTrader.ftxPlaceStopLimitOrder Places a stop limit order within FTX. https://docs.ftx.com/?python#place-trigger-order
SwiftTrader.cancelAllOrders Cancels all open orders. https://docs.ftx.com/?python#cancel-all-orders