Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@blockworks-foundation/mango-v4
Advanced tools
work in progress
See the LICENSE file.
The majority of this repo is MIT licensed, but some parts needed for compiling the solana program are under GPL.
All GPL code is gated behind the enable-gpl
feature. If you use the mango-v4
crate as a dependency with the client
or cpi
features, you use only MIT
parts of it.
The intention is for you to be able to depend on the mango-v4
crate for
building closed-source tools and integrations, including other solana programs
that call into the mango program.
But deriving a solana program with similar functionality to the mango program from this codebase would require the changes and improvements to stay publicly available under GPL.
See DEVELOPING.md
After cloning this repo you'll need to init and update its git submodules.
Consider setting the git option submodule.recurse=true
.
For program deployment, see RELEASING.md.
Here are steps followed while performing a npm package release note: the UI currently uses code directly from github, pointing to the ts-client branch
yarn publish
to release a new package, ensure compatibility with program release to mainnet-betafix-npm-tag.sh
, tags should look like this e.g.npm-v0.0.1
, note: the npm package version/tag should not necessarily match the latest program deploymentv0.17.0, 2023-7-3
Deployment: Jul 3, 2023 at 09:46:14 Central European Summer Time, https://explorer.solana.com/tx/4G6b1uihopkHqp968sq3RYacYHn5ND8mMmeNd1RfswTCmiqeappTN2747JTvswVXxs7oqgfU6M3VKPGVRFPGJYuL
Configurable perp market settle token (#550)
This changes perp market margining to no longer assume all pnl is in USD while settlement is in USDC. Instead, a configurable settle token is used for pnl and settlement, defaulting to USDC.
There is no difference while the USDC price is forced to $1 and its init and liab weights are 1. But with this patch, it becomes possible to change that.
For now it is not recommended to use a token other than USDC or USDT (or another USD targeting stable token) for perp settlement.
The patch also updates all instructions dealing with the insurance vault to be aware that the insurance fund is not in USD but in USDC and apply the USDC price before payouts. To do this, the previous PerpLiqNegativePnlOrBankruptcy was replaced by a new PerpLiqNegativePnlOrBankruptcyV2 instruction.
Allow reduce-only actions when init health is low (#592)
Previously when init health was negative, the program only allowed actions that increased init health. Now it also accepts actions that keep init health the same.
This is helpful for users because they now can place reducing limit orders on the spot or perp orderbooks while their account has low health.
Whitelist PerpPlaceOrderV2 and PerpPlaceOrderPeggedV2 for HealthRegions (#597)
Improve logging of loans (#599, #603)
Pyth oracle status is checked (#607)
Fixes to the inactive fee buyback feature (#608)
Fix token force close to respect the reduce-only flag (#613)
Improve docs (#590, #594)
Use workspace dependencies (#588)
FAQs
Typescript Client for mango-v4 program.
The npm package @blockworks-foundation/mango-v4 receives a total of 386 weekly downloads. As such, @blockworks-foundation/mango-v4 popularity was classified as not popular.
We found that @blockworks-foundation/mango-v4 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.