diff --git a/chat/display_widgets.py b/chat/display_widgets.py index 2d7fb05..d96bb5c 100644 --- a/chat/display_widgets.py +++ b/chat/display_widgets.py @@ -201,6 +201,18 @@ def _widgetize_inner(command: str, params: str, depth: int = 0) -> str: elif command == 'withdraw-vault': items = params.split(",") lines.append(f"Withdraw vault action for token: {items[0]}, amount: {items[1]}.") + elif command == 'liquity-borrow': + items = params.split(",") + lines.append(f"Borrow LUSD using ETH on liquity for borrow amount: {items[0]}, and collateral amount: {items[1]}.") + elif command == 'liquity-close': + items = params.split(",") + lines.append(f"Close a trove on liquity.") + elif command == 'liquity-adjust': + items = params.split(",") + lines.append(f"Adjust liquity trove by borrowing more LUSD using ETH for borrow amount: {items[0]}, and collateral amount: {items[1]}.") + elif command == 'liquity-repay': + items = params.split(",") + lines.append(f"Adjust liquity trove by repaying LUSD amount: {items[0]}, and withdrawing collateral amount: {items[1]}.") else: # assert 0, f'unrecognized command: {command}({params})' lines.append(f"An unrecognized command: {command}({params})") diff --git a/knowledge_base/widgets.yaml b/knowledge_base/widgets.yaml index b178db4..bde741a 100644 --- a/knowledge_base/widgets.yaml +++ b/knowledge_base/widgets.yaml @@ -835,4 +835,60 @@ - amount - vault type: object + return_value_description: '' +- _name_: display_liquity_borrow + description: borrow LUSD using ETH using the liquity protocol + parameters: + properties: + borrowAmount: + description: amount of LUSD to borrow + type: string + collateralAmount: + description: amount of ETH to use as collateral + type: string + required: + - borrowAmount + - collateralAmount + type: object + return_value_description: '' +- _name_: display_liquity_close + description: close a trove, which consists of borrowed LUSD and ETH as collateral + parameters: + properties: + user_wallet_address: + description: wallet address to use, which is inferred + type: string + required: + - user_wallet_address + type: object + return_value_description: '' +- _name_: display_liquity_adjust + description: adjust a liquity trove by borrowing more LUSD using the same or more ETH + parameters: + properties: + borrowAmount: + description: amount of LUSD to borrow + type: string + collateralAmount: + description: amount of ETH to use as collateral, which can be zero additional ETH if no amount specified + type: string + required: + - borrowAmount + - collateralAmount + type: object + return_value_description: '' +- _name_: display_liquity_repay + description: adjust a liquity trove by repaying LUSD and removing ETH if specified, otherwise assume the user doesn't want to remove ETH + parameters: + properties: + repayAmount: + description: amount of LUSD to repay + type: string + withdrawCollateral: + description: amount of ETH collateral to withdraw if provided + type: string + required: + - repayAmount + - withdrawCollateral + type: object return_value_description: '' \ No newline at end of file diff --git a/utils/constants.py b/utils/constants.py index d908dee..3c9fa71 100644 --- a/utils/constants.py +++ b/utils/constants.py @@ -53,7 +53,7 @@ WIDGET_INFO_TOKEN_LIMIT = 4000 # Widget Index -WIDGET_INDEX_NAME = "WidgetV24" +WIDGET_INDEX_NAME = "WidgetV25" def get_widget_index_name(): if env.is_local():