All Projects → utkarshohm → Mf Platform Bse

utkarshohm / Mf Platform Bse

Licence: mit
Library to build a mutual fund transaction platform using the Bombay Stock Exchange StarMF platform and API

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Mf Platform Bse

Dash Docs
📖 The Official Dash Userguide & Documentation
Stars: ✭ 338 (+619.15%)
Mutual labels:  fintech
Awesome Deep Trading
List of awesome resources for machine learning-based algorithmic trading
Stars: ✭ 514 (+993.62%)
Mutual labels:  fintech
Real Time Payments
Code for a Developer Journey that uses the Financial APIs on Bluemix. This application uses this service to send and request payments.
Stars: ✭ 28 (-40.43%)
Mutual labels:  fintech
Gauzy
Gauzy™ - Open-Source Business Management Platform (ERP/CRM/HRM)
Stars: ✭ 374 (+695.74%)
Mutual labels:  fintech
Deep Finance
Datasets, papers and books on AI & Finance.
Stars: ✭ 475 (+910.64%)
Mutual labels:  fintech
Blockchain guide
Introduce blockchain related technologies, from theory to practice with bitcoin, ethereum and hyperledger.
Stars: ✭ 5,897 (+12446.81%)
Mutual labels:  fintech
Example Scalping
A working example algorithm for scalping strategy trading multiple stocks concurrently using python asyncio
Stars: ✭ 267 (+468.09%)
Mutual labels:  fintech
Mangopay2 Nodejs Sdk
Node.js SDK for MANGOPAY
Stars: ✭ 40 (-14.89%)
Mutual labels:  fintech
Qlib
Qlib is an AI-oriented quantitative investment platform, which aims to realize the potential, empower the research, and create the value of AI technologies in quantitative investment. With Qlib, you can easily try your ideas to create better Quant investment strategies. An increasing number of SOTA Quant research works/papers are released in Qlib.
Stars: ✭ 7,582 (+16031.91%)
Mutual labels:  fintech
Finta
Common financial technical indicators implemented in Pandas.
Stars: ✭ 901 (+1817.02%)
Mutual labels:  fintech
Akaunting
Free and Online Accounting Software
Stars: ✭ 4,599 (+9685.11%)
Mutual labels:  fintech
Jqdatasdk
简单易用的量化金融数据包(easy utility for getting financial market data of China)
Stars: ✭ 457 (+872.34%)
Mutual labels:  fintech
Iex Api
The IEX API provides any individual or academic, public or private institution looking to develop applications that require stock market data to access near real-time quote and trade data for all stocks trading on IEX.
Stars: ✭ 683 (+1353.19%)
Mutual labels:  fintech
Sequence
Immutable, scalable, and easy to use ledger service.
Stars: ✭ 360 (+665.96%)
Mutual labels:  fintech
Intrinio Realtime Node Sdk
Intrinio NodeJS SDK for Real-Time Stock & Crypto Prices
Stars: ✭ 30 (-36.17%)
Mutual labels:  fintech
Catena
Catena is a distributed database based on a blockchain, accessible using SQL.
Stars: ✭ 302 (+542.55%)
Mutual labels:  fintech
Go Finance
⚠️ Deprecrated in favor of https://github.com/piquette/finance-go
Stars: ✭ 536 (+1040.43%)
Mutual labels:  fintech
Mortgageblockchainfabric
Mortgage Processing App using Hyperledger Fabric Blockchain. Uses channels for privacy and access, and restricts read/write previleges through endorsement policies
Stars: ✭ 45 (-4.26%)
Mutual labels:  fintech
Fooltrader
quant framework for stock
Stars: ✭ 960 (+1942.55%)
Mutual labels:  fintech
React Plotly.js
A plotly.js React component from Plotly 📈
Stars: ✭ 701 (+1391.49%)
Mutual labels:  fintech

mf-platform-bse

Python library to programmaticaly purcahse/redeem mutual funds in India using the Bombay Stock Exchange StarMF platform's API and web portal

Context

Real-life application of library

