astariaxyz / astaria-core Goto Github PK
View Code? Open in Web Editor NEWNFT Collateralized Lending Market leveraging our novel 3 Actor Model
Home Page: https://astaria.xyz
License: Other
NFT Collateralized Lending Market leveraging our novel 3 Actor Model
Home Page: https://astaria.xyz
License: Other
The system will need a helper contract that can allow users to validate a loan at the time of the purchase so the user pays a lower price
The purpose of this test is to ensure that a non-delegate/non-strategist is incapable of incrementing a PublicVault
nonce
The purpose of this test is to ensure the strategist is capable of incrementing a PublicVault
nonce
The purpose of this test is to shake out rounding errors when incrementing and decrementing the slope. Currently there is a rounding error when incrementing and decrementing PublicVault slope.
The purpose of this test is to test the LPs joining, then all LPs withdraw from the vault. Assertion is to show that the LP shares in the next epoch mint the. correct amount.
The purpose of this test is to ensure that makePayment() flow is blocked off after liquidation.
new PublicVault
new LP
commitToLien()
attempt flash action as borrower
assert that collateraltoken is the owner of the underlying asset
new PublicVault
new LP
commitToLien()
attempt flash action as borrower
attempt to modify the state of the v3 position
assert reversion on modification
Any instance to merklization or signing needs to be replaced in the test suite with astaria-sdk
The purpose of this test is to ensure the borrower cannot take out a new lien with a duration of zero. Since a new lien with duration of zero would put the borrower instantly in liquidation.
Create scenario where the collateral is liquidated
what if expected is exactly equal to totalAssets()
astaria-core/src/PublicVault.sol
Line 271 in c744bb4
I don't know what happens in the case of the liquidator, but we should probably asset their balance as well
The purpose of this test is to ensure the delegate is capable of incrementing a PublicVault
nonce
The purpose of these two tests is to ensure that the signature test is correct. If an ecrecover
is returned with the address of strategist
or delegate
the test should succeed.
test 1
strategist
wallet ecrecover(signature)
should the strategist
addresstest 2
delegate
wallet ecrecover(signature)
should the delegate
addressLots of undocumented new functions/outdated natspec for old functions, should patch up before audit
The purpose of this test is to ensure that the all parties are properly repaid in the event of a lien buyout
<- interest accrued
+ (1.5 * (9/365) * 10 * 0.1 ) <- buyout (use wad math)
buyoutAmount
buyoutAmount
buyoutAmount
buyout
The goal of this test is to put the LiquidationAccountant into a hung state where a liquidation that occurred was claimed and the second liquidation could not be claimed.
The purpose of this test is to ensure that a borrower cannot borrow more than the specified lien.amount.
Validate revert for liquidationInitialAsk
< amount borrowed
Validate revert for liquidationInitialAsk
== 0
The purpose of this test is to ensure that a borrower can take out a lien of an amount lower than lien.amount.
amount.mulDivDown(lienDetails.rate, 1e18);
The purpose of this test is to ensure that a correct merkle branch presented to commitToLien() results in a new lien.
amount.mulDivDown(lienDetails.rate, 1e18);
Underlying NFTs for CollateralTokens
will appear in the OpenSea UI like the other NFTs in the same collection using a Timed Auction
LienDetails will have an additional field uint256: liquidationInitialAsk
a wad value 1e^18 in WETH. It will represent the starting price for the timed auction in the event of liquidation.
When a liquidation is initiated where there are multiple liens in the LienStack
for the same CollateralToken
liquidationInitialAsk
of LienStack[0]
will be used as the starting price.
Timed Auctions will begin at block.timestamp
of the liquidation transaction and will go until block.timestamp + 3 days
, or until a single bid is made. Price will start at liquidationInitialAsk
descending to 0
over 3 days
.
If a bid is made the auction ends immediately and all liens are either settled, partially settled, or unsettled before going to deletion.
If no bid is made a call (by anyone) that transfers the NFT to the liquidator and all liens remain unsettled before going to deletion.
The purpose of this test is to test that the finalActuionEnd()
value in the withdraw proxy is being set into the future
Strategists can call shutdown()
, this is a one way event which disables new deposits and new loan origination, leaving withdraw as the only choice for depositors.
Exit flow's remain unaffected.
Submodule cannot install and the CI is failing. Fix the CI so that CI runs on any new branch an is blocking for merge on develop or master.
liquidate()
in NFTBondController
needs to be madeAs an open research question, can we make Loan structs into a merklelizable value that requires us to only store a single bytes32 value.
This would require the user each time to submit a merkle proof to validate data and has data availability considerations. However, each clean slot of storage for each loan costs 20,000 gas where a merkle tree requires 638 for each order of the tree. This could significantly reduce thee gas profile without risking security.
As stated before this has data availability implications.
https://ethereum.org/se/developers/tutorials/merkle-proofs-for-offline-data-integrity/
The purpose of this test is to ensure that the all parties are properly repaid in the event of a lien buyout
<- interest accrued
+ (1.5 * (9/365) * 10 * 0.1 ) <- buyout (use wad math)
buyoutAmount
buyoutAmount
buyoutAmount
buyout
Ensure that there is sufficient checks to prevent abuse on buyout and commit to liens for adding liens against another valid stack.
If account
is a PrivateVault
txn will revert
astaria-core/src/LienToken.sol
Line 800 in ea5d5bd
s.ASTARIA_ROUTER.isValidVault(account) &&
IPublicVault(account).supportsInterface(type(IPublicVault).interfaceId);
Assert that the new lien cannot exceed current epoch
Root signing is currently done outside of the astaria-sdk. Utilize the methods from astaria-sdk to ensure correct root signing in both instances
Our current || check means that rate or duration can get worse, change to &&. Maybe allow one to stay the same if the other improves?
Wrapper contract needs to conform to ERC721 interfaces with additional functionality:
The purpose of these two tests is to ensure that the signature test is correct. Is an ecrecover
is returned with address(0)
or an alternate address.
test 1
ecrecover(signature)
should return address(0)
test 2
ecrecover(signature)
should return an address that is neither the delegate
or the strategist
The purpose of this test is to ensure that a lien with a rate of zero cannot be initiated. This check is necessary because later in liquidation a lien.rate of 0 is an indication the lien is being liquidated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.