KLAYswap
한국어
한국어
  • 소개
  • 프로토콜 개요
  • 핵심 개념
  • 클레이스왑의 장점
  • 위험 & 보안
  • 개인정보처리방침
  • 보안 감사
  • Tokenomics
    • KSP
      • KSP Tokenomics
      • KSP 분배율 자동화
        • 거버넌스 통과 투표 정책
        • KSP 분배율 반영 정책
      • KSP Allocation
  • Product
    • 스왑
    • 단일 예치
      • 단일예치 상세정책
    • 일반 페어 예치(V2)
    • 집중화 페어 예치(V3)
      • V2 to V3 마이그레이션
        • V2 to V3 마이그레이션 가이드
        • V2 to V3 마이그레이션 상세 정책
      • 집중화 페어 풀(V3) 예치
        • 집중화 페어 예치(V3) 가이드
        • 집중화 페어 예치(V3) 상세 정책
      • V3 to V3 마이그레이션
        • V3 to V3 마이그레이션 가이드
        • V3 to V3 마이그레이션 상세 정책
      • 집중화 페어 예치(V3) 출금
        • 집중화 풀(V3) 출금 가이드
        • 집중화 풀(V3) 출금 상세 정책
    • 플러스 예치
      • 플러스 예치 상세 정책
    • 롱/숏 포지션 예치
      • 롱/숏 포지션 오픈과 종료
        • 롱 포지션 오픈
        • 숏 포지션 오픈
        • 롱 포지션 종료
        • 숏 포지션 종료
      • 포지션 예치 상세 정책
    • KSP 스테이킹 & 보팅
      • 스테이킹, 풀 투표 정책
    • 거버넌스
      • 거버넌스 투표 정책
    • Drops(드랍스)
    • Ecopot(에코팟)
    • 풀에어드랍
    • APR & APY
      • TVL
      • Pool
      • Staking
    • 이자율 모델
  • Developers
    • Contract
      • Factory
      • Exchange
      • PoolVoting
      • VotingKSP
      • Treasury
      • Distribution
      • Governor
      • SinglePool
      • SinglePool Factory
      • PlusPool
      • PlusPool Factory
      • Store
      • Utils
      • Single/Plus Utils
      • Helper
      • EcoPotVoting
      • EcoPot
      • V3
        • V3Factory
        • V3Pool
        • NonfungiblePositionManager
        • NonfungibleTokenPositionDescriptor
        • V3SwapRouter
        • V3Migrator
        • V3Estimator
        • PositionMigrator
        • V3Treasury
        • V3AirdropOperator
        • UniversalRouter
    • Airdrop
      • Airdrop Operator 권한 획득
      • Airdrop 계획 진행
    • EcoPot
      • EcoPot Operator 권한 획득
      • EcoPot 계획 진행
  • HOW-TO GUIDES
    • 클레이스왑 가이드
    • 서비스에 연결하기
      • [클립] PC에서 연결하기
      • [클립] 모바일에서 연결하기
      • [카이카스] PC에서 연결하기
    • 활용할 자산 입금하기
      • 클레이튼 자산 입금하기
      • 이더리움/BSC 자산 입금하기
      • 리플 자산 입금하기
    • 풀에 예치하기
      • [클립] PC에서 단일 예치하기
      • [부리또월렛] 모바일에서 단일 예치하기
      • [클립] PC에서 일반 페어 예치 하기
      • [클립] 모바일에서 일반 페어 예치 하기
      • [카이카스] PC에서 일반 페어 예치하기
      • [클립] PC에서 플러스 페어 예치하기
      • [공통] 활용할 자산 선택하기
    • 풀에서 출금하기
      • [클립] PC에서 단일 예치출금하기
      • [클립] PC에서 플러스 예치 출금하기
    • KSP 스테이킹 & 풀 투표하기
      • [클립] PC에서 KSP 스테이킹 하기
      • [클립] 모바일에서 KSP 스테이킹 하기
      • [카이카스] PC에서 KSP 스테이킹 하기
      • [클립] PC에서 풀 투표 하기
      • [클립] 모바일에서 풀 투표 하기
      • [카이카스] PC에서 풀 투표 하기
    • 보상 수령하기
    • FAQ
      • 클레이스왑은 어떤 서비스인가요?
      • 클레이(KLAY) & 클레이스왑(KSP)은 무엇인가요?
      • 유동성 풀(Liquidity pool)이 무엇인가요?
      • 유동성 풀의 예치방법, 특징이 무엇인가요?
      • 왜 클레이스왑에서 예치해야 하나요?
      • 획득한 보상은 어떻게 활용하나요?
  • KLAYswap
  • Orbit Bridge
  • KLAYswap git
  • Orbit Bridge git
  • KLAYswap audit report
Powered by GitBook
On this page
  • Code
  • Address
  • Events, Read-Only Functions, and State-Changing Functions

