Comments (5)
@bangjelkoski what formula(s) for order validations does the FE currently apply? Can you link to the code?
from injective-helix-demo.
There are a couple of validations we do on the FE:
- Form validation (checking whether we have amount + price for limit orders),
- Whether there are enough fillable orders to fill the order,
- Whether the amount we want to fill is too big i.e there is no enough liquidity in the order book,
- Whether the user has enough balance/margin to make the order, https://github.com/InjectiveLabs/injective-dex/blob/39eea7a015bdee3420fecb359b9f3acecbcf7b26/components/partials/spot/trading/trade.vue#L416
also, additionally for derivatives:
- Whether the user can use the leverage the requested or its too high https://github.com/InjectiveLabs/injective-dex/blob/39eea7a015bdee3420fecb359b9f3acecbcf7b26/components/partials/derivatives/trading/trade.vue#L522
- Whether the reduce only exceeded the maxReduceOnly https://github.com/InjectiveLabs/injective-dex/blob/39eea7a015bdee3420fecb359b9f3acecbcf7b26/components/partials/derivatives/trading/trade.vue#L484
from injective-helix-demo.
I replicated multiple times, the first four criteria were satisfied and the last (not exceed maxReduceOnly) was irrelevant in my case as I had no open positions at the time.
Indeed, this occurs only when the leverage factor is set high. To replicate, attempt to open a position with 10x or 20x leverage, any amount will produce this error.
Maybe modify Bugsnag config to be able to trace errors in all releaseStages?
from injective-helix-demo.
I could replicate the issue mentioned above. The error appears when we broadcast the transaction to the injective-exchange
. /cc @albertchon
from injective-helix-demo.
We need to add validation on the UI level to prevent this issue for happening, namely:
// For Buys: MarkPrice ≥ (Margin - Price * Quantity) / ((InitialMarginRatio - 1) * Quantity)
// For Sells: MarkPrice ≤ (Margin + Price * Quantity) / ((1+ InitialMarginRatio) * Quantity)
from injective-helix-demo.
Related Issues (20)
- [DEX] [Trade] Remove Reduce-Only Order Validation on Frontend (DO NOT MERGE TO DEVNET)
- Part of the button rendered outside container
- Show 2 decimal places on Fee Discount page
- Double `--` sign is displayed for negative funding payments
- Conditional Orders
- Incorrect filled percentual under the Open Orders tab
- 'Trades' tab show trade executions as both 'buy' and 'sell'
- List of trades showing duplicated items
- VIP Tier Percentages are incorrect in the navbar dropdown HOT 2
- Price box bug HOT 1
- Bug bounty HOT 5
- P&L on open position is not automatically updated with the changes in price
- "Crescent" not included in the bridge select modal on the Portfolio page HOT 1
- List of assets on the "Balances" and "Trading Account Balances" is not complete HOT 1
- [IBC] Support Kujira Network INJ, KUJI and USK HOT 1
- il.js:109 Uncaught TypeError: Cannot read properties of undefined (reading 'NODE_DEBUG') HOT 1
- Yarn is trying to unpack in the same destination HOT 2
- what/ HOT 1
- bridge eth/inj HOT 1
- Error: account sequence mismatch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from injective-helix-demo.