Closed andropixels closed 3 years ago
The idea of the VALID_CURVE_TYPE
, and the contraints system in general, is to allow different teams to reuse the same token-swap program, but impose certain restrictions as needed. For example, as the person managing the program, you can enforce that you must own all of the accounts, so that other people don't benefit from your work.
Constraints are only ever included if you use the optional production
feature, so you can always redeploy a version of the program built without it! The version currently deployed at SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8
is the Serum version, so they wanted some contraints on curves and fee account ownership.
https://github.com/solana-labs/solana-program-library/blob/master/token-swap/program/src/constraints.rs#L77 in above line the VALID_CURVE TYPE does not include the offset curve type? why is that ? is there any possible way to implement a offset without changing the existing smart contract ?