Code Monkey home page Code Monkey logo

ftx's Introduction

FTX API

Unofficial Rust API bindings for the FTX exchange.

crates.io | docs.rs | FTX API Documentation

Progress

Work in progress, contributions are welcome.

REST

  • Authentication
  • Subaccounts
    • Get all subaccounts
    • Create subaccount
    • Change subaccount name
    • Delete subaccount
    • Get subaccount balances
    • Transfer between subaccounts
  • Markets
    • Get markets
    • Get single market
    • Get orderbook
    • Get trades
    • Get historical prices
  • Futures
    • List all futures
    • Get future
    • Get future stats
    • Get funding rates
    • Get index weights
    • Get expired futures
    • Get historical index
  • Account
    • Get account information
    • Get positions
    • Change account leverage
  • Wallet
    • Get coins
    • Get balances
    • Get balances of all accounts
    • Get deposit address
    • Get deposit history
    • Get withdrawal history
    • Request withdrawal
    • Get airdrops
    • Get withdrawal fees
    • Get saved addresses
    • Create saved addresses
    • Delete saved addresses
  • Orders
    • Get open orders
    • Get order history
    • Get open trigger orders
    • Get trigger order triggers
    • Get trigger order history
    • Place order
    • Place trigger order
    • Modify order
    • Modify order by client ID
    • Modify trigger order
    • Get order status
    • Get order status by client ID
    • Cancel order
    • Cancel order by client ID
    • Cancel open trigger order
    • Cancel all orders
  • Fills
  • Funding Payments
  • Leveraged Tokens
  • Options
  • Staking
  • Convert
  • Spot Margin
    • Get lending history
    • Get borrow rates
    • Get lending rates
    • Get daily borrowed amounts
    • Get market info
    • Get my borrow history
    • Get my lending history
    • Get lending offers
    • Get lending info
    • Submit lending offer
  • NFTs
  • FTXPay

Websockets

  • Public Channels
    • Ticker
    • Markets
    • Trades
    • Orderbooks
      • Verify checksum
    • Grouped Orderbooks
  • Private Channels
    • Fills
    • Orders

Installation

The minimal supported Rust version is 1.54.

Add the following line to your Cargo.toml file:

ftx = "0.3"

Or for the latest github version:

ftx = { git = "https://github.com/fabianboesiger/ftx", branch = "main" }

Usage

Rate Limiting

Using the FTX API requires rate-limiting requests to no more than 30 requests per second in order to avoid HTTP 429 errors. You will need to rate-limit your own requests in your usage of this library.

See the FTX API Documentation

Pagination

If needed, you will need to paginate your own requests in your usage of this library. See the FTX API Documentation and sample Python code

REST Usage Examples

Websockets Usage Examples

  • Listen to latest Trades and Orderbook updates: examples/watch_market.rs
  • Subscribe and unsubscribe from Channels: ws::tests::subscribe_unsubscribe
  • Update an Orderbook: ws::tests::order_book_update
  • Verify OrderBook checksums: ws::tests::order_book_checksum
  • Use the Orderbook convenience methods: ws::tests::order_book_helpers
    • bid_price, ask_price, mid_price
    • best_bid, best_ask, best_bid_and_ask
    • quote
  • Listen for Fills: ws::tests::fills
  • Listen for Order updates: ws::tests::orders

ftx's People

Contributors

fabianboesiger avatar maxfangx avatar mvines avatar dovahcrow avatar swaystar123 avatar peepo5 avatar corvusrabus avatar nicolft avatar jaredwolff avatar agentydragon avatar coldturnip avatar georgewhewell avatar r3k4mn14r avatar matago avatar jansvejda avatar vikulikov avatar evopen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.