Skip to content
Merged
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 @@ -141,6 +141,18 @@ def _widgetize_inner(command: str, params: str, depth: int = 0) -> str:
elif command == 'stake-sfrxeth':
params = json.load(params)
lines.append(f"sfrxETH deposit action for address: {params['receiver']}, amount: {params['value']}.")
elif command == 'yield-protocol-lend':
params = json.loads(params)
lines.append(f"yield protocol lend action for token: {params['token']}, amount: {params['amount']}.")
elif command == 'yield-protocol-lend-close':
params = json.loads(params)
lines.append(f"yield protocol lend close action for token: {params['token']}, amount: {params['amount']}.")
elif command == 'yield-protocol-borrow':
params = json.loads(params)
lines.append(f"yield protocol borrow action for borrow token: {params['borrowToken']}, borrow amount: {params['borrowAmount']}, collateral token: {params['collateralToken']}, collateral amount: {params['collateralAmount']}.")
elif command == 'yield-protocol-borrow-close':
params = json.loads(params)
lines.append(f"yield protocol borrow close action: {params['borrowToken']}")
else:
# assert 0, f'unrecognized command: {command}({params})'
lines.append(f"An unrecognized command: {command}({params})")
Expand Down
66 changes: 65 additions & 1 deletion knowledge_base/widgets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -613,4 +613,68 @@
- receiver
- value
type: object
return_value_description: ''
return_value_description: ''
- _name_: display_yield_protocol_lend
description: use the yield protocol to lend tokens at a fixed rate
parameters:
properties:
token:
description: the token to lend
type: string
amount:
description: amount of token to lend
type: string
required:
- token
- amount
type: object
return_value_description: ""
- _name_: display_yield_protocol_lend_close
description: use the yield protocol to close a lend position
parameters:
properties:
token:
description: the token to close
type: string
amount:
description: amount of token to close
type: string
required:
- token
- amount
type: object
return_value_description: ""
- _name_: display_yield_protocol_borrow
description: use the yield protocol to borrow a token using a different token as collateral
parameters:
properties:
borrowToken:
description: the token to borrow
type: string
borrowAmount:
description: amount of token to borrow
type: string
collateralToken:
description: the token to use as collateral
type: string
collateralAmount:
description: amount of collateral token to use
type: string
required:
- borrowToken
- borrowAmount
- collateralToken
- collateralAmount
type: object
return_value_description: ""
- _name_: display_yield_protocol_borrow_close
description: use the yield protocol to close a vault (borrow position) made up of debt and collateral
parameters:
properties:
borrowToken:
description: the token that was borrowed
type: string
required:
- borrowToken
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 @@ -50,7 +50,7 @@
WIDGET_INFO_TOKEN_LIMIT = 4000

# Widget Index
WIDGET_INDEX_NAME = "WidgetV15"
WIDGET_INDEX_NAME = "WidgetV16"

def get_widget_index_name():
if env.is_local():
Expand Down