Skip to content

Instantly share code, notes, and snippets.

@staccDOTsol
Created September 21, 2020 01:20
Show Gist options
  • Save staccDOTsol/0db4b15d70f4e4d67631a62b6d08d936 to your computer and use it in GitHub Desktop.
Save staccDOTsol/0db4b15d70f4e4d67631a62b6d08d936 to your computer and use it in GitHub Desktop.
if math.fabs(arb) > avg:
percs[coinarbs[arb].split('-')[0]] = arb / t
if coinarbs[arb] in usdpos: #-0.3 * 10 * 100 + 360 #-0.16*400*10+1826=1186
#-0.16*400*10-266=-906
wanting[coinarbs[arb]] = arb / t * 7.5 * balance
wanting[coinarbs[arb]] = wanting[coinarbs[arb]] * -1
wanting[coinarbs[arb]] = wanting[coinarbs[arb]] - usdpos[coinarbs[arb]]
else:
wanting[coinarbs[arb]] = arb / t * 7.5 * balance
wanting[coinarbs[arb]] = wanting[coinarbs[arb]] * -1
if coinarbs[arb].split('-')[0] + '-PERP' in usdpos:
wanting[coinarbs[arb].split('-')[0] + '-PERP'] = percs[coinarbs[arb].split('-')[0]] * 7.5 * balance - usdpos[coinarbs[arb].split('-')[0] + '-PERP']
else:
wanting[coinarbs[arb].split('-')[0] + '-PERP'] = percs[coinarbs[arb].split('-')[0]] * 7.5 * balance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment