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

Add v0 technical spec #1

Merged
merged 12 commits into from Feb 3, 2022
Merged

Add v0 technical spec #1

merged 12 commits into from Feb 3, 2022

Conversation

RusseII
Copy link
Contributor

@RusseII RusseII commented Jan 17, 2022

I think we should follow the auditless specification framework to create a more technical protocol specification.

The purpose of this specification will be two fold:

  • Facilitate a common understanding of what needs build & get technical feedback from our advisors
  • Help us focus our learning efforts on work directly relevant to our protocol

https://github.com/porter-finance/litepaper#bond-implementation

spec/overview.md Outdated
}
```
### Methods
`initiateAuction()` The entry-point which is called by a borrower to start the auction process. This function accepts an auction config, bond config, and collateral config. This is because in order to have a valid aucction, all three of these pices must be valid and set when the auction begins as the lenders need to have this information.
Copy link
Contributor

Choose a reason for hiding this comment

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

I was looking at https://ribbon.finance 's contracts (actually ran into one when searching something from the Gnosis Auction), and they interact with Gnosis auction only through what I believe to be the deployed (unchanged) contract. https://github.com/ribbon-finance/ribbon-v2/blob/master/contracts/libraries/GnosisAuction.sol

If we can only wrap the auction that would simplify the surface that we would own, code-wise, and I wonder if there is something important that we would need to change (that isn't configurable).

So in the world that we only are interacting and not changing the gnosis auction code, the flow would look like:

  • Create Bond tokens with configuration
  • Pass in the bond tokens as the _auctioningToken for the auction
  • Return the _auctioningToken at auction end.

For example, if an auctioneer wants to issue a bond for 100m USDC, giving 20m of their token as collateral, a user will bid for 1m USDC and ask for 1.1m worth of bonds.

Copy link
Contributor Author

@RusseII RusseII Feb 1, 2022

Choose a reason for hiding this comment

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

Looks like they are using the Gnosis deployed version

Which means they are paying the 1.5% gnosis auction fee.

So for us - that fee is way too high - we would fork the Gnosis auction and deploy it? Then we can be the owner and change the fee % (or make the fee go to us).

Would we need to not use an upcoming period? https://github.com/porter-finance/product/issues/15

I like the idea of just wrapping the auction and would like to do that if we can.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. I was confused why they used the deployed version. I believe they are paying the fees on it. If we were to use it, I would think deploying it ourselves and being the owner would not be a big deal.

We could use an upcoming period, it would just need to be done on our side. We could take the collateral and not start the actual auction until some period, or we could start the auction with an increased end date, e.g. auctionEndDate = gracePeriod + 1 year, and dis-allow bids via some auctionStarted variable.

- Deployed and minted at successful auction settlement
- The auction contract will check that the configuration exists on that bond contract (external call).
- If that config is validated, the auction config itself will be checked. Length, minimum bid, etc.
- The auction contract will lastly check and store the collateral within the auction contract.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why do you think storing collateral in auction contract makes more sense than the collateral locker?

Copy link
Contributor

Choose a reason for hiding this comment

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

It simplifies things for now. I am not sure what would be best.

- After the predetermined time is up, the auction ends, with all bids recorded.
- The auction is settled, statuses updated to complete, and the winners can claim their order amount.
- Winners pull from their successful orders
- Bidding tokens are pushed to the auctioneer
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why is this push instead of pull?

Copy link
Contributor

Choose a reason for hiding this comment

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

uint96 _minBuyAmount
uint256 minimumBiddingAmountPerOrder
uint256 minFundingThreshold
bool isAtomicClosureAllowed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you understand why anyone would use isAtomicClosureAllowed?

Copy link
Contributor

Choose a reason for hiding this comment

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

I found this

atomic-closure This parameter enables users to close the auction atomically and submit a final bid by calling the settleAuctionAtomically function in the smart contract once the auction-end-date has been reached. The auctioneer determines whether this parameter is on or off by specifying True or False.
This makes sense mainly for tokens with existing liquidity sources and is less suitable for IDOs.

spec/overview.md Outdated Show resolved Hide resolved
Co-authored-by: RusseII <russell@deephire.com>
@RusseII
Copy link
Contributor Author

RusseII commented Feb 3, 2022

Merging in this base - Let's follow up with improvements.

@RusseII RusseII merged commit 4cc7cf8 into main Feb 3, 2022
@Namaskar-1F64F Namaskar-1F64F deleted the add-technical-specification branch February 3, 2022 20:31
@RusseII RusseII mentioned this pull request Apr 1, 2022
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.

None yet

2 participants