-
Notifications
You must be signed in to change notification settings - Fork 23
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
Funding fee feature #2584
Merged
Merged
Funding fee feature #2584
Commits on Jun 4, 2024
-
chore(coordinator): Use the Amount type more often
The `Position` model should be as strongly typed as possible. Converting to i64 should happen _just_ before inserting into the database.
Configuration menu - View commit details
-
Copy full SHA for 8559ae0 - Browse repository at this point
Copy the full SHA 8559ae0View commit details -
chore: Add postgrest-coordinator container to docker-compose.yml
This server can be used during local development to query the coordinator database conveniently e.g. ``` $ curl http://localhost:3002/dlc_protocols | jq . [ { "id": 1, "protocol_id": "fb4c6f27-db9d-4b2d-8539-6e609e1559b9", "previous_protocol_id": null, "channel_id": "f689230c5477176961301cb22093cfd52050a52356812039f9c298fe8859eba2", "contract_id": "972c5fcafbd6bbbf874a9a5cd44d9ddd05a2e3f3ae96d5bd771e5af1b8cae1a6", "protocol_state": "Success", "trader_pubkey": "02e9f7a0e0d6eeab989dcbb4e91f0bf95f583b09d8d324cc9635807e844eea82bc", "timestamp": "2024-05-13T05:32:36.452958+00:00", "protocol_type": "open-channel" } ] ``` It can also be used in the e2e tests to easily assert on the state of the coordinator, without needing to add dedicated HTTP API endpoints. It might even be used to modify the coordinator state to create interesting test scenarios.
Configuration menu - View commit details
-
Copy full SHA for ed34a16 - Browse repository at this point
Copy the full SHA ed34a16View commit details -
feat(coordinator): Apply a funding fee on rollover
The coordinator generates funding fee events as funding rates are added to the database and applies them on rollover. The app displays funding fee events in a dedicated `Trades` tab, together with regular trades. The funding fee events are added as soon as the app learns about them from the coordinator, which is usually before they are resolved. Additionally, the app will update the position after rolling over based on the funding fee events that were resolved with the rollover. Missing bits: - Apply funding fee events on closing and resizing. - Considering funding fee events when deciding if positions need to be liquidated. - Add some unit tests. - Expanding e2e tests. - Add fee rate to app's `Trades` tab. - Display next fee rate in app's `Trade` screen. Co-authored-by: Philipp Hoenisch <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 246db24 - Browse repository at this point
Copy the full SHA 246db24View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4dce214 - Browse repository at this point
Copy the full SHA 4dce214View commit details -
Configuration menu - View commit details
-
Copy full SHA for 596e575 - Browse repository at this point
Copy the full SHA 596e575View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1158e23 - Browse repository at this point
Copy the full SHA 1158e23View commit details -
Configuration menu - View commit details
-
Copy full SHA for dca01ef - Browse repository at this point
Copy the full SHA dca01efView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2544772 - Browse repository at this point
Copy the full SHA 2544772View commit details -
Configuration menu - View commit details
-
Copy full SHA for 305d8b2 - Browse repository at this point
Copy the full SHA 305d8b2View commit details -
chore(app): Rename Positions tab to Position
We only support one position at a time at the moment. Co-authored-by: Richard Holzeis <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c2cdb64 - Browse repository at this point
Copy the full SHA c2cdb64View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a85bee - Browse repository at this point
Copy the full SHA 3a85beeView commit details -
Configuration menu - View commit details
-
Copy full SHA for c8a55a8 - Browse repository at this point
Copy the full SHA c8a55a8View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.