Coder Social home page Coder Social logo

injectivelabs / injective-helix-demo Goto Github PK

View Code? Open in Web Editor NEW
96.0 28.0 67.0 44.38 MB

Decentralized Derivatives Trading. Any Market. Anytime. Anywhere.

License: Apache License 2.0

JavaScript 3.91% Dockerfile 0.01% TypeScript 36.24% Vue 58.28% CSS 1.39% Shell 0.01% HTML 0.15%

injective-helix-demo's Issues

Automatic filled amount - 0.0

When I enter 0.0 in the amount field it's filled automatically to the minimum - 0.01. I might want to buy 0.02 or 0.09. For example 0.05 BTC would cost approximately 1.5k which is a likely scenario so I have to delete the minimum filled amount and put the one I want.

Subaccount Withdrawals

Add support for withdrawing from a subaccount to the Injective Chain in the deposit modal.

Fill Button for Limit Orders

Add a Fill box for Limit Orders similar to Max which will fill the Price field with the last orderbook price. This will come handy for users who want to buy or sell an asset as soon as possible but would ideally like to set a limit order to avoid high slippage.

Fill

Refresh Needed to Display Positions

Occasionally I need to refresh the page to see the order I placed, this happen completely randomly I just follow the simple flow of executing a market order so there are no exact steps to replicate.

The below order was placed and didn't show for a few minutes, it showed only when I refreshed.

image

image

Market Dropdown Menu - Last Traded Price

The Last Traded Price field in the market dropdown menu does not reflect the last traded price, it seems to reflect the first trade that took place in a given market.

image

Wrong calculation of the amount for using % of your balance in the order

Currently clicking on "MAX" or any of the percentages doesn't correct the amount correctly.

The implementation we are using right now https://github.com/InjectiveLabs/injective-dex/blob/2d830ccc6e58546b95460b0d8cacb4c339fb8ecb/app/services/derivatives.ts#L573 and https://github.com/InjectiveLabs/injective-dex/blob/2d830ccc6e58546b95460b0d8cacb4c339fb8ecb/app/services/spot.ts#L409 was ported from our previous DEX which was using the average weighted price to calculate the amount, but now we have the worst price + slippage introduced, which makes the calculation wrong.

Fee Delegation

Fee Delegation must be activated properly from the backend.

Fee Delegation

Batch Order cancellation for spot and derivatives

The UI should allow the trader to cancel all of his open orders in a given market on the trading page. Eventually on the portfolio page, we should add a button allowing the trader to cancel all his open orders across all markets.

The new Msg types to batch cancel orders are MsgBatchCancelDerivativeOrders and MsgBatchCancelSpotOrders which are defined as follows:

// MsgBatchCancelDerivativeOrders defines the Msg/CancelDerivativeOrders response type.
type MsgBatchCancelDerivativeOrders struct {
	Sender string      
	Data   []OrderData 
}

and

// MsgBatchCancelSpotOrders defines the Msg/BatchCancelSpotOrders response type.
type MsgBatchCancelSpotOrders struct {
	Sender string      
	Data   []OrderData 
}

where the OrderData is defined as:

type OrderData struct {
	MarketId     string 
	SubaccountId string 
	OrderHash    string 
}

"Cancel All" orders

Add a "Cancel All" button on the orders panel that cancels all orders from the current market.

Calculator Modal for P&L - Liquidation

Add Calculator Modal for P&L - Liquidation

1. PNL
Choose Long or Short
Choose Leverage
Add Entry Price & Exit Price
Add Contract Quantity

2.Liquidation
Choose Long or Short
Choose Leverage
Add Entry Price
Add Contract Quantity
Add Margin

Subaccount balance not updated upon order execution

Executed a market sell for 100 BNB. The subaccount balance has not been updated and I try to execute a market sell for 300 BNB, the FE allows me to input 300 BNB in the field and I can also see that I have 357 available BNB, upon executing the order I get an error message.
image

