atomicDEX-API
atomicDEX-API copied to clipboard
[Protocol Integration]: Solana
I'm currently implementing Solana
Done:
- Balance
- Balance SPL (Solana Program Library tokens)
- Current Block
- Withdraw (Solana)
- Send raw transaction
Open discussion:
- I propose for Solana a new configuration:
{
"coin": "SOL",
"name": "solana",
"protocol": {
"type": "SOL",
"tokens": {
"USDC": {
"decimals": 6,
"address": "CpMah17kQEL2wqyMKt3mZBdTnZbkbfx4nqmQMFDP5vwp"
}
}
},
"rpcport": 80,
"mm2": 1
}
- my_balance (v2) may have the following signature:
my_balance(token: Option<String>) - usage
solana_coin.my_balance("USDC-SPL") - my_balance_tokens (dispatcher v2) -> return all the token balance at once (more optimal in terms of rate limit.)
Problems:
- I'm not able to compile in WASM yet
- On Linux libudev need to be installed for the CI.
- Our current rust version doesn't compile with Solana SDK, I had to modify one file locally:
--> /home/azureagent/.cargo/git/checkouts/rust-libp2p-98135dbcf5b63918/20183c1/transports/noise/src/protocol/x25519.rs:221:45
|
221 | curve25519_sk.copy_from_slice(&hash.as_ref()[..32]);
| -----^^^^^^--
| | |
| | cannot infer type for type parameter `T` declared on the trait `AsRef`
| this method call resolves to `&T`
|
= note: type must be known at this point
- Solana Client have rates limit
- HTLC capability are not so easy topics
- Solana doesn't implement tx confirmations but instead a commitment:
/// The highest slot of the heaviest fork processed by the node. Ledger state at this slot is
/// not derived from a confirmed or finalized block, but if multiple forks are present, is from
/// the fork the validator believes is most likely to finalize.
Processed,
/// The highest slot that has been voted on by supermajority of the cluster, ie. is confirmed.
/// Confirmation incorporates votes from gossip and replay. It does not count votes on
/// descendants of a block, only direct votes on that block, and upholds "optimistic
/// confirmation" guarantees in release 1.3 and onwards.
Confirmed,
/// The highest slot having reached max vote lockout, as recognized by a supermajority of the
/// cluster.
Finalized,
example of a transaction
- Research if a better secret hash algorithm can be used for solana
Related desktop PR: https://github.com/KomodoPlatform/atomicDEX-Desktop/pull/1679
- [ ] Unignore tests when integration proceeds.
Removing solana implementation from KDF for now as it hinders our ability to update other KDF dependencies, the old ref. implementation is here https://github.com/KomodoPlatform/komodo-defi-framework/tree/solana-ref-impl