Skip to content

Instantly share code, notes, and snippets.

View FernandoMartinelli's full-sized avatar

Fernando Martinelli FernandoMartinelli

View GitHub Profile
poolsData = [
{ 'Bmkr': 1033191.1981189704,
'Bweth': 21709.92411864851,
'Wmkr': 8.261291241849618,
'Wweth': 1.7387087581503824,
'fee': 0.015},
{ 'Bmkr': 911870.2026231368,
'Bweth': 30347.518852549234,
'Wmkr': 7.509918308978633,
'Wweth': 2.4900816910213672,
def isWrapPair(equivalentSets, tokenA, tokenB):
for equivalentSet in equivalentSets:
if ((tokenA in equivalentSet) and (tokenB in equivalentSet)):
return True
return False
equivalentSets = [
["WETH", "aETH", "cETH", "iETH", "iETH", "PETH"], # ETH group
["DAI", "aDAI", "cDAI", "dDAI", "iDAI", "yDAI", "rDAI", "CHAI"], # DAI group
["USDC", "aUSDC", "cUSDC", "dUSDC", "iUSDC", "yUSDC"] # USDC group
@FernandoMartinelli
FernandoMartinelli / gist:0c5122a940b02826024cc73773e3524f
Created June 10, 2020 13:52
Preview of RatioFactor for Balancer pools (just add the pool weights to the assetWeights list)
assetWeights = [ [ 0.5, 0.5 ] ]
assetWeights.append([ 0.6, 0.4 ])
assetWeights.append([ 0.75, 0.25 ])
assetWeights.append([ 0.8, 0.2 ])
assetWeights.append([ 0.9, 0.1 ])
assetWeights.append([ 0.98, 0.02 ])
assetWeights.append([ 1.0/3.0, 1.0/3.0, 1.0/3.0 ])
assetWeights.append([ 0.25, 0.25, 0.25, 0.25 ])
assetWeights.append([ 0.2, 0.2, 0.2, 0.2, 0.2 ])
assetWeights.append([ 0.49, 0.49, 0.02 ])

Keybase proof

I hereby claim:

  • I am fernandomartinelli on github.
  • I am fernandom (https://keybase.io/fernandom) on keybase.
  • I have a public key whose fingerprint is F5CF 5300 FE0F 9338 2485 6383 AD32 5B90 9B55 3239

To claim this, I am signing this object: