Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrates Crowdloan Pallets into Altair #493

Merged
merged 2 commits into from
Oct 20, 2021

Conversation

mustermeiszer
Copy link
Collaborator

Replaces #488

@mustermeiszer mustermeiszer force-pushed the feature/altair-crowdloan-integration branch from 74dd42b to 87f656c Compare October 20, 2021 13:12
Copy link
Contributor

@mikiquantum mikiquantum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@mikiquantum mikiquantum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but need to pump the runtime version before merging

@mikiquantum mikiquantum changed the title Integrates Crowdloan Pallets into Altiar Integrates Crowdloan Pallets into Altair Oct 20, 2021
@mikiquantum mikiquantum merged commit d9d8454 into parachain Oct 20, 2021
@mikiquantum mikiquantum deleted the feature/altair-crowdloan-integration branch October 20, 2021 20:44
branan added a commit that referenced this pull request Dec 1, 2021
* Add skeleton of Tinlake investor pallet

* Remove example content from investor-pool pallet

* Switch to `Perquintill` for interest calculation

* Add tokens and initial supply/redeem order support

* Give the pool a direct parameter for the CurrencyId

* Add beginning of epoch closing logic

* Fix epoch details - it contains percentages/ratios, not absolute values.

* Add Reserve (#444)

* Epoch close tweaks

* Build the epoch execution skeleton

This expands `close_epoch` to have most of the top-level epoch
closing logic, with most of the meat still stubbed out.

* Improve errors + events for investor pallet

* Unify pool + reserve logic; remove per-tranche accounts

* Rename deposit/payout extrinsics

These extrinsics are really an interface to do fake borrowing/payback
until we have a borrower side to interact with. They are renamed to
indicate now that that is what they do.

* Add doc comments to some less-obvious pieces

* Be more consistent in use of pool_id/tranche_id

This removes some confusing code where the terms `pool` or `tranche`
were being used to refer to the id in some cases but the struct data
in others. IDs are now always delimited as such

* Remove unused traits

* Use UnixTime trait for time instead of Timestamp pallet directly

* Add Epoch Validation (#471)

* Add Reserve

* wip: checkpoint epoch validation

* checkpoint - sub ratio validation

* checkpoint - return errors + simplify balance to perquintil conversion

* address comments 1

* address comments 2

* moved currency/tranchetoken as primitive crate

* RTU1 + srtool push (#487)

* fix build

* add workflow dispatch for docker (#492)

* Integrates Crowdloan Pallets into Altair (#493)

* Integrates crowdloan pallets to altait

* Pump rt-version 1005, minDep democ 1000 AIR

* Fix: Foreign claims and inhance error of validate unsigned (#474)

* Changed validate-unsigned

The changes to the validate unsigned are here to reflect more
detailed error messages at failure with the costum error
instead of the misleading 'BadProof' return value.

Furthermore, this fixes an issue, where somebody could have a
signature of any parachain-relay-chain account and then use
a proof of any other relay-chain contribution to gain those
rewards.

* Enable claim_reward calls

* Remove indicator for claim failures

* Epoch execution (#485)

* Epoch execution phase 1

This is the beginning of epoch execution. It updates tranche state and
stores the execution results, but since token pricing is not yet
implemented it cannot do rebalancing or other bits like that.

* Epoch close pricing calculation

This now calculates a price (including dripping
interest) for the tranches at epoch close.

There are other locations where dripping interest needs to occur, to
come in further commits.

* Store additional state at epoch close

In addition to the per-tranche supply/redeem targets for an epoch, we
now also store the nav, reserve, per-tranche price, and per-tranche
total value at the time of close.

* Update epoch validation tests for new epoch storage model

* Implement tranche rebalancing during epoch execution

This also includes a new `fake_nav` to make testing easier

* Track tranche debt/balance amounts in borrow/repay fns

* Account for updated tranche value in epoch validity

* Fixes for epoch execution / rebalancing

* Epoch execution testing

* Use a less-bad pow() impl for calculating interest

* Avoid rounding issues when round-tripping between currencies

* Use investor pallet as reserve source for loan pallet

* Use Loan pallet as NAV source for investor pool

Co-authored-by: Miguel Hervas <miguel.hervas.lazaro@gmail.com>
Co-authored-by: Vedhavyas Singareddi <vedhavyas.singareddi@gmail.com>
Co-authored-by: Frederik Schulz <mustermeiszer@posteo.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants