Christian Kamm
255c6fb138
Fee buyback: Limit MNGO price by stable price ( #485 )
...
This makes it much harder to temporarily manipulate the MNGO price to
get a more favorable buyback deal.
2023-03-01 09:58:47 +01:00
microwavedcola1
c48d9c94d9
Fix types
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-28 15:04:28 +01:00
microwavedcola1
07c46d0129
Revert "fix account in client ix"
...
This reverts commit 1343e70cc6
.
2023-02-28 14:46:22 +01:00
microwavedcola1
1343e70cc6
fix account in client ix
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-28 14:45:25 +01:00
microwavedcola1
73b626efff
ts client for max buyback of fees with mngo ( #480 )
...
* ts client for max buyback of fees with mngo
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
---------
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-28 12:05:02 +01:00
Christian Kamm
46c79af430
Security admin: Allow disabling token/perp init collateral ( #482 )
...
This allows the security council to say "users can't create new borrows
against this token/perp anymore". In some emergency situations this can
help reduce risk exposure.
For example, if the price of a wrapped asset permanently depegs from
its underlying or there is a successful long-term attack on an oracle,
this (and reduce-only) would significantly reduce exploitability until
the DAO's decision for how to resolve the issue goes through.
2023-02-28 11:49:07 +01:00
Christian Kamm
df4a7b0474
Fees buyback: Credit users for ui part of serum fees ( #481 )
...
At least for markets with USDC quote currency.
2023-02-28 09:48:15 +01:00
Christian Kamm
9a13c1366a
Fee buyback: Credit only perp fees that go to the dao ( #479 )
2023-02-27 19:51:09 +01:00
microwavedcola1
16599dd506
admins can also register trustless tokens ( #477 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-27 16:37:57 +01:00
Christian Kamm
e4d46c3c5b
Buyback fees: Add staggered expiry ( #478 )
2023-02-27 16:36:27 +01:00
microwavedcola1
25d94b0e7b
Fix idl
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-27 08:49:43 +01:00
microwavedcola1
d88d44b34a
buyback perp fees with mngo at a discount ( #464 )
...
buyback perp fees with mngo
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-25 20:34:16 +01:00
Christian Kamm
5c7a2e3e10
Use the overflow-checks=true equivalent with the fixed crate ( #476 )
...
* Vendor `fixed` crate to have checked math in release mode
* remove all cm!()
* drop superfluous parens
* drop use of checked_math crate
* manual removal of redundant checked_* functions
2023-02-24 11:56:33 +01:00
microwavedcola1
330739364f
ts: add function on perp position to get notional value ( #474 )
...
* ts: add function on perp position to get notional value
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
---------
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-24 10:43:37 +01:00
microwavedcola1
3fe008da8b
Fix extraction of amount for token account and mm Procfile
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-22 15:08:05 +01:00
Christian Kamm
cfcda705e6
Bump program version to v0.8.0
2023-02-22 14:49:18 +01:00
Christian Kamm
a6c2b964d6
Add program v0.7.0 release info
2023-02-22 14:46:16 +01:00
Christian Kamm
de0f1a7458
Changelog for program v0.7.0 and idl update
2023-02-22 13:34:51 +01:00
Christian Kamm
6c33044e92
Dependency updates for bzip2 and openssl-src ( #475 )
2023-02-22 12:43:22 +01:00
Christian Kamm
f75e3ee656
Serum: Track referrer rebates as Mango platform fees ( #469 )
...
And start sharing code between serum3 settle and force cancel
2023-02-22 12:04:21 +01:00
microwavedcola1
d3c5817a45
Fix mocha runner
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-22 11:19:03 +01:00
microwavedcola1
3ee28126d0
Merge branch 'mc/token-listing-example' into dev
...
--wip-- [skip ci]
2023-02-22 10:45:41 +01:00
microwavedcola1
e5b7b6fdb1
--wip-- [skip ci]
2023-02-22 10:25:22 +01:00
microwavedcola1
9d72ba5612
tsconfig fix for ts-node scripts ( #473 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-22 10:23:50 +01:00
microwavedcola1
15390043c0
--wip-- [skip ci]
2023-02-22 09:49:15 +01:00
microwavedcola1
c0cfc50e7e
--wip-- [skip ci]
2023-02-22 09:49:15 +01:00
microwavedcola1
92560f240f
--wip-- [skip ci]
2023-02-22 09:49:15 +01:00
microwavedcola1
7499d832b3
tsconfig fix for ts-node scripts
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-22 09:48:29 +01:00
microwavedcola1
ae2f74a928
security admin can move openbook market to reduce only ( #472 )
...
* security admin can move openbook market to reduce only
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
---------
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-22 09:24:38 +01:00
tylersssss
4c9f99832f
Update package.json build steps and move js scripts out of src folder ( #470 )
...
* extracts scripts from source; update tsc build configs and packages
* publish latest
* remove type module
2023-02-22 08:36:59 +01:00
tylersssss
f41f2ab337
Ts/client fixes ( #471 )
...
* fix bug with marking perp orders as expired
* support passing in perp books to find mango account orders
* support force reloading of acct perp open orders
* make perp market _bids and _asks public
* dont fetch open order accts if no serum3active
2023-02-22 08:07:06 +01:00
Christian Kamm
5c7f23adb1
Perp place order: more logging for reduce only ( #468 )
2023-02-21 13:14:40 +01:00
microwavedcola1
70b65c5880
Fix more paths
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-21 12:10:21 +01:00
microwavedcola1
0eeda22441
Fix path for docker images
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-21 12:05:07 +01:00
microwavedcola1
ae761c9270
support 32 perp oo by default ( #467 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-21 10:40:15 +01:00
Christian Kamm
7b9e19cc08
Organize paths, rename crates ( #466 )
...
liquidator, keeper, cli and settle-bot moved to bin/
client moved to lib/client
All crates have a "mango-v4-" prefix
2023-02-20 14:08:38 +01:00
Christian Kamm
7a51ce0619
Add a "settle-bot" binary ( #465 )
...
The bot will call settle on all accounts with unsettled pnl where it can
receive either the flat or low-health fee.
2023-02-20 12:09:17 +01:00
microwavedcola1
1cffd75681
Update DEVELOPING.md
2023-02-17 09:48:28 +01:00
microwavedcola1
227b1a4269
keeper: rust client accounts for priority fees already
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-16 16:20:37 +01:00
Christian Kamm
70fb8a6cf5
Liquidator: don't exit immediately ( #463 )
...
But do exit when one of the core jobs exits.
2023-02-16 14:52:39 +01:00
Christian Kamm
6439eb5531
Client: Print the error kind on simulation failure ( #462 )
2023-02-16 10:55:35 +01:00
tylersssss
a87705fa37
fix fillevent type in client ( #460 )
2023-02-16 10:55:12 +01:00
Christian Kamm
07acb0236e
client, liquidator: Cleanups for more code reuse
...
In particular, the liquidation no longer happens in the same thread that
deals with updating accounts. Queues stay smaller now.
2023-02-15 15:12:14 +01:00
Christian Kamm
15b509b353
Client: Move data feeds to client/
2023-02-15 15:12:14 +01:00
Christian Kamm
023d2f96cb
Settle pnl: Don't avoid settlement on being_liquidated accounts
...
The action doesn't decrease health and is already limited by
perp-settle-health, so it's fine to allow. (the instruction already
allows it, this fix is just for finding counterparties)
2023-02-15 15:11:58 +01:00
Christian Kamm
8f9700ed2d
Settle pnl: Always grant the fractional fee on low health
2023-02-15 15:11:58 +01:00
Christian Kamm
a3a6d9d636
Settle pnl: Move fee-computation to PerpMarket
...
So it can be used in client code to decide what accounts to settle.
2023-02-15 15:11:58 +01:00
Christian Kamm
722c5ff10b
Readme: Try to add a licensing summary. ( #456 )
2023-02-15 19:03:29 +09:00
microwavedcola1
a53e1e6daa
keeper fix filter
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-15 09:18:07 +01:00
Christian Kamm
8916c28b99
License: Mark instructions GPLv3 and everything else MIT ( #454 )
...
To do that, split up the Accounts objects and the instruction
implementations.
GPL code is only used when the "enable-gpl" feature is enabled. That
means compiling the program or running tests need explicit feature
activation now.
2023-02-15 08:42:07 +01:00