This file contains 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
#!/usr/bin/env python3 | |
import sys | |
import struct | |
from base64 import b64decode | |
from algosdk.v2client.algod import AlgodClient | |
from tinyman.assets import Asset, AssetAmount | |
class HumblePool: | |
"""Liquidity pool in the HumbleSwap AMM DEX.""" | |
def __init__(self, client: AlgodClient, app_id: int, N2NN: bool) -> None: |
This file contains 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 itertools import chain | |
from base64 import b64decode | |
from algosdk.v2client.indexer import IndexerClient | |
from algosdk.encoding import checksum | |
# List of Humble.sh DEX pools from on-chain logs. | |
# Translated to Python from https://gist.github.com/DanBurton/d11a6c8a99b33f28ea7fc83a82ccaef8 | |
# Pool ABI docs: https://reach-sh.github.io/humble-sdk/LP-ABI.html | |
indexer = IndexerClient("", "https://mainnet-idx.algonode.cloud") |
This file contains 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
#!/usr/bin/env python3 | |
from dotenv import dotenv_values | |
from algosdk import mnemonic, account | |
from algosdk.v2client import algod | |
from tinyman.v2.client import TinymanV2MainnetClient | |
from pprint import pprint | |
from urllib.parse import quote_plus | |
# Load user address | |
env_vars = dotenv_values(".env") |
This file contains 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, timedelta | |
from dataclasses import dataclass | |
from base64 import b64decode | |
from pprint import pprint | |
from algosdk.v2client.algod import AlgodClient | |
from algosdk.v2client.indexer import IndexerClient | |
from algosdk.encoding import encode_address | |
from algofipy.state_utils import format_state |
This file contains 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 dotenv import dotenv_values | |
from algosdk import mnemonic, account | |
from algosdk.v2client.algod import AlgodClient | |
from algosdk.v2client.indexer import IndexerClient | |
from algofipy.algofi_client import AlgofiClient | |
from algofipy.globals import Network | |
from algofipy.transaction_utils import TransactionGroup | |
# load user account |