Skip to content

Instantly share code, notes, and snippets.

pragma solidity ^0.5.0;
contract ERC20 {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
}
@nuevoalex
nuevoalex / Augur.sol
Created March 4, 2019 23:08
Augur flattened
pragma solidity 0.4.24;
library Order {
using SafeMathUint256 for uint256;
enum Types {
Bid, Ask
}
enum TradeDirections {
pragma solidity ^0.5.0;
contract ERC20 {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
}
### LIQUIDITY SORT:
Get 0x bids/asks (remove all bids where gas fees are > max(5 cents, 1% of the trade's value), we should do this for all books on augur in v2)
Fetch all orders to start and store them somewhere that get_orders_down_to_price and get_orders_up_to_price can easily access
midpoint_liquidity = []
outcomes = 0
For outcome in market:
best_bid = get_best_bid(market)
best_ask = get_best_ask(market)
### V2 Invalid Filter:
Get 0x bids (remove all bids where gas fees are > max(5 cents, 1% of the trade's value), we should do this for all books on augur in v2)
valid_revenue = best_bid_quantity*range*(1-reporter_fee-creator_fee)*e^(-.15*time_til_market_finalizes_in_years) - gasToDoATrade - gasToClaimWinnings
valid_cost = best_bid_quantity * (max - best_bid)
valid_profit = valid_revenue - valid_cost
if valid_profit >= 0:
show_market
import In3Client from 'in3';
import { ABI } from 'in3/js/src/modules/eth/api';
declare global {
interface Window { test: any; }
}
window.test = window.test || {};
// use the In3Client
@nuevoalex
nuevoalex / AssToken.md
Created July 22, 2020 00:24
Ass Token

Ass Token

A utility token combining exclusivity of the highest tier, cutting edge Ethereum technology, and the greatest stank yields in all of DEFI.

Purchase (Only appears while tokens are available for purchasing still)

Ass Tokens, your pass to the world of gas powered finance, are available now for .05 ETH per ASS.

field to enter in desired amount field showing price in ETH button to purchase

@nuevoalex
nuevoalex / layer2-spec.md
Last active October 21, 2020 05:38 — forked from pgebheim/layer2-spec.md
Augur Sidechain Specification

Augur Trading on L2 Specification

Goal

The security of the Augur v2 Oracle was designed to be independent of trading, so long as sufficient trading fees can be extracted such that the total REP market cap grows to be able to maintain security of the oracle via Augur's forking mechanism. Because of this design decision it is possible to move Augur v2 Trading off of Layer 1 (ethereum) and on to any other plaform with the constraint that the assets used for trading must be locked up on ethereum when participating.

Since releasing Augur v2 work has been done to implement support for multiple collateral types in Augur. This feature is referred to as "ParaAugur", meaning Parallel Augur. This implementation allows multiple trading implementations, collateralized in arbitrary tokens, to pool their Open Interest such that the security guarantees above remain true. This opens the opportunity for side-chains to interact with a specific collateralization of Augur depending on their use case, and also opens to the