feat: add new hedge creation to silkroad #50
Labels
scope: contracts
To be applied to issues or PRs that involve smart contractgs
scope: UI
Threads for addressing UX changes and improving user interface
type: feature request
Feature requests. Something that would be nice to have
Milestone
Objective
we need to integrate the silkroad page frontend with the
XeonHedging_Test_V1
ABI which was added in #49 and ensure that all necessary contract interactions are correctly wired up.this issue is being worked on alongside
New Hedge Popup
hedge type
dropdownCreate Hedge
allow users to open a new hedge (
createHedge
)when a user clicks the (+) button to create a new hedge this opens a popup to enter information about the option being opened. when the user clicks
write
this data gets passed to thecreateHedge
function with the following params:tool
: the type of hedge (0 = CALL, 1 = PUT, 2 = SWAP)token
: address of the ERC20 tokenamount
: amount of the underlying assetcost
: the premium or buying coststrikePrice
: strike price of the optiondeadline
: expiration timestamp of the hedgechange
0xA929...0cE7
to the address of the token selected in the dropdown (format the address the same way using...
)show user hedge details (
getUserTokenBalances
)the small section on the bottom to "View Your Balances" shows the amount of tokens the user currently has in the protocol. It is is obtained by reading the
getUserTokenBalances
method and requires:token
: address of the token selected from the dropdownuser
: address of the userreturns
note that the values for
deposited
,locked
,withdrawn
, andavailable
will come back as the token amount with 18 decimals and need to be formatted to 2 decimals of precision (i.e. a return value of100000000000000000000
is100
tokens and should be displayed as100.00
)The text was updated successfully, but these errors were encountered: