Skip to content
generated from refcell/femplate

Produce probabilities for economy-based environments.

License

Notifications You must be signed in to change notification settings

whitenois3/TINIH

Repository files navigation

TINIH • ci license solidity

There Is No Invisible Hand.

Why ?

In any [video-]game the developer is a, sometimes, merciful god for he is able to create an abundance of items [fungible or not] that could bring havoc to games that have a strong player-economy [WoW, CS, ...]. It is even more true in games [onchain or not] based on blockchain, involving ERC20s and ERC721s.

Such games, in particular on-chain, need tools to be more transparent towards its users.

What ?

TINIH is a controller that computes the probability of, in a gaming context, an item to spawn. The probability is based on two quantities ; a target and a value. Such quantities can be either prices or supplies (for consumables for instance).

How ?

The function used is the CDF of the Weibull distribution. With the right parameters, it has the shape of a nice sigmoid function which is close to what we intuitively desire ; high probability if the actual price is too high w.r.t the ratio (makes it more abundant) or low probability if it's too low (makes it more scarce).

Blueprint

lib
├─ forge-std — https://github.com/foundry-rs/forge-std
├─ solmate — https://github.com/Rari-Capital/solmate
src
├─ TINIHProbability controller
test
└─ TINIH.t — tests

License

AGPL-3.0-only

Acknowledgements

Disclaimer

These smart contracts are being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the user interface or the smart contracts. They have not been audited and as such there can be no assurance they will work as intended, and users may experience delays, failures, errors, omissions, loss of transmitted information or loss of funds. The creators are not liable for any of the foregoing. Users should proceed with caution and use at their own risk.

About

Produce probabilities for economy-based environments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published