Comments (3)
I can pick this up - tagging for later
from synthetix.
Synth balance over time I have. Calculating Debt would be that person's locked SNX versus Total SNX locked and then see what % of the global debt he owns? I can dive in to the smart contracts later but some pointers would be great :)
from synthetix.
Well everyone has a Synthetix.debtBalanceOf
which is their debt % multiplied by totalIssuedSynths: https://github.com/Synthetixio/synthetix/blob/v2.14.0/contracts/Synthetix.sol#L747-L775
So your % is your issuanceData[account].initialDebtOwnership
- this only changes when you issue or burn, however the % claim you have changes with every other issue & burn - so that you have the same amount but a different % as the total size has expanded (via someone's mint) or contracted (via a burn).
However, your debtBalanceOf
is totalSynths * (lastDebtEntry / your debt index entry value * your initial Debt ownership)
, eg:
- When User1 issues 100, ido = 1, deo = 0 (1) (ido = initial debt ownership, dei = debt entry index (value at that index))
- And User2 issues 25, ido = 0.25, Dei = 1 (1 - 25/100 = 0.75)
- Then User1 dbo = 125 * (0.75/1 * 1) = 93.75 (dbo = debt balance of)
- And User2 dbo = 125 * (0.75/0.75 * 0.25) = 31.25
- When User2 Issues 50, Ido = (50 + 31.25) / (125 + 50) = 0.464, Dei = 2 (0.75 * (1 - 50/175)) = 0.5357
- Then User1 duo = 175 * (0.5357/1*1) = 93.745
- And User2 dbo = 175 * (0.5356/0.5357 * 0.464) = 81.2
I hope that makes sense.
from synthetix.
Related Issues (20)
- Add predicates for missing keeper functions
- Why it can change the `rewardRate` to Zero?
- Investigate speed of `node publish build`
- `npx hardhat ops` doesn't detect if ops node running correctly HOT 1
- Unable to deploy synthetix smart contract on local blockchain HOT 1
- History,
- potential typos in exchangeRates Contract
- underscore high severity vulnerability
- Portis throws an error although we provide the app id? HOT 1
- Staking DApp => Earn Page. On Mainnet there is 0%APY shown HOT 2
- Research question regarding Proxy.sol HOT 1
- STAKING: Proof of concept to remove NEXTjs HOT 1
- melbetapp.com
- how to events #1
- Potential error in `BaseSynthetixBridge` unit test
- Ops tool dependency failure
- CI timeout on test deploy job
- CI unit test timeout
- 502 error bad gateway in simulate release job
- abi-decoder's GPL-3.0 license might not be compatible with MIT license
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 synthetix.