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
""" | |
This script gets the buy/sell prices from the vvs finance (https://vvs.finance/swap) smart contracts | |
for a given block number and path. | |
""" | |
from datetime import datetime | |
from dataclasses import dataclass | |
from typing import ( |
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 | |
from datetime import datetime | |
from web3 import Web3 | |
RATELIMIT_MESSAGES = [ | |
"Too Many Requests" | |
] | |
# https://www.cronosresearch.com/resources/rpc-list | |
rpc_providers = [ |
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
from aptos_sdk.account import Account, AccountAddress | |
from aptos_sdk.client import RestClient, FaucetClient | |
from aptos_sdk.ed25519 import PrivateKey | |
NODE_URL = "https://fullnode.devnet.aptoslabs.com/v1" | |
FAUCET_URL = "https://tap.devnet.prod.gcp.aptosdev.com" | |
wallet_address = "xxx" | |
private_key = "xxx" |
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 | |
from typing import Optional | |
from aptos_sdk.account import Account | |
from aptos_sdk.account_address import AccountAddress | |
from aptos_sdk.bcs import Serializer | |
from aptos_sdk.client import FaucetClient, RestClient | |
from aptos_sdk.transactions import ( | |
EntryFunction, | |
TransactionArgument, |
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
NODE_URL = "https://fullnode.mainnet.aptoslabs.com/v1" | |
FAUCET_URL = "https://tap.devnet.prod.gcp.aptosdev.com" | |
wallet_address = None | |
private_key = None | |
rest_client = HoustonClient(NODE_URL) | |
pk = PrivateKey.from_hex(private_key) | |
addr = AccountAddress.from_hex(wallet_address) | |
acc = Account(addr, pk) |
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
D:\dev\samples\py>pypy -mpip install aptos_sdk | |
Defaulting to user installation because normal site-packages is not writeable | |
Collecting aptos_sdk | |
Using cached aptos_sdk-0.4.1-py3-none-any.whl (18 kB) | |
Collecting httpx | |
Using cached httpx-0.23.0-py3-none-any.whl (84 kB) | |
Collecting pynacl | |
Using cached PyNaCl-1.5.0.tar.gz (3.4 MB) | |
Installing build dependencies ... done | |
Getting requirements to build wheel ... done |
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 json | |
import requests | |
from datetime import datetime | |
# https://fullnode.mainnet.aptoslabs.com/v1/spec#/operations/get_account_transactions | |
all_transactions = [] | |
for wallet in wallets: | |
try: | |
url = f"https://fullnode.mainnet.aptoslabs.com/v1/accounts/{wallet.address()}/transactions" |
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 | |
from web3 import Web3 | |
from dydx3 import Client | |
from dydx3.constants import API_HOST_MAINNET | |
from dydx3.constants import NETWORK_ID_MAINNET | |
from dydx3.constants import MARKET_BTC_USD | |
from dydx3.constants import ORDER_SIDE_BUY | |
from dydx3.constants import ORDER_TYPE_LIMIT | |
WEB_PROVIDER_URL = 'https://mainnet.infura.io/v3/????????????????????????????' |
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
from datetime import datetime | |
import time | |
from itertools import combinations | |
import pandas as pd | |
from ccxt import bybit | |
from ccxt import okx | |
from ccxt import gateio | |
CANDIDATE_FILE_NAME = "mm_candidates.csv" |
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
using System; | |
using System.Security.Cryptography; | |
using System.Text; | |
class Program | |
{ | |
static void Main() | |
{ | |
// Define a password, salt, and iteration count for key derivation | |
string password = "ThisIsAStrongPassword"; |