graphprotocol / graphprotocol/contracts

Bonding curve formula precision limits

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

Nobody has claimed this yet.

discussion
Dominant language
Solidity
Stars
374
Forks
176
Avg merge
1d 15h
Merged PRs (30d)
4

Description

The bonding curve formula is implemented using an approximation that imposes a limit on the precision we can use for shares. In certain cases when selling from the curve a user will need to not fully use the 18 decimals of a share and deal with less precision.

Example:

- User signals:   31.224989991991991029
- User unsignals: 31.224989991991991020 (fails) - just a tiny bit less than the total
- User unsignals: 31.224989991900000000 (works)
- User unsignals: 31.224989991991991029 (works) - total amount of signal

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

No file, test, or entry point is named. Start by locating the bonding-curve formula implementation and reproduce the listed signal and unsignal cases. Done should include a confirmed expected behavior for near-total amounts and a regression test covering the precision boundary.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.