Open mz7mz7mz7 opened 1 year ago
@mz7mz7mz7 what reasons will make a user want to hold only one token over the other? It is my understanding that both tokens will have the same pegged price at this point. correct me if i'm wrong
So @mz7mz7mz7 my reasoning behind this is to create some kind of queue where we can partially match risk on tokens with risk off tokens, so a user will opt in to hold only a particular type of token and after every rebase we want to internally offset this for users that have this flag using the queue. but this will depend on demand and supply, so this has to be communicated to the user in one form or the other. like we can encourage them to always trade either of their tokens manually using the exchange but can market this as an experimental feature.
we can also automatically settle open orders with token of users that have this flag. eg User A wants to hold only risk off tokens, and we were able to only partially fill 50% of their risk on tokens, if user B opens an order to sell their risk off token we can automatically match this with user A risk on tokens
POC for matching orders internally on our smart contract and look into 0x creating orders and matching in bulk
Let's build a prototype/proof of concept with our current smart contracts as a base that would utilize CoW smart orders to execute rebalancing after rebase. Article: https://cow-protocol.medium.com/tutorial-creating-smart-orders-on-cow-protocol-683a5f9f4763 The article is using the old framework, the new one is here: https://github.com/rndlabs/composable-cow Long live coding session on it which was recorded here: https://youtu.be/5lbnMPqfXho Here are the different smart order types that already exist: https://github.com/rndlabs/composable-cow/tree/main/src/types Standard: https://eips.ethereum.org/EIPS/eip-1271 Docs: https://docs.cow.fi/tutorials/how-to-place-erc-1271-smart-contract-orders
We have also shared a Slack channel with the CoW team if we need to raise any questions, it's called 'cow-riskprotocol'.
0X: @mz7mz7mz7 Can unlimited orders be created by user?
Can fill multiple orders in a single transaction?
In regards to 2nd point: filling multiple orders in one tx, I was referring to these functions @haidarally :
https://etherscan.io/address/0x61935cbdd02287b511119ddb11aeb42f1593b7ef#writeProxyContract
And as for both of these points -- can we actually developed simple PoC, in the form of unit test or command line app, whatever is simpler, and just try to do what we discussed:
@mz7mz7mz7
As discussed, the batchFillLimitOrders
method doesnot seem to be present in the v4. Waiting for some clarifications from 0x.
@mz7mz7mz7 The composable cow frameworks actually works in the following manner
TradeAboveCertainThreshold
safe
with extensiveFallBackHandler
https://hackmd.io/-nLuF3JIRyuS5w864_mbrgcomposable-cow
to respond whenever there is the need for a erc1271 signaturecomposable-cow
Composable cow will emit an event ConditionalOrderCreated
, which will be picked up by WatchTowers and processed when matured.
https://goerli.etherscan.io/tx/0xbfd3646030f2525714584df5b64d6e1198cf716d5b1bdc243860bf8b0ef3e6d9#eventlogI think for the part where users need to modify their safe, we should be able to permit them to do so on our dApp using thehttps://www.npmjs.com/package/@safe-global/safe-core-sdk
or other sdks
Notes: 2nd Audit still in progress For added info: https://forum.cow.fi/t/automated-treasury-management-methodology/1799 https://www.youtube.com/watch?v=5lbnMPqfXho&ab_channel=CoWSwap
@mz7mz7mz7 As discussed, the
batchFillLimitOrders
method doesnot seem to be present in the v4. Waiting for some clarifications from 0x. @mz7mz7mz7
0x Poc works PR: https://github.com/RiskProtocol/rebalance-poc-0x/pull/1 Cons: We have to pay the gas fees
Flow: User has to create a very big order( maximum of uint128) , sign the order and submit both objects to us User has to approve the exchange contract. Then we fill the orders as many time as required Same order filled twice below https://polygonscan.com/tx/0xd3b548a4d174f12ef3813740d50c8a0e8c6ca590233a674c59eb0f1f9b2a34ca https://polygonscan.com/tx/0x8936b495fbcddb6cd93250884cfa29be2bd5e737ef580dfe3460740d5ea5a60b
Updates:
-- Let USDC be RiskOFF -- Let COW be RiskON -- Assume that after every rebase
Demonstration
Hi all, looks like something interesting in the works here. If you need some help from a CoW Protocol side, reach out to us in #tech-talk on discord :smiley:
Ie user had only token X before rebase. After rebase they would have some token X and some token Y. But let's assume they want to hold only token X. How we can automatically do it for them after the rebase?
Some ideas:
@jiokeokwuosa , @Tunji17 -- any other ideas?