Drift Protocol brings on-chain, cross-margined perpetual futures to Solana. Making futures DEXs the best way to trade.
First, run pnpm i to install the dependencies.
Then, run pnpm dev to start the development server and visit localhost:3000.
The SDKDocs component attempts to pull in automatically generated definitions for classes, methods, functions, variables and enums. Each can include descriptions, parameters and return signatures that have been documented inline.
Definitions are pulled directly from the SDK's npm package which is installed in this project and parsed as TSDoc.
rustup has the ability to generate definitions and output them as JSON. This can be done locally by cloning drift-rs and running the cargo doc command. You will need the nightly build as the JSON output is not yet available in the stable release.
rustup default nightly
RUSTDOCFLAGS="-Z unstable-options --output-format json" \
cargo doc --no-deps
This will output the definitions to target/doc/drift_rs.json which needs to be copied into types/drift_rs.json
There is currently no option to exclude external creates and the file is too large to be parsed efficiently. We then need to run post processing to remove external crate definitions:
pnpm run rust-docs
This reduces drift_rs.json from 44mb to about 1mb.
Coming soon
This project is licensed under the MIT License.
Before deploying to vercel, run yarn and commit the package-lock.json file. This is necessary for new navigation routes to show up in the build output.