Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/delta/dalal-street-server
/ functions
Functions
739 in github.com/delta/dalal-street-server
⨍
Functions
739
◇
Types & classes
147
↓ 3 callers
Method
GetNotificationsStream
()
datastreams/Stream.go:32
↓ 3 callers
Function
GetStockCopy
(stockId uint32)
models/Stock.go:98
↓ 3 callers
Function
GetStocksOwned
(userId uint32)
models/User.go:2279
↓ 3 callers
Function
IsDailyChallengeOpen
IsDailyChallengeOpen returns dailychallenge status
models/Config.go:62
↓ 3 callers
Method
LoadOldAsk
(*models.Ask)
matchingengine/OrderBook.go:23
↓ 3 callers
Method
LoadOldBid
(*models.Bid)
matchingengine/OrderBook.go:24
↓ 3 callers
Function
PerformMortgageTransaction
PerformMortgageTransaction returns mortgage transaction and/or error
models/User.go:2184
↓ 3 callers
Function
RandString
RandString generates a random string which is n characters long
utils/utils.go:25
↓ 3 callers
Function
RegisterUser
RegisterUser is called when a user tries to sign up in our site
models/User.go:217
↓ 3 callers
Method
Run
()
datastreams/StockPrices.go:15
↓ 3 callers
Function
SendEmail
(fromAddr, subject, toAddr, plainTextContent, htmlContent string)
utils/utils.go:100
↓ 3 callers
Method
SendNotification
(n *models_pb.Notification)
datastreams/Notifications.go:15
↓ 3 callers
Method
StartStockMatching
()
matchingengine/OrderBook.go:29
↓ 3 callers
Function
SubtractUserCash
SubtractUserCash subtracts cash for users account This function should be called ONLY AFTER lock is obtained on user
models/User.go:849
↓ 3 callers
Method
ToProto
()
models/Notification.go:21
↓ 3 callers
Method
ToProto
()
models/MarketEvent.go:27
↓ 3 callers
Method
ToProto
()
models/Ipo.go:29
↓ 3 callers
Method
addAskToDepth
addAskToDepth adds an ask to the depth NOTE: 1. Only adds unfulfilled qty 2. It uses ask.StockQuantityFulfilled which gets written to by fillOrderF
matchingengine/OrderBook.go:67
↓ 3 callers
Method
addBidToDepth
addBidToDepth adds a bid to the depth. NOTE: 1. Only adds unfulfilled qty 2. It uses bid.StockQuantityFulfilled which gets written to by fillOrderF
matchingengine/OrderBook.go:77
↓ 3 callers
Method
exch
(i, j int)
matchingengine/pqueue.go:343
↓ 3 callers
Method
exch
(i, j int)
matchingengine/pqueue.go:350
↓ 3 callers
Function
getHKDFKey
Returns a key of length "length" given an hkdf function
models/PushNotification.go:340
↓ 3 callers
Function
getSingleStockCount
getSingleStockCount() returns the stocks a user owns for a given stockId This method is *not* thread-safe. The caller is responsible for thread-safety
models/User.go:507
↓ 3 callers
Method
getTopMatchingBid
getTopMatchingBid checks for a matching bid from the orderbook for an incoming ask NOTE: 1. It does NOT remove the bid from the queue. 2. It does NOT
matchingengine/OrderBook.go:241
↓ 3 callers
Function
getUserShortSellStocks
(stockId, userId uint32)
models/ShortSell.go:193
↓ 3 callers
Method
less
(i, j int)
matchingengine/pqueue.go:310
↓ 3 callers
Method
less
(i, j int)
matchingengine/pqueue.go:326
↓ 3 callers
Function
newBidPQueueImpl
newBidPQueueImpl returns instances of bidPQueue meant for testing purposes
matchingengine/pqueue_test.go:38
↓ 3 callers
Function
postLoginToPragyan
postLoginToPragyan() is used to make a post request to pragyan and return a pragyanUser struct.
models/User.go:420
↓ 2 callers
Function
AddMarketEvent
(stockId uint32, headline, text string, isGlobal bool, imageURL string)
models/MarketEvent.go:84
↓ 2 callers
Function
AllotSlots
(IpoStockId uint32)
models/Ipo.go:127
↓ 2 callers
Function
AllowIpoBidding
(IpoStockId uint32)
models/Ipo.go:80
↓ 2 callers
Function
CancelOrder
CancelOrder cancels a user's order. It'll check if the user was the one who placed it. It returns the pointer to Ask/Bid (whichever it was - the other
models/User.go:1395
↓ 2 callers
Function
DownloadImage
(imageURL string)
utils/utils.go:127
↓ 2 callers
Function
GetCashSpent
(userId uint32)
models/User.go:2365
↓ 2 callers
Function
GetCompanyDetails
(stockId uint32)
models/Stock.go:255
↓ 2 callers
Function
GetImageBasePath
()
utils/utils.go:88
↓ 2 callers
Function
GetMortgageDetails
GetMortgageDetails returns mortgage data about a user
models/MortgageDetail.go:17
↓ 2 callers
Function
GetMyOpenAsks
(userId uint32)
models/Ask.go:274
↓ 2 callers
Function
GetMyOpenBids
(userId uint32)
models/Bid.go:210
↓ 2 callers
Method
GetStockHistoryStream
(stockId uint32)
datastreams/Stream.go:36
↓ 2 callers
Function
Init
Init configures and initializes the grpcapi package
grpcapi/grpcapi.go:195
↓ 2 callers
Function
Init
Init initializes and configures the datastreams module
datastreams/Stream.go:21
↓ 2 callers
Function
Init
Init initializes the session package
session/session.go:217
↓ 2 callers
Function
IsProdEnv
()
utils/utils.go:92
↓ 2 callers
Function
Load
Load returns a session from database given the session id
session/session.go:42
↓ 2 callers
Method
LoadOldTransactions
(txs []*models.Transaction)
matchingengine/OrderBook.go:22
↓ 2 callers
Method
MakeGlobalBroadcast
(update interface{})
datastreams/MulticastStream.go:16
↓ 2 callers
Function
NewMockAskPQueue
NewMockAskPQueue creates a new mock instance
mocks/mock_pqueue.go:106
↓ 2 callers
Function
NewMockBidPQueue
NewMockBidPQueue creates a new mock instance
mocks/mock_pqueue.go:25
↓ 2 callers
Function
NewMockMarketDepthStream
NewMockMarketDepthStream creates a new mock instance
mocks/mock_MarketDepth.go:24
↓ 2 callers
Function
OrderTypeFromProto
(pOt models_pb.OrderType)
models/Ask.go:53
↓ 2 callers
Method
Pop
()
models/InspectComponents.go:26
↓ 2 callers
Method
SendMarketEvent
(me *models_pb.MarketEvent)
datastreams/MarketEvents.go:13
↓ 2 callers
Function
SendNotification
(userId uint32, text string, isBroadcast bool)
models/Notification.go:65
↓ 2 callers
Method
SendStockExchangeUpdate
(stockId uint32, dp *datastreams_pb.StockExchangeDataPoint)
datastreams/StockExchange.go:17
↓ 2 callers
Method
SendStockPriceUpdate
(stockId uint32, price uint64)
datastreams/StockPrices.go:16
↓ 2 callers
Function
SetIsDailyChallengeOpen
SetIsDailyChallengeOpen update IsDailyChallengeOpen in db
models/Config.go:84
↓ 2 callers
Method
StartStockMatching
** * StartStockMatching listens for incoming orders for a particular stock and process them. * NOTE: It will spawn a new go routine. It needn't be
matchingengine/OrderBook.go:220
↓ 2 callers
Method
ToProto
ToProto converts trade to its proto representation
datastreams/MarketDepth.go:34
↓ 2 callers
Method
ToProto
()
models/StockHistory.go:28
↓ 2 callers
Method
Touch
()
session/session.go:26
↓ 2 callers
Function
allotIpoSlotToUser
(ipoBid *IpoBid, newStockId, SlotQuantity, StocksPerSlot uint32, cost int64, stockPrice uint64)
models/Ipo.go:285
↓ 2 callers
Function
authFunc
(ctx context.Context)
grpcapi/grpcapi.go:38
↓ 2 callers
Function
checkPasswordHash
(password, hash string)
models/User.go:319
↓ 2 callers
Function
createUser
createUser() creates a user given his email and name.
models/User.go:346
↓ 2 callers
Function
decodeSubscriptionKey
decodeSubscriptionKey decodes a base64 subscription key. if necessary, add "=" padding to the key for URL decode
models/PushNotification.go:324
↓ 2 callers
Function
decodeVapidKey
(key string)
models/PushNotification.go:436
↓ 2 callers
Function
getMockAndTestObjects
(t *testing.T)
matchingengine/OrderBook_test.go:58
↓ 2 callers
Function
getNumberOfUsers
Function to get number of users from db
models/InspectUserDegree.go:43
↓ 2 callers
Function
getOrderFee
(quantity, price uint64)
models/User.go:341
↓ 2 callers
Function
getOrderFeePrice
(price uint64, stockId uint32, o OrderType)
models/User.go:326
↓ 2 callers
Function
getPlaceOrderTransactionDetails
getPlaceOrderTransactionDetails returns price and quantity at which PlaceOrderTransaction was created
models/OrderDepositTransaction.go:30
↓ 2 callers
Function
getStocksInBank
(userID, stockID uint32, retrievePrice uint64, tx *gorm.DB)
models/MortgageDetail.go:130
↓ 2 callers
Function
getTaxForBiddingUser
Helper to calculate tax for bidding user. It is assumed that an Exclusive Read and Write lock is already obtained for the user. DO NOT call this funct
models/User.go:1525
↓ 2 callers
Function
getUserPairExclusive
(id1, id2 uint32)
models/User.go:743
↓ 2 callers
Function
getVerificationKey
(email string)
models/User.go:311
↓ 2 callers
Function
hashPassword
(password string)
models/User.go:304
↓ 2 callers
Function
isOrderMatching
* * Helper function to check if a transaction is possible */
matchingengine/helpers.go:18
↓ 2 callers
Method
processAsk
processAsk tries to match an incoming ask with existing bids and carry out a trade if possible. NOTE: 0. The ask shouldn't be a stoploss. It's either
matchingengine/OrderBook.go:310
↓ 2 callers
Method
processBid
processBid tries to match an incoming bid with existing asks and carry out a trade if possible. NOTE: 0. The bid shouldn't be a stoploss. It's either
matchingengine/OrderBook.go:369
↓ 2 callers
Function
saveBidCancelOrderTransaction
saveBidCancelOrderTransaction creates a CancelOrderTransaction for Ask orders and pushses to stream
models/User.go:1342
↓ 2 callers
Function
savePlaceOrderTransaction
savePlaceOrderTransaction saves PlaceOrderTransaction and creates a mapping between orderId and
models/User.go:2399
↓ 2 callers
Function
saveShortSellLendTransaction
updates available stocks for lend, saves shortsell transaction and creates shortsell lend later squareOff utility func, called inside placeAskOrder fu
models/ShortSell.go:56
↓ 2 callers
Function
stockHistoryStreamUpdate
(stockId uint32, stockHistory *StockHistory)
models/StockHistory.go:95
↓ 2 callers
Method
triggerStopLosses
* * Method to check and trigger(if possible) StopLoss orders whenever a transaction occurs */
matchingengine/OrderBook.go:516
↓ 2 callers
Function
updateShortSellBank
update available stocks for shorting for a stock
models/ShortSell.go:76
↓ 1 callers
Method
AddAskOrder
AddAskOrder adds a NEW ask order to the book. It will take care of adding stopLoss. It should NOT be passed partially filled orders
matchingengine/OrderBook.go:131
↓ 1 callers
Method
AddAskOrder
(*models.Ask)
matchingengine/MatchingEngine.go:19
↓ 1 callers
Method
AddBidOrder
AddBidOrder adds a NEW bid order to the book. It will take care of adding stopLoss. It should NOT be passed partially fulfilled orders
matchingengine/OrderBook.go:157
↓ 1 callers
Method
AddBidOrder
(*models.Bid)
matchingengine/MatchingEngine.go:20
↓ 1 callers
Method
AddListener
(done <-chan struct{}, updates chan interface{}, sessionId string)
datastreams/MarketDepth.go:18
↓ 1 callers
Method
AddListener
(done <-chan struct{}, updates chan interface{}, sessionId string)
datastreams/StockHistory.go:13
↓ 1 callers
Method
AddListener
(done <-chan struct{}, update chan interface{}, sessionId string)
datastreams/MarketEvents.go:14
↓ 1 callers
Method
AddListener
(done <-chan struct{}, update chan interface{}, userId uint32, sessionId string)
datastreams/GameStateStream.go:16
↓ 1 callers
Method
AddListener
(done <-chan struct{}, update chan interface{}, userId uint32, sessionId string)
datastreams/Notifications.go:16
↓ 1 callers
Method
AddListener
(done <-chan struct{}, updates chan interface{}, sessionId string)
datastreams/StockExchange.go:18
↓ 1 callers
Method
AddListener
(groupId uint32, sessionId string, lis *listener)
datastreams/MulticastStream.go:13
↓ 1 callers
Method
AddListener
(done <-chan struct{}, updates chan interface{}, sessionId string)
datastreams/StockPrices.go:17
↓ 1 callers
Method
AddListener
(done <-chan struct{}, updates chan interface{}, userId uint32, sessionId string)
datastreams/Transactions.go:14
← previous
next →
101–200 of 739, ranked by callers