Commit Graph

128 Commits

Author SHA1 Message Date
Christian Kamm 8fd7a5cc88 Merge deploy into dev 2024-04-23 11:00:25 +02:00
Christian Kamm d08ef26a99
rust client: rename Client::owner to "authority" (#948)
It could be the owner or the delegate
2024-04-22 14:52:36 +02:00
Christian Kamm 66c6ae1cff liquidator: fix rebalance loops
selling 100% with flash loan swap fee charged on top meant creating a
borrow
2024-04-22 14:10:01 +02:00
Serge Farny bf0d748d2d
Serge/deploy v24+ (#945)
* liquidator: randomly select token/perps for rebalancing to avoid failing at every try if one token is having an issue (#921)

(cherry picked from commit e3a7ed9e32)

* liquidator: do not panic if token or perp rebalancing fails (#927)

(cherry picked from commit 0b7e62e671)

* Liquidator: add Sanctum swap (#919)

liquidator: add sanctum swap
(cherry picked from commit 01d5237162)

* liquidator: add more LST for sanctum swap (#944)

(cherry picked from commit c0b61b3b37)
2024-04-22 13:27:15 +02:00
riordanp 2a6532f1c6
Openbook V2 Integration (#836)
Co-authored-by: Tyler <tjshipe@gmail.com>
Co-authored-by: Christian Kamm <mail@ckamm.de>
Co-authored-by: Serge Farny <serge.farny@gmail.com>
Co-authored-by: microwavedcola1 <microwavedcola@gmail.com>
2024-04-22 11:37:53 +02:00
microwavedcola1 fb6311e842 Merge branch 'main' into deploy 2024-04-18 15:15:44 +02:00
Serge Farny d0125e9fdf
liquidator: rebalance with openbook (limit order) (#938)
liquidator: rebalance with limit order
2024-04-10 16:47:45 +02:00
Serge Farny 01d5237162
Liquidator: add Sanctum swap (#919)
liquidator: add sanctum swap
2024-04-10 11:35:56 +02:00
Serge Farny e090104c69
keeper: add CU estimate for perp update funding, perp consume events and token update index & rates (#937) 2024-04-09 10:50:35 +02:00
Christian Kamm fa32449feb
liquidator: track fallback oracles (#931) 2024-04-04 11:23:58 +02:00
Serge Farny fbea22612e service-mango-health: use jemalloc (#922)
(cherry picked from commit ceeac9d3a4)
2024-04-04 09:35:33 +02:00
Serge Farny abeb14c17f service-mango-health: add config for snapshot interval (reduce memory pressure)
(cherry picked from commit 78ea5e220cc032d6a280b0f3c66cb94051da3267)
2024-04-04 09:35:33 +02:00
Serge Farny bf6d2a11ec liquidator: forcefully exit process if snapshot job die (#924)
* liquidator: forcefully exit process if snapshot job die

* client: return snapshot_job join handle so it can be watched for early unexpected exit

(cherry picked from commit 2520c7d095)
2024-04-04 09:28:48 +02:00
Serge Farny e38798ed0c
liquidator: add a sequence check in rebalancing (#926)
liquidator: add a sequence check in rebalancing
2024-04-03 11:55:04 +02:00
Christian Kamm c2544d9bbd
keeper: fix all confirmation reporting to be on success (#930) 2024-04-03 11:39:00 +02:00
Christian Kamm 3937590fd1
liquidator: fix withdraws on rebalance (#929)
- always allow them, now that v0.22 is deployed and delegates can
  withdraw small token amounts to the owner's ata
- increase the dust amount to $0.001 to avoid issues where the logic is
  a few lamports off
2024-04-02 14:44:04 +02:00
Christian Kamm 8108b31ff9
keeper: report confirmation times only on success (#928)
reporting a "confirmation time" on an error response made the metrics
confusing
2024-04-02 14:43:49 +02:00
Serge Farny 2520c7d095
liquidator: forcefully exit process if snapshot job die (#924)
* liquidator: forcefully exit process if snapshot job die

* client: return snapshot_job join handle so it can be watched for early unexpected exit
2024-04-01 14:45:01 +02:00
Serge Farny 0b7e62e671
liquidator: do not panic if token or perp rebalancing fails (#927) 2024-04-01 10:30:49 +02:00
Serge Farny e3a7ed9e32
liquidator: randomly select token/perps for rebalancing to avoid failing at every try if one token is having an issue (#921) 2024-03-27 14:07:32 +01:00
Serge Farny ceeac9d3a4
service-mango-health: use jemalloc (#922) 2024-03-27 14:07:13 +01:00
Serge Farny f54bb6f0b0
Serge/liquidator split tcs and liquidation (#914)
liquidator: split TCS triggering and liquidation job

Concurrent execution of candidate lookup and tx building/sending
- Also added an health assertion IX to protect liqor in multi liquidation scenario
- And a timeout for jupiter v6 queries (avoid blocking liquidation because of slow TCS)
2024-03-20 15:25:52 +01:00
Christian Kamm 6f85dfa42d Merge remote-tracking branch 'origin/deploy' into dev 2024-03-14 11:26:33 +01:00
Christian Kamm 4ea7c531ef
liquidator: make alternate routes configurable (#916) 2024-03-13 09:13:07 +01:00
Christian Kamm c2398d1abe Fix service-mango-health build after bad merge resolution 2024-03-13 09:00:52 +01:00
Christian Kamm 2cd4376466
cli: save-snapshot also captures alts (#912) 2024-03-11 15:08:25 +01:00
microwavedcola1 f2442428b6 Merge branch 'main' into deploy 2024-03-10 14:26:29 +01:00
Serge Farny 81f05b32c7
service-mango-health: add config for snapshot interval (reduce memory pressure) (#906) 2024-03-07 11:44:46 +01:00
Serge Farny 5affbb9cee
liquidator: add some latency metrics (#904)
liquidator: add some latency metrics
2024-03-07 11:44:23 +01:00
Christian Kamm 27ecc14000 Merge tag 'program-v0.22.0' into deploy 2024-03-04 11:32:42 +01:00
Serge Farny a6ed29b5a1 service-mango-health: read env variable for more configuration entries (#901)
(cherry picked from commit af9b21c430)
2024-03-01 17:08:33 +01:00
Serge Farny af9b21c430
service-mango-health: read env variable for more configuration entries (#901) 2024-03-01 17:07:49 +01:00
Serge Farny 5629017a8a service-mango-health: fix format 2024-03-01 11:44:06 +01:00
Serge Farny a06801db5c service-mango-health: monitors/historizes accounts health (#890)
* service-mango-health:  add a new service that compute health for all mango accounts and persist an history in postgres sql

(cherry picked from commit 6aa8a883f4)
2024-03-01 11:24:56 +01:00
Serge Farny 6aa8a883f4
service-mango-health: monitors/historizes accounts health (#890)
* service-mango-health:  add a new service that compute health for all mango accounts and persist an history in postgres sql
2024-02-29 17:05:29 +01:00
Christian Kamm 54674e4b20 keeper: fix tx size limits on charge collateral fee batching 2024-02-26 09:21:53 +01:00
Christian Kamm d9f55c4c22 keeper: cu limit when batching charge_collateral_fee ix 2024-02-24 10:04:30 +01:00
Serge Farny ab8393b52d
liquidator: avoid logging same oracle error (same token) in loop (#889)
* liquidator: avoid logging same oracle error (same token) in loop
2024-02-21 16:35:28 +01:00
Serge Farny 338a9cb7b8
liquidator: add allow/forbid token list (#883)
liquidator: add a way to restrict token accepted by the liquidator 

- add allow/forbid list of token for liquidation & conditional token swap triggering
- add allow/forbid list for perp market liquidation
- housekeeping: extract cli args to a dedicated file
- move more hardcoded thing to config and stop using token name (replace with token index)
2024-02-19 10:20:12 +01:00
Serge Farny 5d29eb2f0b
Rust client: auto close spot account if needed to place a new order (#877)
rust client: 
- add serum3 place order to command
- add serum3 create open orders command
- add serum3 close open orders command
- auto create serum3 open orders if needed when placing a new order
- auto close serum3 slot if needed when placing a new order & also close unused token if needed to place a serum3 order
2024-02-16 14:01:18 +01:00
Serge Farny 7a8d46e362
rust client: remove jupiter v4 (#879)
* rust client: remove jupiter v4

* rust client: remove dead code

* rust client: allow large enum variant for RawQuote enum
2024-02-14 14:20:23 +01:00
Christian Kamm 3993a3fa66
collateral fees: fixes after devnet test (#880) 2024-02-14 11:32:57 +01:00
Christian Kamm e57dcdc2a9
Add collateral fees (#868)
- New permissionless instruction to regularly charge collateral fees
- Bank and group configuration to set rate and interval
- Keeper addition to call the instruction
2024-02-13 12:39:28 +01:00
Christian Kamm 007cf0da6e
liquidator: make tcs max amount configurable (#874) 2024-02-09 11:31:37 +01:00
Serge Farny 08a5ee8f53
rust client: Perp - Auto close account when needed (#875)
* perp: auto close perp market account when needing to open a new one with no slot available

* rust_client: do not send health accounts when deactivating a perp position (not needed on program side)

* rust_client: add perp place order command
2024-02-09 11:19:52 +01:00
Christian Kamm b5d49381ed rust clippy fix 2024-02-09 09:09:42 +01:00
Christian Kamm 0380b3f097 Settler: Keep going on error (#873)
in particular: don't panic when a health cache can't be constructed

(cherry picked from commit 712a2e3bd6)
2024-02-07 14:18:29 +01:00
Christian Kamm ea91d9d353
rust client: optionally derive prio fees from feed (#866)
This allows connecting to a lite-rpc feed to receive block priority
updates and computing recently good priority fee values based on that.
2024-02-07 12:52:32 +01:00
Christian Kamm d9a9c7d664
liquidation: Add flag to disable asset liquidation (#867)
This can be used to remove the oracle dependency for tokens with zero maint asset
weight that are not borrowable.
2024-02-07 12:52:01 +01:00
Christian Kamm 712a2e3bd6
Settler: Keep going on error (#873)
in particular: don't panic when a health cache can't be constructed
2024-02-07 12:50:35 +01:00