일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- 컨트렉트 배포 자동화
- 스마트컨트렉트테스트
- ambiguous function description
- 스마트컨트렉트 함수이름 중복 호출
- Vue.js
- 스마트 컨트렉트 함수이름 중복
- chainlink 설명
- ethers
- 계정추상화
- 러스트 기초 학습
- Vue
- rust 기초
- ethers v6
- 러스트기초
- erc4337 contract
- SBT표준
- ethers typescript
- 오블완
- ethers type
- 체인의정석
- vue기초
- git rebase
- multicall
- ethers websocket
- 티스토리챌린지
- 컨트렉트 동일한 함수이름 호출
- erc4337
- 러스트 기초
- 머신러닝기초
- 스마트컨트렉트 예약어 함수이름 중복
- Today
- Total
체인의정석
DeFI 코드 참고 소스 본문
money-legos.studydefi.com/#/dydx
money-legos docs
money-legos.studydefi.com
solo Margin contract를 이용하여 flash loan사용 가능.
1. X 만큼의 토큰을 Withdraw로 빌린다.
2. Call a function (이미 진행됨)
3. X + 2wei 만큼을 Deoposit으로 갚는다
이 3개를 한번에 시킨다.
docs.dydx.exchange/#introduction
dYdX Documentation
docs.dydx.exchange
dydx 공식 문서
However, if you write smart contracts, then our protocol documentation would be useful to you: https://docs.dydx.exchange/#/protocol. A canonical "Flash Loan" would be achieved by chaining Withdraw, Call, and Deposit actions into a single Operation.
flash loan 이라는 것은 Withdraw -> Call -> Deposit 순서대로 한번에 실행시키는 것.
solo의 공식 테스트넷 id=42 (Kovan) 배포 컨트렉트
github.com/dydxprotocol/solo/blob/master/migrations/deployed.json
dydxprotocol/solo
dYdX V2 Margin Trading Protocol. Contribute to dydxprotocol/solo development by creating an account on GitHub.
github.com
dydx에서 지원중인 토큰은 다음과 같다.
// token address
address public WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address public SAI = 0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359;
address public USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
address public DAI = 0x6B175474E89094C44Da98b954EedeAC495271d0F;
이 토큰들을 통하여 플래시론을 실행할 것이므로, 해당 토큰을 잔고로 보유
kovan에서는 dydx의 solo 계정이 있다.
kovan.etherscan.io/address/0x4EC3570cADaAEE08Ae384779B0f3A45EF85289DE#readContract
Contract Address 0x4EC3570cADaAEE08Ae384779B0f3A45EF85289DE | Etherscan
The Contract Address 0x4EC3570cADaAEE08Ae384779B0f3A45EF85289DE page allows users to view the source code, transactions, balances, and analytics for the contract address. Users can also interact and make transactions to the contract directly on Etherscan.
kovan.etherscan.io
29.의 get market을 사용하면 연결된 토큰을 확인할 수 있다.
weth 이더스캔 - kovan
kovan.etherscan.io/address/0xd0A1E359811322d97991E03f863a0C30C2cF029C
Contract Address 0xd0A1E359811322d97991E03f863a0C30C2cF029C | Etherscan
The Contract Address 0xd0A1E359811322d97991E03f863a0C30C2cF029C page allows users to view the source code, transactions, balances, and analytics for the contract address. Users can also interact and make transactions to the contract directly on Etherscan.
kovan.etherscan.io
DAI 이더스캔 - kovan
kovan.etherscan.io/address/0xC4375B7De8af5a38a93548eb8453a498222C4fF2
Contract Address 0xC4375B7De8af5a38a93548eb8453a498222C4fF2 | Etherscan
The Contract Address 0xC4375B7De8af5a38a93548eb8453a498222C4fF2 page allows users to view the source code, transactions, balances, and analytics for the contract address. Users can also interact and make transactions to the contract directly on Etherscan.
kovan.etherscan.io
TEST USDC - kovan
kovan.etherscan.io/address/0x03226d9241875DbFBfE0e814ADF54151e4F3fd4B
Contract Address 0x03226d9241875DbFBfE0e814ADF54151e4F3fd4B | Etherscan
The Contract Address 0x03226d9241875DbFBfE0e814ADF54151e4F3fd4B page allows users to view the source code, transactions, balances, and analytics for the contract address. Users can also interact and make transactions to the contract directly on Etherscan.
kovan.etherscan.io
깃허브에서 DyDX를 사용한 소스를 찾아와 보았다.
그래도 디파이가 인기를 끈지 조금 되어서 그런지 깃허브에서 소스코드를 어렵지 않게 찾을 수 있었다.
github.com/Devilla/eth-arbitrage/blob/master/contracts/Arbitrage.sol
Devilla/eth-arbitrage
A DeFi Arbitrage Bot with DyDx Flashloans. Contribute to Devilla/eth-arbitrage development by creating an account on GitHub.
github.com
'블록체인 > 디파이' 카테고리의 다른 글
UniswapV2 정리 2 - Uniswap V2 Factory (0) | 2022.10.26 |
---|---|
UniswapV2 정리 - UniswapV2Pair & UniswapV2ERC20 컨트렉트 (0) | 2022.10.24 |
Uniswap V2 정리 - 기본 컨셉과 참고링크 (0) | 2022.10.24 |
DeFI - AAVE 분석 (0) | 2021.02.05 |
DeFI 소스코드 분석 - DyDX flashloan (0) | 2021.02.04 |