Manja (IPA: /maːŋdʒʱaː/) n.: A type of abrasive string utilized primarily for flying fighter kites, especially prevalent in South Asian countries. It is crafted by coating cotton string with powdered glass or a similar abrasive substance.
This crate provides a Rust client library for Zerodha's Kite Connect trading APIs (a set of REST-like HTTP APIs).
manja strives to improve the developer experience by providing better support in IDEs with features like auto-completion, type-inference, and inline documentation.
-
Type safe
- Compile-time Type Checking: type safety ensures that errors related to type mismatches are caught during compilation rather than at runtime.
- Consistent Data Models:
manjauses strongly typed data models that match Kite Connect API's expected inputs and outputs. - Enhanced Security: by ensuring that only valid data types are sent to and received from the API, the risk of data-related vulnerabilities is reduced.
- Automatic Serialization/Deserialization:
manjahandles the serialization (converting data structures to JSON) and deserialization (converting JSON responses back to data structures) automatically and correctly. This ensures that the data sent to and received from Kite Connect API adheres to the expected types.
-
Asynchronous: built on the performant
tokioasync-runtime,manjadelivers unmatched performance, ensuring your applications run faster and more efficiently than ever before.- Resource Efficiency: maximize the use of your system's resources.
manja's asynchronous nature allows for optimal resource management, reducing overhead and improving overall performance. - Concurrent Task Handling: manage multiple tasks simultaneously without sacrificing performance or reliability.
- Improved latency: experience reduced latency and faster response times, ensuring your applications are always responsive.
- Resource Efficiency: maximize the use of your system's resources.
-
Distributed Logging: stay ahead of issues with real-time distributed logging using the
tracingcrate.- Streamline Development: facilitate smoother development cycles with better debugging and faster issue resolution.
- Reduce Downtime: with real-time insights and quick access to logs, identify and resolve issues faster, minimizing downtime.
- Enhance User Experience: quickly address errors and performance bottlenecks to provide a better experience for your users.
-
WebSocket support for streaming binary market data.
- Auto-reconnect Mechanism:
manjaprovides a reliable async WebSocket client with a configurable exponential backoff retry mechanism.
- Auto-reconnect Mechanism:
-
WebDriver integration for retrieving
request tokenfrom the redirect URL after successfully authenticating with the Kite platform.
-
User
- POST
/session/tokenAuthenticate and obtain theaccess_tokenafter the login flow - GET
/user/profileRetrieve the user profile - GET
/user/margins/:segmentRetrieve detailed funds and margin information - DELETE
/session/tokenLogout and invalidate the API session andaccess_token
- POST
-
Orders
- POST
/orders/:varietyPlace an order of a particular variety - PUT
/orders/:variety/:order_idModify an open or pending order - DELETE
/orders/:variety/:order_idCancel an open or pending order - GET
/ordersRetrieve the list of all orders (open and executed) for the day - GET
/orders/:order_idRetrieve the history of a given order - GET
/tradesRetrieve the list of all executed trades for the day - GET
/orders/:order_id/tradesRetrieve the trades generated by an order
- POST
-
GTT - Good Till Triggered orders
- POST
/gtt/triggersPlaces a GTT - GET
/gtt/triggersRetrieve a list of all GTTs visible in GTT order book - GET
/gtt/triggers/:idRetrieve an individual trigger - PUT
/gtt/triggers/:idModify an active GTT - DELETE
/gtt/triggres/:idDelete an active GTT
- POST
-
Portfolio
- GET
/portfolio/holdingsRetrieve the list of long term equity holdings - GET
/portfolio/positionsRetrieve the list of short term positions - PUT
/portfolio/positionsConvert the margin product of an open position - GET
/portfolio/holdings/auctionsRetrieve the list of auctions that are currently being held - POST
/portfolio/holdings/authorisePlace an electronic authorisation to debit shares and settle the transactions
- GET
-
Market quotes and instruments
- GET
/instrumentsRetrieve the CSV dump of all tradable instruments - GET
/instruments/:exchangeRetrieve the CSV dump of instruments in the particular exchange - GET
/quoteRetrieve the full market quotes for one or more instruments - GET
/quote/ohlcRetrieve OHLC quotes for one or more instruments - GET
/quote/ltpRetrieve LTP quotes for one or more instruments
- GET
-
Historical candle data
- GET
/instruments/historical/:instrument_token/:intervalRetrieve historical candle records for a given instrument
- GET
-
Mutual funds
- POST
/mf/ordersPlace a buy or sell order - DELETE
/mf/orders/:order_idCancel an open or pending order - GET
/mf/ordersRetrieve the list of all orders (open and executed) over the last 7 days - GET
/mf/orders/:order_idRetrieve an individual order - POST
/mf/sipsPlace a SIP order - PUT
/mf/sips/:order_idModify an open SIP order - DELETE
/mf/sips/:order_idCancel an open SIP order - GET
/mf/sipsRetrieve the list of all open SIP orders - GET
/mf/sips/:order_idRetrieve an individual SIP order - GET
/mf/holdingsRetrieve the list of mutual fund holdings available in the DEMAT - GET
/mf/instrumentsRetrieve the master list of all mutual funds available on the platform
- POST
-
Margin calculation
- POST
/margins/ordersCalculates margins for each order considering the existing positions and open orders - POST
/margins/basketCalculates margins for spread orders - POST
/charges/ordersCalculates order-wise charges for orderbook
- POST
-
WebSocket streaming
- Auto-reconnect mechanism with subscription
Important Notice:
-
The
manjacrate is currently in development and should be considered unstable. The API is subject to change without notice, and breaking changes are likely to occur. -
The software is provided "as-is" without any warranties, express or implied. The author and contributors of this SDK do not take responsibility for any financial losses, damages, or other issues that may arise from the use of this project.