DistributedCollective / DistributedCollective/Sovryn-smart-contracts

Liquidity is too low for closing position

Open
#148 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
132
Forks
57
PR merge metrics
No merged PRs in 30d

Description

A user created a 5x short position at a price of $57.000; the position size is of $390

closing_short

Then the user is trying to close it, but it seems there is not enough liquidity.

The bug here is related to tha fact that there should be some logical condition in the contract set preventing this kind of fails.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by locating the smart-contract entry points for opening and closing leveraged positions, then reproduce the reported 5x short close using the supplied price and position size; done means the insufficient-liquidity failure is prevented and covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
blockchain
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.