-
Hi, I intend to work with crypto staking were one provides some coins and in return is rewarded some interest on the provided coins. In the case of https://www.binance.com/en/earn/simple-earn they pay out interest daily to your spot account. For the backtest this would just be a regular trade, but an interest is payed out daily to my cash balance as long as i hold some amount of this asset (position). What are your thoughts on implementing this kind of interest payout. Can this be implemented by the user at this point or would that require changes? If so - where would I start? Any comment would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @SW4T400, There is a SlippageModel but I don't think that will apply here. This would require changes on your end. What you could do is add the earned interest to the cash field in the Portfolio: The ExecContext has a "private" reference to the Portfolio (_portfolio). |
Beta Was this translation helpful? Give feedback.
-
@edtechre I have a follow up question. If the interest/reward is in the form of shares/coins I would have to adjust the number of shares held - is this a value I can modify ? Instead of portfolio cash can I somehow bump my fractional shares to some higher value? Or would I have to place a buy order with current prices and NO FEES to simulate this? What is your recommendation? |
Beta Was this translation helpful? Give feedback.
Hi @SW4T400,
There is a SlippageModel but I don't think that will apply here.
This would require changes on your end. What you could do is add the earned interest to the cash field in the Portfolio:
https://www.pybroker.com/en/latest/reference/pybroker.portfolio.html#pybroker.portfolio.Portfolio.cash
The ExecContext has a "private" reference to the Portfolio (_portfolio).