Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@perennial/order
Advanced tools
Trigger Orders allow users to submit an order to increase or decrease a position when the market price moves above or below a user-chosen limit price. This is accomplished by storing the trigger order onchain, and allowing keepers to execute trigger orders whose entry conditions have been met.
A single Manager is created for each Perennial deployment, accompianied by an OrderVerifier
contract to handle signed messages. Users add the Manager as an operator for their account. Trigger Orders are only compatible with markets which use DSU as collateral.
For executing orders and handling signed messages, keepers are compensated from the market in which the order was placed.
All operations may be performed in a gasless manner using signed messages. Users must first deposit collateral into the market in which they wish to interact. This can be done directly or through an extension like Collateral Accounts.
contracts/types/TriggerOrder
documentation for details.placeOrder
directly on the Manager
, or sign and send a PlaceOrderAction
message to a relayer.placeOrder
or send a PlaceOrderAction
using the same order nonce as the unexecuted order you wish to replace. This will overwrite the unexecuted order in storage.PlaceOrderAction
message was handled, call cancelOrder
directly on the Manager
, or sign and send a CancelOrderAction
message to a relayer.OrderVerifier
contract.Message domain should be set to the Manager
contract address.
Note the message nonce works independently from the order nonce. If you choose to set message nonce equal to order nonce, you'll need a different scheme to assign nonces to cancellation and replacement messages. For example, you could use a serial order/message nonce, incrementing from 0. But for non-placement messages, you could decrement the serial nonce from type(uint256).max
.
Nonces are hashed into each request to ensure the same signed action cannot be replayed. Two types of nonces are specified in every message:
The group nonce may be used to atomically cancel multiple actions. Let's explore a few use cases:
Keepers should:
checkOrder
facility which may be called offchain prior to executing. Alternatively, keeper can use a transaction simulation API to confirm the execution will be successful and ensure they will be paid appropriately for transacting.Manager_Arbitrum
and Verifier
will be deployed to the target chain.
Before running any command, make sure to install dependencies. Run this in the root workspace as well to capture package patches:
$ yarn
Compile the smart contracts with Hardhat:
$ yarn compile
This also generates the Typechain types.
Run the Mocha tests:
$ yarn test
$ yarn test:integration
Unit (not integration) tests for this extension are expected to have 100% coverage. To check test coverage:
$ yarn coverage
$ yarn coverage:integration
To get a gas report based on unit test calls:
$ yarn gasReport
FAQs
Perennial V2 Trigger Orders
The npm package @perennial/order receives a total of 2 weekly downloads. As such, @perennial/order popularity was classified as not popular.
We found that @perennial/order demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.