I built and operated a mutual fund investing platform as an AMFI licensed mutual fund distributor for a year. I used the library to programmatically make and track over Rs 50 lacs of investment for several investors. It was built over a week in Sep 2016 and works as of May 2017. Since my investing website was built on django, you will see some parts of that in the code though django is an optional requirement. You can build this platform without or with any other framework of your choice.

Open source in fintech?!

The finance industry believes that differentiation in fintech can come from building an execution/transaction platform. I believe on the contrary that execution will soon be commoditized and differentiation will come from better products, ease of their use and large-scale distribution. This is why I am open-sourcing my mutual fund execution platform.

About BSE Star MF

Bombay Stock Exchange runs a MF execution platform called StarMF. Distributors like me can plug into it and place transactions in any mutual fund without setting up a payment gateway, settlement system or signing agreements directly with MF companies. BSEStarMF offers

  • a SOAP API for placing transactions. I used their latest API guide when building this library.
  • a web portal which has comprehensive capabilities including those that the API doesn't offer like tracking status of transactions. Each transaction depends on multiple stakeholders - RTA (tech provider of MF company), KRA (user KYC verified?), bank (payment received?) and BSE (all necessary data about user received?), hence tracking status is critical for building a mutual fund investing platform.

Code

Critical code

Meat of the library is in 2 files:

  • api.py has all functions necessary to transact in mutual funds using its SOAP API
    1. create_user_bse() registers a user on BSEStarMF corresponding to your user with kyc and bank details. Pre-requisite for all other API endpoints
    2. create_mandate_bse() registers a mandate (instruction given to debit bank account periodically for a specific amount) for a user. Pre-requisite for creating SIP transaction.
    3. create_transaction_bse() creates a purchase/redeem one-time/SIP transaction
    4. cancel_transaction_bse() cancels a transaction
    5. get_payment_link_bse() gets a link that can be used by user to pay for his/her investments
    6. get_payment_status_bse() gets whether payment for a transaction was approved by the user's bank or not
  • web.py crawls the web portal to update transaction status
    1. update_transaction_status() updates status of all transactions that need a status update (i.e. not completed or failed). Importantly this includes SIP transactions which have an instalment order due today. Once an SIP transaction was succesfully processed, BSEStarMF keeps auto-trigerring each instalment on the right date and this status updater keeps tracking these auto-trigerred instalment orders.

Supporting code

Models

3 key data structures are necessary for a mutual fund transaction platform. Regulations require to carefully archive this data for 5 years.

  • funds.py stores mutual fund schemes' official SID details, ratings, returns, owner, rta, managers, benchmark indices, portfolio and history.
  • graphs.py stores time series data of funds and indices (like BSE Sensex, SBI fixed deposit rate), at daily frequency.
  • users.py stores kyc, bank, fatca and mandate details for each investor.
  • transactions.py stores each purcahse/redeem transaction's key details incl status, datetime stamps, payment details, corresponding API queries made to BSEStarMF and corresponding responses received. You can find more detailed models in a separate repo with discussion on choice of database for these models. Note that several models in this repo are not directly used for placing transactions through BSE but are required for a mutual fund platform.

Requirements

Necessary
  • market_dates.csv stores all the dates on which BSE was open for financial transactions
  • zeep used as a python SOAP client
  • selenium used to automate browsing of web portal
  • pyvirtualdisplay used to create a virtual display necessary for a headless browser
Optional
  • django, mysql and mongo - for models and management commands. Note that you DON'T need it. I have kept parts of django because I used it originally in my website. Feel free to remove it or replace it with
  • chromedriver used with selenium for browsing using chrome browser. Its executable must be downloaded separately.

How to use the API and web crawler?

These 2 files show how to use api.py and web.py in your code. I have used django management commands for easy demonstration, but treat them as simple python files

  • transact_using_api.py shows how to use the api functions to transact
  • update_transaction_status.py shows how to use api functions and web crawling to periodically update status of transactions. It should be run using a cron job on every day that the market is open, at 10:05 am (after market opens), 3:05 pm (after market closes for MF transactions) and 6:05 pm (after transactions have been processed).

Related repos

Need help setting this up or want to contribute?

Feel free to raise an issue and I will get back asap

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].