Skip to content

Feat/solana devnet#2

Open
Cooper-Kunz wants to merge 5 commits intomainfrom
feat/solana-devnet
Open

Feat/solana devnet#2
Cooper-Kunz wants to merge 5 commits intomainfrom
feat/solana-devnet

Conversation

@Cooper-Kunz
Copy link
Copy Markdown
Member

Adds Solana Devnet support for creating assets on Doppler's Solana AMM

Comment thread docs/api-reference.md
- `migration.type = "uniswapV3"` is explicitly unsupported (returns `501 MIGRATION_NOT_IMPLEMENTED`)
- `governance: false` (or omitted) for no governance
- `governance: true` (or `{ enabled: true }`) for default token-holder governance (OpenZeppelin Governor)
- EVM requests continue to use the existing EVM schema.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should fix/revert

Comment thread docs/api-reference.md
- `pairing?: { numeraireAddress? }`
- `pricing?: { numerairePriceUsd? }`
- `governance?: false`
- `migration?: { type: "noOp" }`
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

james to confirm

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This correctly documents the current API but there is some configuration left out of it that is supported by the initializer.

For example, the way it hardcodes baseForDistribution and baseForLiquidity to 0

Comment thread docs/api-reference.md
- `governance?: false`
- `migration?: { type: "noOp" }`
- `auction:`
- `type: "multicurve"`:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider reverting

Comment thread docs/api-reference.md
- exit/migration behavior:
- migrate immediately when `maxProceeds` is reached
- otherwise migrate at auction maturity only if `minProceeds` is reached
- `type: "xyk"`
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need more clearly defined types, to add to glossary

Comment thread docs/api-reference.md

#### Solana request constraints

- Solana support is create-only in this iteration.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

standards guidance: always speak as truth, not a stage of iteration

Comment thread docs/api-reference.md
- if a prior create attempt crashed/restarted after tx submit and left the key `in_progress`, retries fail closed with `409 IDEMPOTENCY_KEY_IN_DOUBT`
- when `IDEMPOTENCY_REQUIRE_KEY=true` (always true in shared mode), create requests without header return `422 IDEMPOTENCY_KEY_REQUIRED`
- EVM crash-window retries can return `409 IDEMPOTENCY_KEY_IN_DOUBT`
- Solana ambiguous confirmation retries can return `409 SOLANA_LAUNCH_IN_DOUBT`
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in doubt is confusing

Comment thread docs/configuration.md
- `SOLANA_KEYPAIR`
- JSON array of 64 secret-key bytes
- `SOLANA_CONFIRM_TIMEOUT_MS`
- `SOLANA_DEVNET_USE_ALT`
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could simplify

Comment thread docs/errors.md
- `UNAUTHORIZED`

### Launch creation and policy
### EVM launch creation and policy
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should just call it launch then per network, don't need to top level differentiate between evm and svm

Comment thread src/core/config.ts
mainnetBetaWsUrl?: string;
keypairBytes?: Uint8Array;
confirmTimeoutMs: number;
useAlt: boolean;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can likely remove alt?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should always use the deployed Address Lookup Table (ALT) with our launch transactions.

This is to stay under the transaction size limit by optimizing the number of accounts provided.

Copy link
Copy Markdown

@Sabnock01 Sabnock01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Solana API here is not fully compatible with the current initializer program.

The main incompatibility is that launch creation is built on a stale initializer SDK. The current program now requires base_token_program, quote_token_program, and instructions_sysvar for initialize_launch, but the SDK/API path here still models the older single-tokenProgram account list and omits instructions_sysvar. This same staleness appears in the checked-in SDK IDL/codegen, and the pattern also shows up on adjacent initializer instructions like curve_swap_exact_in, initialize_config, and migrate_launch, so this looks broader than one helper.

Separately, the API is much narrower than the current initializer capabilities: it does not expose supply partitioning, sentinel config, migrator config/init hook, arbitrary quote mint, token-program selection, or a permissionless launch flow.

One additional mismatch: the API accepts u64 totalSupply, but its off-chain curve math drops into JS Number, so full-u64 support is not numerically exact even though the program accepts u64.

Comment on lines +157 to +178
if (
record &&
typeof record === 'object' &&
'payloadHash' in record &&
typeof record.payloadHash === 'string' &&
'createdAtMs' in record &&
typeof record.createdAtMs === 'number'
) {
if ('state' in record && record.state === 'in_doubt' && 'error' in record) {
this.records.set(key, record);
continue;
}

if ('response' in record) {
this.records.set(key, {
state: 'completed',
payloadHash: record.payloadHash,
response: record.response as CreateAnyLaunchResponse,
createdAtMs: record.createdAtMs,
});
}
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would recommend cleaning this up with zod

Comment on lines +364 to +370
if (
parsed.state === 'in_doubt' &&
typeof parsed.error === 'object' &&
parsed.error !== null &&
typeof (parsed.error as { code?: unknown }).code === 'string' &&
typeof (parsed.error as { message?: unknown }).message === 'string'
) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants