Giter Site home page Giter Site logo

fusion's Introduction

Fusion

Adding a new project

  1. Add the token to the psy-token-registry
  2. Deploy a new version of the registry to npm
  3. Update package.json to use the latest version and install
  4. Add the project to mainnet projects

Devnet Testing

  • You will still have to take the following steps to get an option in your wallet that will show up
  1. Make sure your wallet has devnet SOL (got to trade.PsyOptions faucet page to claim some, be sure to set the network to devnet)
  2. Claim some PSY from that faucet page as well
  3. [OPTIONAL] Head to initialize market page. Again be sure to change the network to devnet and create whatever style option you want
  4. Head to the mint page. Again be sure to change the network to devnet and fill in the SAME EXACT parameters you had before. This will fill the option market key at the top and allow you to mint options.
    • You can use the 12/30/2022 $1 PSY CALL market with address Ap8vsZspKn3oGBhf166oJR5pcMcg7JS2b7TAh1yfSmg6
  5. After minting the options go back to fusion and connect your wallet.

Development

Install

git clone [email protected]:mithraiclabs/psyoptions-management.git

yarn install

Run

yarn start

DevTools

The project uses recoil and some experimental dev tools.

src/components/DevTools

In the browser, you can use these commands:

  • changeMonitorKey ctrl-m
  • changePositionKey ctrl-q
  • toggleVisibilityKey ctrl-h

The console and dock monitor will update after recoil state changes

fusion's People

Contributors

parhim avatar tomjohn1028 avatar claresegrue avatar jasonhargrove avatar nitric avatar

Stargazers

Uwe Cerron avatar

Watchers

Christian Drappi avatar  avatar  avatar  avatar

Forkers

claresegrue

fusion's Issues

Deeplink exercising options

Some potential partners do not want to host the components on their own UI, but would still like to direct users to claim and exercise. The UI needs the ability to deep link to exercising an option (keyed by mint)

Different option markets created

I was explicitly selecting 1 Apr 2024 12am GMT as the option expiry when testing minting of options, but somehow different options got minted (according to trade's UI):
Screenshot 2023-03-08 at 3 32 27 PM

Close Options: Allow writer to close unused options

A builder may have minted more options than they desired or some other case where they end up with writer tokens and option tokens. They should have the ability to reclaim the underlying back, at anytime before or after expiration. This can be accomplished with the closePosition instruction.

Style the PortfolioOverview Page

The PortfolioOverview and ProjectOverview component should be styled more similarly to the Carta screenshot shown in V1.

It should be a vertical list of ProjectOverviews and the ProjectOverviews has the holdings scrolling horizontally.

Query blockchain to get all options for connected wallet

  1. Create PsyAmerican program (see example here)
  2. Load all SPL Mint addresses when the user connects their wallet
  3. Load all OptionMarkets, see docs
  4. Filter option markets by optionMint if the user's tokens include the optionMint

To take this a step further the quoteAssetMint or underlyingAssetMint on the OptionMarket can then be cross referenced with the list of projects to see which projects the user holds tokens for.

Reclaim Underlying from Writer Tokens not working

Solend has reported their writer token holdings are not showing up on Fusion. So they cannot reclaim underlying from expired options in their OLM program.

The goal here is to make sure anyone using the PsyAmerican program can use the Fusion UI to reclaim the underlying.

Expired option tokens: allow users to burn and claim rent

When a user received or claimed an airdrop but did not exercise and that option has expired, they will want to know that it's expired and burn the tokens, close the account, and claim the SOL that was used for rent.

This is all done using the spl-token program with a couple instructions

A) Burn tokens
B) close account

Not clear what recovering rent does

I minted some options in my wallet that weren't distributed. Does this page mean that I can recover underlying from these undistributed options? Or does it mean that i can recover underlying only from expired options?

Either way its not clear for me and nothing is showing up on this page.

Screenshot 2023-03-08 at 3 21 16 PM

Add Deeplinking

Some potential partners do not want to host the components on their own UI, but would still like to direct users to claim and exercise. The UI needs the ability to deep link to

A) claiming from a distribution (keyed by mint)
B) exercising an option (keyed by mint)

Button Placement in Nav

Can we flip the mainnet indicator and the wallet button so that the "Connect wallet" is to the right of the Mainnet indicator?

Load spot price for a serum market

We'll likely want to display the spot price for a given Serum market. We can either

A) Use the last trade price by reading the Serum markets' event queue
B) Use the mid point of the Serum order book

The Serum spot market address can be found in the project's information example

Then the serum-ts package can be used to load the market and read the data.

Navigation Resize

  • Max width for the Nav contents should be 65% of page width on Desktop. With it being 100% on mobile with 10px padding.

  • Fusion logo & Connect Wallet button should be sized 1/2 from current sizing.

Copy does not make sense

"Total number of underlying tokens need to distribute to all recipients:" - doesnt make senes to me here.

4 PSY is the total amount of PSY that is being used as collateral for underwriting the options right? How about changing this to:

"Total number of underlying tokens required to mint options"

Screenshot 2023-03-08 at 2 36 58 PM

Font Sizes

Current sizes are
Heading 1: 58
Heading 2: 32
Body: 21

New sizes
Heading 1: 30
Heading 2: 18
Body: 14

Disabled button doesnt look obvious

After creating the airdrop, this button was shown "Create airdrop...". It didn't look obvious to me that its disabled (being kinda gray/greenish), and i was confused for a second given that I just created an airdrop.

Recommendation:

  • make it even more obvious that its disabled
  • remove completely since user can't click on it anyway
  • replace button with one that goes to the distribution page? not clear to me here what is the next step either

Screenshot 2023-03-08 at 2 46 17 PM

Refactor options holding state to Recoil

After a user connects their Wallet the PortfolioOverview component loads the connected wallet's options (src). React state was used to get the functionality in there.

But this state will need to be refactored to use Recoil so it can be efficiently used on the Project Holdings Page as well.

Keep data in inputs when switching between different steps

Scenario:

  1. I am currently inputting in airdrop details in Step 3
  2. After completing that, I realized I should add more wallets to the distribution list in Step 2
  3. After adding more wallets, upon returning to Step 3, all data that was entered earlier is now gone.

Recommendation:

  • We should avoid resetting inputs unless the user goes to a different page or completes the entire creation flow
  • In the case where we are resetting inputs, we should add a popup to warn the user that all data entered would be lost (and get user to confirm)

Option Breakdown: Add DEX Liquidity

The current option breakdown doesn't include information about DEX liquidity. Currently the user can face execution risks if they exercise and there's not enough liquidity to sell for a profit. The breakdown should include some indication of an actual execution price on a DEX (like Serum) if they were to exercise and sell all underlying.

Screen Shot 2022-08-14 at 9 39 53 PM

Create the ProjectHoldings component

As described for V1 from the Portfolio Overview page the user can click on a project to get to the ProjectHoldings page.

The task here is to create and style the UI for this page. The general thoughts are:

  • On this page we should again display the various options in the wallet for the project and the data about those options (e.g. strike, expiration, etc). There should be a Call To Action on each option that says Exercise.
  • The top of the page should display the price of the underlying token (the project's token), taken from the Serum market address (or the Aleph API).
  • Based on the price of the underlying the UI should give insight to the user on whether it makes sense or not for them to exercise a given option contract and what exchange must be made for that to happen.
  • See the Project Holdings Screenshot for an example from Carta. Again Carta has access to a lot more data so this is just for reference.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.