Upon refreshing only, the amount is updated.
image

Decimals in Amount - BTC/USDT

The BTC/USDT derivative market allows only for 2 decimals (i.e. 0.10) in the amount input whereas every other spot/derivate market allows for 3 decimals (i.e. 0.111).

Allow for user-input leverage amount

The slider doesn't allow the user to specify the actual exact desired leverage amount. We should allow the user to type in the desired leverage amount.

Not sure where on the UI we should include this and how.

@achilleas-kal could you do some research and advise on where/how we should add this?

"Add Margin" button to positions

Traders need to have the ability to increase margin in their positions in order to prevent liquidation. The FE should add a button (probably somewhere next to the position) to allow them to deposit more margin.

The Msg type is:

type MsgIncreasePositionMargin struct {
	Sender                  string 
	SourceSubaccountId      string 
	DestinationSubaccountId string 
	MarketId                string 
	// amount defines the amount of margin to add to the position
	Amount sdk.Dec
}

where SourceSubaccountId is the subaccount providing the funds, DestinationSubaccountId is the subaccountID owning the position and MarketId is the marketID of the position.

Trader's Portfolio

Make a portfolio page that will allow the trader to:

  • See his trade and order history,
  • See his open orders in all markets,
  • See his open positions in all markets

MarkPrice Threshold Check

Inability to place orders due to insufficient margin.

Orders fail to be executed due to a mark price threshold check. The hypothesis is that the mark price variable takes a while to reflect the orderbook price.

Buy Order
GTE Error

Sell Order
LTE Error

automatically change Invalid number into integer

deposit and withdraw funds between the main account and subaccount are OK.
Screenshot from 2021-06-24 17-17-48

Automatical change an invalid number to an integer can be lethal to traders.
Screenshot from 2021-06-24 17-20-12

Say I want to sell 0.111 BTC, at a price a lot lower than the market price. but I missed the .. 0111 will be changed automatically to 111 which is smaller than the amount of BTC in my account. This will be a huge loss.

Round down deposit amount

Address has 10000000220.214872 USDT but FE tries to withdraw 10000000220.2149 USDT upon clicking MAX, thus resulting in an error
image

image

Log out user upon changing wallet

Log out the user when changing the wallet from MetaMask, if user signs on the DEX with wallet Y and then changes to wallet X while being connected, he can't sign txs.

image

This works as intended on the Equinox Staking dashboard - users are automatically logged out when they change wallets.

Positions Close Partially

Occasionally positions close partially, this could be a non-issue if there's no counterparty to take over the rest of the position.

Open position before closure
1st placed

Open position after closure
1st after closing

Ability to fill the amount with all the available liquidity in the orderbook

When users click on an order in the book, the input amount is filled with the exact amount of that order. Wouldn't it be better if we filled the amount with all the orders below? That would prove invaluable for someone who wants to market buy as much as possible and eat up all the liquidity so by clicking in the top order they would see how much they can buy instantly.

Last Traded Price - Cannot Place Trades

The Last Traded Price resets every few seconds and becomes 0. Moreover, when that happens, users cannot place trades when they use leverage (anything > 1). The Last Traded Price field becomes positive a few seconds afterwards and I can place trades until it becomes 0 again.

Last Traded Price

Max Slippage

Allow the user to set the maximally tolerated slippage

Get rid of extra decimals on PRICE CHART

We need to correctly format the decimals of the price chart using mini price increments too? too many trailing zeros. FE needs to access to tickSize from markets in order for chronos side to render the tradable prices on chart properly.

The tickSize (i.e price decimals) should be returned in the config for the symbol (https://staking-api.injective.network:4444/api/chronos/v1/spot/symbols?symbol=inj%2Fpeggy0x69efCB62D98f4a6ff5a0b0CFaa4AAbB122e85e08)
pricescale: 1000000 and volume_precision: 6

chart_prices

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.