This project is implemented by serverless system. The packages and main.py file is deployed by GCP cloud function. Every noon, A GCP scheduler calls enftAlert function in main.py.
-
Purpose : Notifying NFTs undervalued on the market to DAO members whether to buy or not.
-
Function :
-
start_telegram_poll(updater, dispatcher, data, chat_id)
- This function is called by check_prices function in nft_asset_check.py and update_est_prices in nft_holdings_update.py. Argument 'data' is made by these functions.
- The poll message specifies how much undervalued (or depreciated) the NFT is through telegram bot if that condition is satisfied.
- The poll message also informs the remaining ETH investment in the current DAO, and Initiate a vote on whether to buy (or sell, in the case of NFTs DAO already has)
- Poll answers are handled by 72AD pollHandle function in main.py using webhook.
-
-
Purpose : Checking NFTs undervalued on the market sale. Triggering telegram poll for purchase.
-
Function :
- check_prices(updater, dispatcher)
- Using graphQL subgraph, we can get on sale data of NFTs. updatedAt_gt:{yesterday_time}} means that we call objects which are updated within one day.
- Checking whether the gap satisfies a (predefined) certain condition for purchase by comparing the specific NFT price on current market and the estimated price of NFT Bank.
- If the condition is satisfied, this function triggers a telegram poll.
- check_prices(updater, dispatcher)
-
Purpose : Checking NFT holdings which price is crushed during recent days. Triggering telegram poll for selling.
-
Function :
- update_est_prices(updater, dispatcher)
- For every nft holdings in a DAO, this function updates estimated price by NFTbank.
Also, it records price_high, which means the most expensive estimated value
since the DAO bought that NFT. - Checking whether the gap satisfies a (predefined) certain condition for purchase by comparing now estimated price and the price_high.
- If the condition is satisfied, this function triggers a telegram poll.
- For every nft holdings in a DAO, this function updates estimated price by NFTbank.
Also, it records price_high, which means the most expensive estimated value
- update_est_prices(updater, dispatcher)
-
Purpose : In main.py we use the functions explained above, and handle the poll answers and accept requests about DAO register and governance variables adjustment.
-
Function :
-
enftAlert(updater, dispatcher)
- Calls check_prices function in nft_asset_check.py
- Calls update_est_prices function in nft_holdings_update.py
-
pollHandle()
- Using telegram webhook, the telegram answers become post requests to this pollHandle function.
- When the poll is made, we set the quorum of poll. For every consent answer, this function add gov_token value. If gov_token value exceeds the quorum, This function buys or sells NFT of the poll. And then, we updates pending list and holdings list and transaction list.
- The buy/sell code will be replaced by solidity code or web3 code in near future.
-
daoSetting()
- Variables about DAO, for example telegram chat id, governance token distribution, governance variables will be saved in database.
- This part will be will be replaced by solidity code or web3 code in near future.
-