narenkram / steadfast-app

Provides the user interface and handles client-side calculations and logic for the Steadfast 1-click option trading app.
https://github.com/narenkram/steadfast-monorepo
Other
3 stars 3 forks source link

Negative Total Funds on Shoonya #11

Closed narenkram closed 3 months ago

narenkram commented 3 months ago

If you have just added funds today in your Shoonya broker account, it will not immediately reflect on the app until after a day. This is an endpoint issue on Shoonya side, because they are not updating available cash margin immediately. So i have to find a way to handle this on the frontend using payin

suresh-n commented 3 months ago

@narenkram api.get_limits() can provide you payin which can be used.

limit = api.get_limits()
marginused = (float((limit['marginused'])))
margin_available = round(((float((limit['cash']))) - marginused + float((limit['payin']))),2) 
narenkram commented 3 months ago

This issues has been fixed fix negative total available fund (issues 11)

narenkram commented 3 months ago

@suresh-n appreciate it, but I found a better way. When fundlimit.cash is zero, app now just shows the fundlimit.payin now.