ChoiceCoin/DeFi

Friday Flash Bash

Closed this issue · 5 comments

Details
Silver Badge: 99,000 Choice
Deadline: Friday April 15th @ 11:59PM PDT
Extended Deadline: Tuesday April 19th @ 11:59PM PDT

Task
Execute a successful flash loan, using Choice Flash Tutorial. Provide a txid for your largest reward and the script you used. The largest reward from a submission that meets all the requirements will win the Bronze Badge. The reward does not need to use Choice.

Requirements

  1. All files must be in one folder.
  2. Only one file may be used to script the code.
  3. All folders must be named [user_name]_flashbash.
  4. All contributions must be made to the flashbash folder.
  5. All PRs must be titled, Username_FlashBash.
  6. Make sure you merge upstream before making a PR.

Winners
All winners will be announced and rewards will be distributed by April 20th @ 9:30PM EST.

After creating a pool with assets(ALGO/CHOICE)
App Call : https://algoexplorer.io/tx/E36YWCL6YEBJPN26ESUD2AWIWSYBXIGMVTPDSDZAEL6XI2OTQJTQ
Pool Txn : https://algoexplorer.io/tx/AK5J3SWUEHUKH3EK65N24DR5LYUI76ZMSLXIZEJHRWNOBU45YHAQ

Getting some exceptions in the flashloan execution.

First
Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\algofi_amm\utils.py", line 264, in submit txid = algod.send_transactions(self.signed_transactions) File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\algosdk\v2client\algod.py", line 307, in send_transactions return self.send_raw_transaction( File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\algosdk\v2client\algod.py", line 237, in send_raw_transaction return self.algod_request("POST", req, data=txn, **kwargs)["txId"] File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\algosdk\v2client\algod.py", line 89, in algod_request raise error.AlgodHTTPError(e, code) algosdk.error.AlgodHTTPError: TransactionPool.Remember: transaction QIRY3Z4AH4BKMUVFU7XH7V4YAZIRPL6RPTXNCIJK4SODAHTXJUFQ: logic eval error: assert failed pc=1190. Details: pc=1190, opcodes=assert <= assert

Second one

Traceback (most recent call last): File "c:\Users\user\genie_flashbash\main.py", line 66, in <module> flash_loan_txn.submit(amm_client.algod, wait=True) File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\algofi_amm\utils.py", line 266, in submit raise Exception(str(e)) Exception: TransactionPool.Remember: transaction QIRY3Z4AH4BKMUVFU7XH7V4YAZIRPL6RPTXNCIJK4SODAHTXJUFQ: logic eval error: assert failed pc=1190. Details: pc=1190, opcodes=assert <= assert

Update

The bash deadline will be extended to April 17th at 11:59PM PDT. And the prize will be increased from 29,000 Choice to 39,000 Choice.

I tried running the flash loan on Testnet for ALGO/USDC

Made some changes to the tutorial code

Changed the pool variable to pool = amm_client.get_pool(PoolType.CONSTANT_PRODUCT_30BP_FEE, asset1_id, asset2_id)

IS_MAINNET = False

added params=None to swap_exact_for_txn and flash_loan_txn.

After running the code, the output was this;

PS C:\Users\user\genie_flashbash> & C:/Users/user/AppData/Local/Programs/Python/Python39/python.exe c:/Users/user/genie_flashbash/testnet.py S42RHBNDM2FJPW7NWBX6TQNBQJ7FE25QYO4ARUKPW2WQWTDJ42OPTY4BGA {'asset_id': 1, 'creator': 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ', 'decimals': 6, 'default_frozen': False, 'freeze': None, 'manager': 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ', 'name': 'Algorand', 'reserve': 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ', 'total': 10000000000, 'unit_name': 'ALGO', 'url': 'https://www.algorand.com/'} 2 Waiting for confirmation Transaction W6B5IEQEPPZIFDWPR7D6T672V7U5IWKQ3HYLBGDWPYA4MQYUZCSQ confirmed in round 21034247.

TXN on algoexporer, click here

This is the address used for it, S42RHBNDM2FJPW7NWBX6TQNBQJ7FE25QYO4ARUKPW2WQWTDJ42OPTY4BGA

Multiple txns(ALGO/USDC) were made.

Update

The bash deadline will be extended to April 19th at 11:59PM PDT. And the prize will be increased from 39,000 Choice to 99,000 Choice.

Winners:

Silver: @Kleopatra123 | 99,000 Choice
Silver: @rusty-tiger | 99,000 Choice
Bronze: @eugenennamdi | 39,000 Choice
Bronze: @dhanzy | 39,000 Choice