Choice Coin is available on TinyMan and included in several asset pairs.
TinyMan is a liquidity pool software which supports Algorand Standard Assets (ASA) liquidity pools. The software is innovative insofar as it allows users to perform swaps and yield farming with minimal fees. As such, TinyMan provides access to small market places, leveling the playing field with institutionalized finance. TinyMan is a great decentralized finance (DeFi) technology on the Algorand network.
Liquidity Pools
Liquidity pools are accounts holding two different ASAs contributed by poolers. In return for providing assets, poolers receive a share of transaction fees. Liquidity must be added and withdrawn in ASA pairs. In exchange for providing liquidity, poolers receive pool tokens. Pool tokens can be withdrawn at anytime for the proportional representation of the pool.
Asset Swaps
A swap is an ASA transfer to or from a liquidity pool. Swaps can be made using the TinyMan web application or using the TinyMan Python-SDK. Swaps initiate an ASA transfer from the swapper's wallet and the liquidity pool.
The Choice Coin TinyMan Wrapper is an open source wrapper that allows users to acquire Choice Coin directly through their Terminal using ALGO and various Algorand Standard Assets (ASAs). Currently, the Choice-TinyMan Wrapper supports ALGO, USDC, YLDY, OPUL, AKITA, GEMS, ACORN, COMAND, TACO, and HDL. This wrapper leverages the TinyMan Python SDK, which is an open source software for interacting with TinyMan. This allows users to get Choice Coin by swapping ASAs directly from their terminal, thus allowing them to participate in the ecosystem through an asset of their choosing.
from tinyman.v1.client import TinymanMainnetClient
from algosdk.v2client import algod
from algosdk import account, encoding, mnemonic,transaction
print("Welcome to the custom Choice-TinyMan Terminal Wrapper!.")
address = ""
user_mnemonic = ""
private_key = mnemonic.to_private_key(user_mnemonic)
client = TinymanMainnetClient(user_address = address)
if(not client.is_opted_in()):
print('Account not opted into TinyMan app, opting in now..')
transaction_group = client.prepare_app_optin_transactions()
transaction_group.sign_with_private_key(address, account['private_key'])
result = client.submit(transaction_group, wait=True)
This code block allows the user to remotely connect to the TinyMan Client, this enabling them to make swaps for Choice Coin. It also opts them into the application in case they have not used TinyMan before.
def choice_for_algo():
Choice = client.fetch_asset(297995609)
ALGO = client.fetch_asset(0)
pool = client.fetch_pool(Choice, ALGO)
quote = pool.fetch_fixed_input_swap_quote(ALGO(1_000_000), slippage=0.01)
print(f'Choice per ALGO: {quote.price}')
print(f'Choice per ALGO (worst case): {quote.price_with_slippage}')
print("Do you still want to go through this transaction? Type Y for 'Yes' and N for 'No'")
binary = input()
if binary == "Y":
new = int(input("How much ALGO do you want to spend? ")) * 1000000
quote = pool.fetch_fixed_input_swap_quote(ALGO(new), slippage=0.01)
print(f'Swapping {quote.amount_in} to {quote.amount_out_with_slippage}')
transaction_group = pool.prepare_swap_transactions_from_quote(quote)
# Sign the group with our key
transaction_group.sign_with_private_key(address, private_key)
# Submit transactions to the network and wait for confirmation
result = client.submit(transaction_group, wait=True)
# Check if any excess remaining after the swap
excess = pool.fetch_excess_amounts()
if Choice in excess:
amount = excess[Choice]
print(f'Excess: {amount}')
if amount > 1_000_000:
transaction_group = pool.prepare_redeem_transactions(amount)
transaction_group.sign_with_private_key(address, private_key)
result = client.submit(transaction_group, wait=True)
print('Returning to wrapper home')
This code block fetches the current price statistics for the Algo-Choice liquidity pool, and then proceeds to allow the user to make a decision as to whether they want to continue with the swap. If the user decides to continue with the transaction, the wrapper automatically signs the transaction and finishes the swap.
TinyMan Website: https://tinyman.org/
Copy link