Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integration: liquity #134

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions chat/display_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})")
Expand Down
56 changes: 56 additions & 0 deletions knowledge_base/widgets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''
2 changes: 1 addition & 1 deletion utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
Loading