Squid 백서

Squid

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 27쪽 중 19쪽

as payment to Axelar will be paid in axlUSDC. From Cosmos via IBC * IBC currently is subsidised by relayers and has no implemented fee model, so cross-chain gas payments are free. This will change in the future and Squid's API/SDK will adapt to the new models. # SDK easter eggs # Setting toAmount If you want to buy something worth a certain amount, the best method is to overestimate by more than the expected slippage. We have a method on the SDK to estimate the required `fromAmount` you need to get a `toAmount` on the destination chain. It uses coingecko prices to approximate a number. Get a `fromAmount` based on `fromToken`, `toToken` and `toAmount`. Example usage: ```typescript const ETH = squid.getTokenData( "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "1" ); const USDC = squid.getTokenData( "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "1" ); const usdcToEth = await squid.getFromAmount({ fromToken: USDC, toAmount: "1", toToken: ETH }); // expected: ~1600 const ethToUsdc = await squid.getFromAmount({ fromToken: ETH, toAmount: "200", toToken: USDC }); // expected: ~0.12... // you can also specify slippage percentage (default is 1.5%) const usdcToEth3 = await squid.getFromAmount({ fromToken: USDC, toAmount: "1", toToken: ETH, slippagePercentage: 3 }); // expected: ~1648 ``` # Advanced set up To get started you will need to instantiate and configure the Squid SDK: ```typescript const Squid = new Squid(config) ``` The optional `config` parameter can be used to pass custom configuration to the SDK: ```typescript type Config = { apiKey?: string baseUrl?: string executionSettings?: { infiniteApproval?: boolean } } ``` | Property | Description | | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | apiKey | *API KEY* to have access to *Squid API* (not implemented yet) | | baseUrl | Set the *Squid API URL*, this should be used to set the *environment* | | executionSettings | Customize *executeRoute* method behavior | | executionSettings.infiniteApproval | Set to *false* if you only want to approve the specific amount of tokens to be send in the *executedRoute* method. (infinite approval as default) | # Manually approve a route Usually, the squid sdk will handle approvals, but if you want to manually approve the Squid smart contracts to use tokens for a route, you can use the below command that execute the `approveRoute` method with `ApproveRoute` object as argument and return a `boolean`. Type: [Types](/api-and-sdk-integration/key-concepts/types#approveroute) ```javascript const isApproved = await squid.approveRoute({ signer, route }) ``` This will approve `amount` or `infiniteAmount` of `fromToken` required to do the transfer. Once the tokens are approved, you can execute the route. ### Checking route approval You can also check if the route has been approved using the following method that retrieves an object with `isApproved` and `message` properties ```typescript const { isApproved, message } = await squid.isRouteApproved({ sender, route }) ``` # Manually approve an ERC20 You can also manually approve the Squid smart contract to use ERC20 tokens using `squid.approve` [Types](/api-and-sdk-integration/key-concepts/types#approve) <pre class="language-typescript"><code class="lang-typescript">await squid.approve({ <strong> signer, </strong> spender: "0x6972A415e0572bd2E5E3c7DF307d0AFe32D30955", tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" amount: "100000000000000000000" // if not passed, inifite approval take place }) </code></pre> # Architecture Squid is built around one principle: blockchains are settlement layers, not execution layers. Everything that can be handled offchain, is. Squid Intents is the intent-based settlement protocol at the core of this architecture. It takes what you want to do and handles all the coordination, routing, and verification offchain, so the chain only ever sees what must be true in any trade: a token transfer. Because execution logic lives offchain rather than in smart contracts deployed on individual chains, Squid is not constrained by which chains support smart contracts. This is what gives Squid access to any chain and any token, including Bitcoin, Solana, XRPL, and beyond. ### The Execution Engine Squid Intents uses TEE-verified settlement. A TEE is a sealed environment inside a processor where code runs in hardware-enforced isolation, producing a cryptographic proof that execution was correct. Squid's TEEs are powered by Cubist, who have secured over $10B and maintain decentralized upgrade and deployment pathways. <figure><img src="https://4247625265-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtXbXyuWIO2PwzNc5Dets%2Fuploads%2F0yKtPtI0puOS8tzQl8BW%2F1920x1080%20(1).jpg?alt=media&amp;token=c9b664ed-08f9-4300-8964-0a3169204bb9" alt=""><figcaption></figcaption></figure> ### How a Transaction Gets Routed 1. **You submit your intent via the Squid API, SDK, or widget.** You receive the best quote, sign, and deposit on the source chain. 2. **The Squid API opens an offchain RFQ auction. Market makers compete in real time to fill your order.** The winning market maker fills the order on the destination chain and submits proof to the TEE. 3. **The TEE verifies the fill and signs the release. Funds are released to the market maker on the source chain.** 4. **You receive your tokens on the destination chain once settled. Only a token transfer ever touched the chain.** If anything fails, you are automatically refunded on the source chain within 15 minutes. <figure><img src="https://4247625265-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtXbXyuWIO2PwzNc5Dets%2Fuploads%2F91Xur5egBrIG8O5W7SbA%2F1920x1080%20copy.jpg?alt=media&amp;token=db69f06e-67f9-467a-9446-9810da6b98d1" alt=""><figcaption></figcaption></figure> # FAQ ## What is Squid? Squid is a single integration for seamless cross-chain swaps, bridges, and contract calls across 100+ chains, including EVM, Bitcoin, Solana, Ripple, Hedera, and Cosmos. ## What is Squid Intents? Squid Intents is Squid's intent-based settlement protocol. You tell Squid what you want, and it handles the execution. No expiry windows, no slippage, no failed transactions you have to chase down. ## Is Squid Intents still live? Coral was Squid's original execution engine, built on Axelar and Layer Zero's General Message Passing protocol. It handled cross-chain execution and settlement across EVM chains and safely moved billions. Squid Intents is what we built on top of it once we knew what scale beyond EVM required. ## Is Squid a bridge? Not exactly. Squid uses multiple protocols including Axelar and Layer Zero to route and settle cross-chain transactions. The experience is closer to a swap than a bridge, without the wrapped tokens, the waiting, or the risk. ## What are the fees? Squid charges no protocol fees, but for certain routes we charge a convenience fee on our frontend. Users pay gas on the source chain only. With Squid Intents, gas costs are reduced by up to 90% compared to traditional AMM-based routing. ## What is an RFQ auction? RFQ stands for Request for Quote. Instead of routing through automated liquidity pools, Squid Intents runs an auction where market makers compete to fill your order. The winner gets the trade, you get the best available price at execution time with zero slippage. ## What happens if my transaction fails? Your funds are automatically refunded on the source chain within approximately 15 minutes. No manual intervention needed. ## Do routes expire? No. Unlike older bridging solutions, Squid Intents routes do not expire. You can submit your transaction at any time after receiving a quote. ## Which chains does Squid support? Squid supports 100+ chains including Ethereum, Arbitrum, Base, Hedera, Citrea, XRPL EVM, and more. Bitcoin and Solana support is coming soon. ## What tokens can I swap? Any token on any supported chain. Squid is not limited to chains with smart contracts. ## Has the protocol been audited? Yes. Squid has completed 9 audits and has never suffered a security breach or hack. ## How do I integrate Squid? Through the Squid API, SDK, or widget. All Squid Intents transactions use the /v2/route endpoint. See the integration docs for details. ## What is a TEE? A Trusted Execution Environment is a sealed area inside a processor where code runs in complete isolation, enforced by hardware rather than network consensus. It produces cryptographic proof that the code ran correctly. Squid's TEEs are powered by Cubist. ## Is Squid built on Axelar? Squid integrates with Axelar but is not exclusively built on Axelar. While squids early days used much of Axelar's GMP technology, Squid Intents and many of Squids other products do not utilize GMP anymore. # Liquidity model With the introduction of Squid Intents, Squids liquidity model has evolved to provide superior pricing and efficiency. By leveraging post-deposit RFQ auctions and TEE-verified batched settlement, Squid Intents minimizes onchain logic and maximizes execution quality. Squid Intents sources liquidity differently from traditional AMM-based bridges. Instead of routing through fixed liquidity pools, Squid Intents runs post-deposit RFQ auctions where market makers compete to fill your order at the best available price. <figure><img src="https://4247625265-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtXbXyuWIO2PwzNc5Dets%2Fuploads%2FJNrJTDT7LNq9fpRQbd69%2F1920x1080%20(2).jpg?alt=media&amp;token=a7d9595e-0ad9-41ed-adeb-caea5e70d3a5" alt=""><figcaption></figcaption></figure> This approach allows for tighter pricing, reduced slippage, and a more robust liquidity provision across diverse chains. The system now supports a wider range of market makers and ensures that users consistently receive the best available market price at execution time. Squid supports swapping any to any token across all the chains it supports, utilising existing liquidity. ### Here is how it works: RFQ Auctions When you submit a swap, Squid Intents opens an auction on the source chain after your deposit lands. Market makers bid to fulfill the order on the destination chain. The winning solver settles your tokens directly, hedging their position milliseconds after winning. You get the best market price at execution time, not a pre-quoted estimate padded for volatility. ### Offchain Coordination, Onchain Settlement All execution logic runs offchain inside Squid's TEE-verified infrastructure. The only thing that touches the chain is what must be true in any trade: a token transfer. This keeps gas costs near zero and eliminates the slippage risk that comes with routing through AMM pools. ### Any Token, Any Chain Squid Intents is not dependent on wrapped or synthetic assets to route liquidity. Market makers supply liquidity natively across chains, which means Squid can support any token on any chain, including chains without smart contracts like Bitcoin, Solana, and XRPL.<br> # Transaction times and fees ## Fees For certain routes we charge a convenience fee on our frontend. It is possible for our partners to charge fees via our SDK or API. Partners can elect a % fee they would like to charge, and Squid will receive a portion of this fee. ### Source Chain transactions #### EVM Fees are comprised of the following and are paid in Native Gas * Gas amount needed for any swaps, approvals and transfers * If the "from token" is the Native gas token, this amount is also added to the gas payment * The execution fees for the destination chain #### Cosmos Cosmos transactions are different to EVM transaction as the destination chain gas fees are taken out of the bridge token. e.g for a route that is Osmo:Osmosis > ETH:Ethereum, usually the bridge token will be axlUSDC, and this is where the GMP (bridge) fee will be taken from. If the route is axlWETH > WETH the fee will be taken in WETH.\ Gas payment for source chain will be only the amount needed for the execution on the Cosmos chain, all IBC relaying comes at 0 cost. ### General message passing fees (swap on destination chain) Just like the source chain transactions, the amount gas charged is calculated base off how many swaps, transfers and approvals there are. For transactions where there is a swap on the destination chain, fees are paid using the Native token on the source chain. This fee is paid to Axelar's relayers, who trustlessly pass messages and proofs across chains. Axelar's relayers hold gas on every chain and provide a pricing API which Squid calls to get the expected gas price for a trade. For example if the destination trade will probably cost 50 cents of AVAX in gas, then Squid will instruct the user to pay Axelar's gas service 50 cents worth of Moonbeam, as per the pricing which Axelar gives our backend. ### CCTP Noble Fees CCTP bridge is not considered a transfer and there is no fee for this. # Brand Assets This repository contains Squid's official brand assets. ## $QUID Token Icon ### Token Icon - Circular {% file src="/files/bt2Yp3i4FTc1rVhiY3sO" %} {% file src="/files/hMDzrgQs6cqv3f5ai5ta" %} ### Token Icon - Square {% file src="/files/vENAz9DZqmbGIsZK7aU0" %} {% file src="/files/afUwbnR1O0Qzpk8GOta8" %} ## Squid Text Logo ### Text Logo - Black {% file src="/files/ajPiPF2zNrqGmWfMuyrz" %} {% file src="/files/qit8ahGbGizp17mOgZSr" %} ### Text Logo - White {% file src="/files/estFZ2QGfI3fh7HVRazI" %} {% file src="/files/9jPDIBlVAlrvqe0adefO" %} ## Squid Icon Logo ### Icon Logo - Yellow {% file src="/files/bt2Yp3i4FTc1rVhiY3sO" %} {% file src="/files/hMDzrgQs6cqv3f5ai5ta" %} ### Icon Logo - Purple {% file src="/files/NAMZj6VdjqiUDLpuPCtY" %} {% file src="/files/w9GEC3UCP2335CoIQ9F5" %} ### Icon Logo - Black {% file src="/files/s1CfDjmPuRusDdi6aVgE" %} {% file src="/files/AwzS2hAqHBZxgEGxSost" %} ### Icon Logo - White {% file src="/files/hYzKGFfuVMoTMLka1Nix" %} {% file src="/files/1Ex493cGd68B7DRblfOO" %} # "Powered by Squid" Policy ## Policy Squid requires any app integrating the Squid SDK or API to display a "Powered by Squid" logo. ### "Powered by" Wordmark - Black {% file src="/files/BI6TLaZXbdAaex9MXW9U" %} {% file src="/files/KlKmKv3hVobCfpGFZvqN" %} ### "Powered by" Wordmark - White {% file src="/files/5fNMfk2HuAvl1wSZAEch" %} {% file src="/files/TbVCFQIMgPV9HpEPKq2d" %} # Compliance & Security Squid is committed to operating a secure, compliant cross-chain infrastructure. This page documents Squid's compliance policies, wallet screening, and token whitelisting procedures. *** ## Restricted Jurisdictions Squid does **not** permit swaps originating from or destined for the following sanctioned jurisdictions: * **Cuba** * **Iran** * **North Korea** * **Syria** Transactions involving addresses linked to these jurisdictions will be blocked. *** ## Wallet Screening & AML Squid uses **TRM Labs' blacklist API** to vet wallet addresses for Anti-Money Laundering (AML) compliance. ### How it works * Before processing a route, Squid checks the `fromAddress` and `toAddress` against TRM's risk database. * Wallets flagged for illicit activity by TRM, including association with sanctioned entities, darknet markets, ransomware, or stolen funds, will be blocked from executing transactions. * This screening is applied automatically and does not require any action from integrators. {% hint style="info" %} If a legitimate user's wallet is incorrectly flagged, they should contact [Squid support](https://discord.gg/squidrouter) for resolution. {% endhint %} *** ## Token Whitelisting Squid maintains a **strict token whitelisting process** to prevent fake or spoofed tokens from being available for swaps. ### Why whitelisting? Cross-chain routing involves moving value across multiple DEXs and bridges. Spoofed tokens — tokens mimicking legitimate assets with similar names or symbols — can lead to: * Loss of funds via manipulated liquidity pools * Incorrect pricing and route calculations * Reputation damage for integrators ### Automatic token monitoring Squid continuously monitors and **automatically adds validated tokens** that meet our quality criteria from trusted sources: * [**CoinGecko**](https://www.coingecko.com/) — tokens listed on CoinGecko with verified contract addresses are automatically evaluated for inclusion. * [**Defined.fi**](https://www.defined.fi/) — tokens tracked by Defined.fi with sufficient liquidity and trading activity are automatically evaluated. This ensures that the Squid token list stays up to date with legitimate, actively traded assets without requiring manual submissions for well-known tokens. ### Manual token whitelisting For tokens not yet picked up automatically, you can submit a request: 1. **Submit a request** via the [Token Whitelisting Form](https://form.typeform.com/to/wVLxNgSd?typeform-source=docs.squidrouter.com). 2. The Squid team reviews the token contract for: * Verified source code on the relevant block explorer * Sufficient liquidity on supported DEXs * Legitimate project history and team * No evidence of malicious behavior (honeypots, hidden minting, etc.) 3. Upon approval, the token is added to the supported token list and becomes available via the `/v2/tokens` and `/v2/sdk-info` endpoints. {% hint style="warning" %} Tokens that are not whitelisted will **not** appear in the Squid API responses and cannot be used in route requests. {% endhint %} *** ## Smart Contract Security Squid's smart contracts are designed to **never hold liquidity** — they only orchestrate calls to DEXs and other involved contracts. This avoids security risks usually associated with token bridges. For full audit details, see [Audits & Security](/additional-resources/audits-and-security). *** ## Shared Responsibility Model Squid utilizes a Shared Responsibility Model for security and compliance. Our core cryptographic infrastructure and Trusted Execution Environment (TEE) policy engine are provided by Cubist, which is SOC 2 Type II compliant. This ensures that the hardware-level security, key management, and policy enforcement layers of the Squid platform meet rigorous, audited institutional standards. # Audits & Security ## **Security** Squid's smart contracts are designed to never hold liquidity, they only orchestrate calls to DEXs, and any other involved contracts. They do this, and deal with edge cases around cross-chain mechanics. This avoids security risks usually associated with token bridges. Squid's TEEs are also undergoing constant monitoring. ## Audits **To date, Squid has undergone 9 audits.** Squid emphasizes the security of its platform and the safety of users' assets. Regular audits are conducted to ensure the integrity and security of Squid’s smart contracts and protocols. * 6 audits by [Ackee Blockchain](https://ackee.xyz/) * 1 by [Consensys Diligence](https://consensys.io/diligence/) * 1 Audit by [0xKaden](https://twitter.com/0xkaden?lang=en) * 1 Audit by [n-Var](https://github.com/0xsquid/audits/blob/main/audits/2024-09%20n-var.pdf) We conduct ongoing audits that review all changes to the code to ensure a high degree of security. ## Audit Records <table><thead><tr><th width="144" align="center">Date</th><th>Auditor</th><th>Scope</th></tr></thead><tbody><tr><td align="center">2024-04</td><td><a href="https://github.com/0xsquid/audits/blob/main/audits/2024-04%20Kaden.pdf">Kaden</a></td><td><code>SquidRouter.sol</code>, <code>SquidMulticall.sol</code></td></tr><tr><td align="center">2024-01</td><td><a href="https://github.com/0xsquid/audits/blob/main/audits/2024-01%20Ackee%20Blockchain.pdf">Ackee Blockchain</a></td><td><code>DepositReceiver.sol</code>, <code>ReceiverImplementation.sol</code>, <code>SquidDepositService.sol</code>, <cod
프로젝트로 돌아가기