Migrate to the velocity program (Anchor 1.0)#78
Open
jordy25519 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This repo was built against the old
driftprogram (protocol-v2, Anchor 0.29, Solana 1.16). Drift was renamed/restructured intovelocity(Anchor 1.0, Solana 3, programvELoC1…), so nothing here builds or targets the live program anymore. This migrates the on-chain program and the TS SDK onto velocity.Note: the program and clients are also being absorbed into the velocity-v1 monorepo (velocity-exchange/velocity-v1#208), which is now the source of truth for the JIT clients. This PR brings the standalone repo current; once the monorepo absorption lands it can be archived.
Approach
The program depends on
velocityby git rev (same pattern as the olddriftdep) and the instruction interface — program idJ1TnP8z…, discriminators, account layouts — is unchanged, so the vendored TS IDL stays valid. The Anchor 0.29 → 1.0 jump is the bulk of the program diff:Contextcollapses to a single lifetime andCpiContext::newnow takes the program id (not itsAccountInfo). Velocity also movedamm.min_order_sizetomarket_statsand flattenedorder_tick_sizeonto the market.The TS SDK becomes
@velocity-exchange/jit-proxyon@velocity-exchange/sdk+ Anchor 1.0, mirroring the vendored copy in the monorepo (drops the perpamm.minOrderSizedust guard velocity removed, and the removedquoteAssetAmounton the synthetic order).Notes
place_and_make_spot_orderis gone); spot takers returnSpotOrdersNotSupported.driftpy(drift program id, PDA seeds, account layouts) and there is no velocity equivalent.release.yml, andon-sdk-update.yml(auto-republished on@drift-labs/sdkupdates and would collide with the monorepo publishing@velocity-exchange/jit-proxy). The verifiable-build inmain.ymlis bumped to velocity's toolchain image.