If we don't receive a message from BitMex within 5 seconds, we ping
them to let them know that we are still using this connection. This
avoids the constant dis/reconnects that we have been seeing.
To make boot-up of the system easier, we want allow for a state where
we do not yet have a quote available.
Allow the quote in the projection to be optional and fallback to `None`
for profit calculation.
In case we fail to calculate the profit or this data is otherwise not
available, we still want to display as much as possible and only
blank out the data we cannot compute.
818: Improve closing Cfd message in the taker UI r=klochowicz a=klochowicz
- Present the timestamp in human-readable format instead of Unix time,
- use lowercase action name
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
814: Allow maker to control lock and commit transaction fee rate r=luckysori a=bonomat
resolves#677
Temporarily we also use the same fee rate as for the tx_lock for tx_commit. With #491 this should go away again.
Co-authored-by: luckysori <l.soriano.del.pino@gmail.com>
805: Add a disclaimer on taker startup r=klochowicz a=klochowicz
Display a modal pop-up that goes away when it gets acknowledged.
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
BDK's database only acts as a cache and can always be fully restored
by deleting it. With an Electrum backend, syncing is very quick meaning
the local cache basically does not serve any purpose. We've been having
troubles with BDK's database being broken due to internal inconsistency
problems. Switching to an in-memory database should fix these because
a restart of the application essentially wipes the database.
Resolves#465.
Implying `Sync` as part of withdraw allows us to remove the `Sync`
from the startup of the application which avoids an error case in
case we cannot find a particular transaction.
In case the wallet sync fails, we replace the value with `None` to
indicate to the UI that we don't have an up-to-date wallet information.
In case the sync works again at some point, we will replace it with
`Some` again.
Making this optional also allows us to start up the system without
syncing the wallet, a step towards https://github.com/itchysats/itchysats/discussions/753.
796: Introduce short-lived `rollover_taker::Actor` r=luckysori a=luckysori
Very similar to the other ones we've done.
Things to consider:
- Shall we consolidate the usage of "rollover" over "roll over" across the entire codebase? I don't think I have been able to stay consistent even in this PR :(
- I've added an `OrderId` to the `wire::MakerToTaker::ConfirmRollOver` message, because the maker could be talking about more than one rollover.
- The `taker_cfd::Actor` no longer handles the raw `wire::MakerToTaker` enumeration of messages 🎉 After creating all these short-lived actors it only needs to handle a dedicated `CurrentOrder` message originating from the maker.
- Error handling is worth reviewing in detail as I've messed that up in previous related PRs.
Co-authored-by: Lucas Soriano del Pino <l.soriano.del.pino@gmail.com>
802: Settle CFDs every 2h r=bonomat a=bonomat
Temporarily reduce the settlement interval to 2h to accelerate testing.
Co-authored-by: bonomat <philipp@hoenisch.at>
789: Simplify wallet actor r=thomaseizinger a=thomaseizinger
We don't need to `Clone` the wallet actor ever so we can remove this
custom derive which allows us to also drop the `Arc<Mutex>` of the
`bdk::Wallet`, thus simplifying all of the handlers quite a bit.
We also add `&mut` to all handlers. Even though not strictly necessary
(because they are processed by `xtra-productivity`), it is more correct
to write `&mut self` because that is what the macro will output anyway.
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
795: Allow projection actor to retrieve latest Cfd state itself from DB r=klochowicz a=klochowicz
Instead of retrieving Cfds inside Cfd actors, send a msg that they changed and
retrieve them by the projection actor itself.
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
This should prevent accidential double-spends of our own inputs
when doing concurrent contract setups or other interactions of the
wallet.
We only store these in-memory, thus a simple restart of the application
will "unlock" a UTXO in case it was previously marked used but the
transaction never made it to the blockchain for whatever reason.
Resolves#790.
We don't need to `Clone` the wallet actor ever so we can remove this
custom derive which allows us to also drop the `Arc<Mutex>` of the
`bdk::Wallet`, thus simplifying all of the handlers quite a bit.
We also add `&mut` to all handlers. Even though not strictly necessary
(because they are processed by `xtra-productivity`), it is more correct
to write `&mut self` because that is what the macro will output anyway.
786: Introduce `cargo dev-maker` and `cargo dev-taker` aliases for easier local development r=thomaseizinger a=thomaseizinger
We have some duplication of how to run the development maker and taker locally.
Use cargo aliases to clean up this duplication and make it easier to run them outside of the `start_all.sh` script.
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
792: Update README r=klochowicz a=klochowicz
Refer to the commits' descriptions for more info
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
794: Release version 0.2.0 r=da-kami a=itchymax
Hi `@da-kami!`
This PR was created in response to a manual trigger of the release workflow here: https://github.com/itchysats/itchysats/actions/runs/1533991015.
I've bumped the versions in the manifest files in this commit: 88f64a0bba.
Merging this PR will create a GitHub release and publish the library to crates.io!
Co-authored-by: itchymax <itchymax@protonmail.com>