graphprotocol / graphprotocol/contracts
Bonding curve formula precision limits
Nobody has claimed this yet.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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