-
Notifications
You must be signed in to change notification settings - Fork 4
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
Updates for RC4 contracts and other improvements #16
Conversation
…en handling take/settle
@@ -8,7 +8,7 @@ | |||
"deploy": "graph deploy --node https://api.studio.thegraph.com/deploy/ ajna", | |||
"create-local": "graph create --node http://localhost:8020/ ajna", | |||
"remove-local": "graph remove --node http://localhost:8020/ ajna", | |||
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 ajna", | |||
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 ajna -l rc4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This arg sets the tag, making deployment non-interactive. Extremely helpful for fix/build/deploy test cycle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement, makes sense.
# updated upon ApproveLpTransferors and RevokeLpTransferors | ||
type LPTransferors @entity { | ||
# LP transferors approved by a lender for a pool, updated upon Approve/RevokeLpTransferors | ||
type LPTransferorList @entity { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plural entity name caused a bug trying to query the autogenerated collection.
… operations in LiquidationAuction
pool.poolSize = wadToDecimal(poolLoansInfo.poolSize) | ||
pool.loansCount = poolLoansInfo.loansCount | ||
pool.maxBorrower = poolLoansInfo.maxBorrower | ||
pool.inflator = wadToDecimal(poolLoansInfo.pendingInflator) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this also be setting inflatorLastUpdate
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but we can't get it without adding a call to Pool.inflatorInfo
. We could assume it changes with every pool action instead of most pool actions, and pass block height as an argument. But due to the limited utility, I think I'd rather remove it from the entity. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well isn't it useful for knowing when interest rates will change? Might be important for determining plans
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the inflator is decoupled from the rate update. Inflator updates with most pool interactions. Interest rate updates every 12 hours or more, depending on MAU and TU.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in 8d343ce.
src/utils/constants.ts
Outdated
export const ZERO_BI = BigInt.zero() | ||
export const ONE_BI = BigInt.fromI32(1) | ||
export const TEN_BI = BigInt.fromI32(10) | ||
export const ONE_RAY_BI = BigInt.fromString("1000000000000000000000000000") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can remove ONE_RAY_BI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 8d343ce.
@@ -217,7 +225,7 @@ export function mintPosition(lender: Address, pool: Address, tokenId: BigInt, to | |||
handleMint(newMintEvent) | |||
} | |||
|
|||
export function assertPosition(lender: Address, pool: Address, tokenId: BigInt, tokenContractAddress: Address): void { | |||
export function assertPosition(lender: Address, pool: Address, tokenId: BigInt, tokenContractAddress: Address): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extra spacing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 8d343ce.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
RC4 changes
DecreaseLPAllowance
.MoveLiquidity
event emits LP amounts.Flashloan
event and track total amount of quote token/collateral flashloaned in each pool.ResetInterestRate
event.auctionStatus
PoolInfoUtils to get auction prices, which were unavailable in RC3.Bug fixes
AuctionSettle
event was not saving updates toLiquidationAuction
entity.Other improvements
Bucket
entity, as requested by BlockAnalytica. Using a local JSON price file to do the conversion.interestRate
withborrowRate
andlendRate
after introducing a way to query lender interest margin.Pool
and some liquidation auction entities for improved DX.