organofcorti

Pool hopping simulator

Mar 15th, 2012
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 2.25 KB | None | 0 0
  1.  
  2. ##Deepbit hoppers v prop fulltimers - how much do hoppers take away?
  3. ##
  4. ##Note that this can be done far more simply and efficienctly, but this simulation has the advantage
  5. ##of being easily followed by a novice to simulations
  6. B<-50;maxRounds<-10000;loop<-50;hop<-0.435
  7. fractionOfRoundsHopped<-145/179.5
  8. hopvfulltime.mat<-matrix(0,loop,13);D<-10^6
  9. for(i in 1:loop){
  10.     totalRoundShares<-1
  11.         while(signif(mean(totalRoundShares),digits=3)!=signif(D,digits=3)||
  12.         signif(sd(totalRoundShares),digits=3)!=signif(D,digits=3)){
  13.         totalRoundShares<-rgeom(maxRounds,1/D)+1
  14.     }  
  15.     tRS.le43<-subset(totalRoundShares,totalRoundShares-hop*D<=0)
  16.     tRS.gt43<-subset(totalRoundShares,totalRoundShares-hop*D>0)
  17.    
  18.     #uncomment the line labelled 1. and comment out the one below it
  19.     #if you want to determine how earnings change as a
  20.     #function of hashrate
  21.    
  22.     #1.###hopperVpoolRatio<-10^((-i)/loop)
  23.     hopperVpoolRatio<-(4200-3700)/4200* fractionOfRoundsHopped
  24.  
  25.     hopper.shares<-(sum(tRS.le43)+sum(0.435*D*tRS.gt43/tRS.gt43))*hopperVpoolRatio/maxRounds
  26.     fulltimer.shares<-mean(totalRoundShares)-hopper.shares
  27.     hopper.prop<-hopper.shares/(hopper.shares+fulltimer.shares)
  28.     fulltimer.prop<-fulltimer.shares/(hopper.shares+fulltimer.shares)
  29.     hopper.rewards<-(sum(tRS.le43/tRS.le43)+sum(0.435*D/tRS.gt43))*hopperVpoolRatio*B/maxRounds
  30.     fulltimer.rewards<-B-hopper.rewards
  31.     hopper.due<-hopper.prop*B
  32.     fulltimer.due<-B-hopper.due
  33.     hopper.round.efficiency<-hopper.rewards/B
  34.     fulltimer.round.efficiency<-fulltimer.rewards/B
  35.     hopper.share.efficiency<-hopper.rewards/hopper.shares/(B/D)*100
  36.     fulltimer.share.efficiency<-fulltimer.rewards/fulltimer.shares/(B/D)*100
  37.  
  38.     hopvfulltime.mat[i,1]<-1/(1-hopperVpoolRatio)
  39.     hopvfulltime.mat[i,2]<-hopper.shares
  40.     hopvfulltime.mat[i,3]<-fulltimer.shares
  41.     hopvfulltime.mat[i,4]<-hopper.prop
  42.     hopvfulltime.mat[i,5]<-fulltimer.prop
  43.     hopvfulltime.mat[i,6]<-hopper.rewards
  44.     hopvfulltime.mat[i,7]<-fulltimer.rewards
  45.     hopvfulltime.mat[i,8]<-hopper.round.efficiency
  46.     hopvfulltime.mat[i,9]<-fulltimer.round.efficiency
  47.     hopvfulltime.mat[i,10]<-hopper.due
  48.     hopvfulltime.mat[i,11]<-fulltimer.due
  49.     hopvfulltime.mat[i,12]<-hopper.share.efficiency
  50.     hopvfulltime.mat[i,13]<-fulltimer.share.efficiency
  51. print(i)
  52. }
  53.  
  54. mean(hopvfulltime.mat[,12])
  55. mean(hopvfulltime.mat[,13])
Advertisement
Add Comment
Please, Sign In to add comment