Was this helpful?

  1. Developers
  2. Contract
  3. V3

V3SwapRouter

PreviousNonfungibleTokenPositionDescriptorNextV3Migrator

Last updated 1 year ago

Was this helpful?

해당 컨트랙트는 KLAYswap V3에 대한 상태 비저장 스왑 실행을 위한 라우터입니다.

Code

Github Link: (Will be updated after official launch)

Address

  • Cypress :

Events, Read-Only Functions, and State-Changing Functions

Parameter Structs

ExactInputSingleParams

struct ExactInputSingleParams {
    address tokenIn;
    address tokenOut;
    uint24 fee;
    address recipient;
    uint256 deadline;
    uint256 amountIn;
    uint256 amountOutMinimum;
    uint160 sqrtPriceLimitX96;
}

ExactInputParams

struct ExactInputParams {
   bytes path;
   address recipient;
   uint256 deadline;
   uint256 amountIn;
   uint256 amountOutMinimum;
}

struct ExactOutputSingleParams {
    address tokenIn;
    address tokenOut;
    uint24 fee;
    address recipient;
    uint256 deadline;
    uint256 amountOut;
    uint256 amountInMaximum;
    uint160 sqrtPriceLimitX96;
}

struct ExactOutputParams {
    bytes path;
    address recipient;
    uint256 deadline;
    uint256 amountOut;
    uint256 amountInMaximum;
}

State-Changing Functions

function uniswapV3SwapCallback(
    int256 amount0Delta,
    int256 amount1Delta,
    bytes data
) external

IUniswapV3Pool#swap을 통해 스왑을 실행한 후 msg.sender에 호출됩니다.

구현 시 스왑에 대한 풀 토큰을 지불해야 합니다. 이 메서드의 호출자는 정식 UniswapV3Factory에 의해 배포된 UniswapV3Pool인지 확인해야 합니다. amount0Delta 및 amount1Delta는 교환된 토큰이 없는 경우 모두 0이 될 수 있습니다.

Name
Type
Description

amount0Delta

int256

스왑이 끝날 때까지 풀에서 전송되었거나(음수) 받아야 하는(양수) token0의 양입니다. 긍정적인 경우 콜백은 해당 양의 token0을 풀로 보내야 합니다.

amount1Delta

int256

스왑이 끝날 때까지 풀에서 전송되었거나(음수) 받아야 하는(양수) token1의 양입니다. 긍정적인 경우 콜백은 해당 양의 token1을 풀로 보내야 합니다.

data

bytes

IUniswapV3Pool Actions#swap 호출을 통해 호출자가 전달한 모든 데이터

function exactInputSingle(
    struct ISwapRouter.ExactInputSingleParams params
) external returns (uint256 amountOut)

한 토큰의 amountIn을 다른 토큰의 가능한 한 많이 스왑합니다.

Name
Type
Description

params

struct ISwapRouter.ExactInputSingleParams

calldata에서 ExactInputSingleParams로 인코딩된 스왑에 필요한 매개변수

Name
Type
Description

amountOut

uint256

받은 토큰의 양

function exactInput(
    struct ISwapRouter.ExactInputParams params
) external returns (uint256 amountOut)

지정된 경로를 따라 한 토큰의 amountIn을 가능한 한 다른 토큰으로 교환합니다.

Name
Type
Description

params

struct ISwapRouter.ExactInputParams

calldata에서 ExactInputParams로 인코딩된 다중 홉 스왑에 필요한 매개변수

Name
Type
Description

amountOut

uint256

받은 토큰의 양

function exactOutputSingle(
    struct ISwapRouter.ExactOutputSingleParams params    
) external returns (uint256 amountIn)

다른 토큰의 amountOut에 대해 하나의 토큰을 가능한 한 적게 스왑합니다.

Name
Type
Description

params

struct ISwapRouter.ExactOutputSingleParams

calldata에서 ExactOutputSingleParams로 인코딩된 스왑에 필요한 매개변수

Name
Type
Description

amountIn

uint256

입력 토큰의 양

function exactOutput(
    struct ISwapRouter.ExactOutputParams params
) external returns (uint256 amountIn)

지정된 경로를 따라 다른 토큰의 amountOut에 대해 가능한 한 적은 토큰을 교환합니다(반전됨).

Name
Type
Description

params

struct ISwapRouter.ExactOutputParams

calldata에서 ExactOutputParams로 인코딩된 다중 홉 스왑에 필요한 매개변수

Name
Type
Description

amountIn

uint256

입력 토큰의 양

ExactOutputSingleParams

ExactOutputParams

uniswapV3SwapCallback

Parameters:

exactInputSingle

Parameters:

Return Values:

exactInput

Parameters:

Return Values:

exactOutputSingle

Parameters:

Return Values:

exactOutput

Parameters:

Return Values:

0x6c14e2e4bae412137437a8ec9e57263212d141a0
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​