This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async def fetch_pool(self, url, session): | |
resp = await session.request(method="GET", url=url) | |
json = await resp.json() | |
self.json_pools.extend(json.get("results")) | |
async def make_pools_fetch(self, requests_needed: int): | |
async with ClientSession() as session: | |
tasks = list() | |
for request in range(requests_needed): | |
url = f"https://mainnet.analytics.tinyman.org/api/v1/pools/?limit=10&offset={request * 10}&ordering=-liquidity&verified_only=true&with_statistics=False" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import backtrader as bt | |
import yfinance as yf | |
def get_yf_data(ticker="BTC-USD", interval="1d", period="max", **kwargs): | |
""" | |
A function that returns a Backtrader data feed using Yahoo Finance API | |
Parameters | |
-------------------------------------- | |
ticker - Yahoo Finance Ticket to fetch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import backtrader as bt | |
import math | |
class DollarCostAverage(bt.Strategy): | |
# This is the amount of money we will add monthly | |
params = dict( | |
monthly_cash=1000 | |
) | |
def __init__(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fund | Best Possible Percent Change | |
---|---|---|
Coinbase | 146177.6 | |
Binance | 135736.47 | |
MultiCoin | 105548.71 | |
Arrington XRP Capital | 80810.18 | |
Blockchain Capital | 67534.06 | |
Digital Currency Group | 65069.49 | |
Three Arrows Capital | 49040.38 | |
Fabric Ventures | 46760.83 | |
a16z | 37593.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asset_name | count | funds | |
---|---|---|---|
oasislabs | 6 | ['a16z', 'Arrington XRP Capital', 'Binance', 'Blockchain Capital', 'Dragonfly Capital', 'Winklevoss Capital'] | |
arweave | 5 | ['a16z', 'Arrington XRP Capital', 'Blockchain Capital', 'Coinbase', 'MultiCoin'] | |
Polkadot | 5 | ['1Confirmation', 'Arrington XRP Capital', 'Fabric Ventures', 'Placeholder Ventures', 'Three Arrows Capital'] | |
OpenSea | 4 | ['1Confirmation', 'a16z', 'Blockchain Capital', 'Coinbase'] | |
Coinbase | 4 | ['1Confirmation', 'Blockchain Capital', 'Digital Currency Group', 'Fabric Ventures'] | |
tagomi | 4 | ['Digital Currency Group', 'Dragonfly Capital', 'Fabric Ventures', 'MultiCoin'] | |
dYdX | 4 | ['1Confirmation', 'a16z', 'Dragonfly Capital', 'Three Arrows Capital'] | |
Forta | 4 | ['1Confirmation', 'a16z', 'Coinbase', 'Placeholder Ventures'] | |
Hashflow | 4 | ['Arrington XRP Capital', 'Coinbase', 'Digital Currency Group', 'Fabric Ventures'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Ensure you ahve already run `aws configure` and set up your access/secret keys then run this on your desktop | |
""" | |
import os | |
import sys | |
from urllib.request import urlopen | |
import zipfile | |
from io import BytesIO | |
import json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import os | |
import logging | |
import json | |
import cbpro | |
class CoinbaseBot(): | |
def __init__(self, amount, crypto_token, api_key, secret_key, passphrase): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p aws-layer/python/lib/python3.8/site-packages | |
pip3 install cbpro --target aws-layer/python/lib/python3.8/site-packages | |
cd aws-layer/ | |
zip -r9 cbpro-layer.zip . |